27 template <BuiltinExtraArguments extra_args>
35 return Arguments::operator[](index);
40 return Arguments::at<S>(index);
44 return Arguments::at<Object>(0);
49 return Arguments::at<JSFunction>(Arguments::length() - 1);
56 return Arguments::length();
62 DCHECK(Arguments::length() >= 1);
72 return Arguments::length() - 1;
79 DCHECK(Arguments::length() >= 2);
86 #define DEF_ARG_TYPE(name, spec) \
87 typedef BuiltinArguments<spec> name##ArgumentsType;
108 #define BUILTIN(name) \
109 MUST_USE_RESULT static Object* Builtin_Impl_##name( \
110 name##ArgumentsType args, Isolate* isolate); \
111 MUST_USE_RESULT static Object* Builtin_##name( \
112 int args_length, Object** args_object, Isolate* isolate) { \
113 name##ArgumentsType args(args_length, args_object); \
115 return Builtin_Impl_##name(args, isolate); \
117 MUST_USE_RESULT static Object* Builtin_Impl_##name( \
118 name##ArgumentsType args, Isolate* isolate)
122 #define BUILTIN(name) \
123 static Object* Builtin_impl##name( \
124 name##ArgumentsType args, Isolate* isolate); \
125 static Object* Builtin_##name( \
126 int args_length, Object** args_object, Isolate* isolate) { \
127 name##ArgumentsType args(args_length, args_object); \
128 return Builtin_impl##name(args, isolate); \
130 static Object* Builtin_impl##name( \
131 name##ArgumentsType args, Isolate* isolate)
136 static inline bool CalledAsConstructor(Isolate* isolate) {
140 StackFrameIterator it(isolate);
141 DCHECK(it.frame()->is_exit());
144 bool reference_result = frame->is_construct();
155 const Smi* kConstructMarker =
Smi::FromInt(StackFrame::CONSTRUCT);
157 bool result = (marker == kConstructMarker);
168 return isolate->heap()->undefined_value();
173 return isolate->heap()->undefined_value();
179 if (len == 0)
return;
191 if (array_proto->elements() != heap->empty_fixed_array())
return false;
197 array_proto = JSObject::cast(iter.
GetCurrent());
198 if (array_proto != native_context->initial_object_prototype())
return false;
199 if (array_proto->elements() != heap->empty_fixed_array())
return false;
211 int first_added_arg) {
216 if (args !=
NULL && array->map()->DictionaryElementsInPrototypeChainOnly()) {
224 if (
map == heap->fixed_array_map()) {
225 if (args ==
NULL || array->HasFastObjectElements())
return elms;
226 }
else if (
map == heap->fixed_cow_array_map()) {
228 if (args ==
NULL || array->HasFastObjectElements())
return elms;
229 }
else if (
map == heap->fixed_double_array_map()) {
230 if (args ==
NULL)
return elms;
237 int args_length = args->length();
238 if (first_added_arg >= args_length)
return handle(array->elements(), isolate);
240 ElementsKind origin_kind = array->map()->elements_kind();
245 int arg_count = args->length() - first_added_arg;
246 Object** arguments = args->arguments() - first_added_arg - (arg_count - 1);
247 for (
int i = 0;
i < arg_count;
i++) {
249 if (arg->IsHeapObject()) {
250 if (arg->IsHeapNumber()) {
259 if (target_kind != origin_kind) {
261 return handle(array->elements(), isolate);
269 if (!FLAG_clever_optimizations)
return false;
273 JSObject::cast(native_context->array_function()->prototype());
283 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
289 name).ToHandleChecked();
291 int argc = args.length() - 1;
293 for (
int i = 0;
i < argc; ++
i) {
299 Execution::Call(isolate,
314 if (!maybe_elms_obj.ToHandle(&elms_obj)) {
319 int len = Smi::cast(array->length())->value();
320 int to_add = args.length() - 1;
324 DCHECK(!array->map()->is_observed());
337 int new_length = len + to_add;
339 if (new_length > elms->length()) {
341 int capacity = new_length + (new_length >> 1) + 16;
343 isolate->factory()->NewUninitializedFixedArray(capacity);
347 elms_obj, 0, kind, new_elms, 0,
356 for (
int index = 0; index < to_add; index++) {
357 elms->set(index + len, args[index + 1],
mode);
360 if (*elms != array->elements()) {
361 array->set_elements(*elms);
368 int elms_len = elms_obj->length();
376 int new_length = len + to_add;
380 if (new_length > elms_len) {
382 int capacity = new_length + (new_length >> 1) + 16;
386 isolate->factory()->NewFixedDoubleArray(capacity));
390 elms_obj, 0, kind, new_elms, 0,
402 for (index = 0; index < to_add; index++) {
403 Object* arg = args[index + 1];
404 new_elms->set(index + len, arg->
Number());
407 if (*new_elms != array->elements()) {
408 array->set_elements(*new_elms);
424 if (!maybe_elms_obj.ToHandle(&elms_obj)) {
429 DCHECK(!array->map()->is_observed());
431 int len = Smi::cast(array->length())->value();
432 if (len == 0)
return isolate->heap()->undefined_value();
435 int new_length = len - 1;
437 accessor->
Get(array, array, new_length, elms_obj).ToHandleChecked();
438 if (element->IsTheHole()) {
450 Heap* heap = isolate->heap();
455 if (!maybe_elms_obj.ToHandle(&elms_obj) ||
461 DCHECK(!array->map()->is_observed());
463 int len = Smi::cast(array->length())->value();
464 if (len == 0)
return heap->undefined_value();
469 accessor->
Get(array, array, 0, elms_obj).ToHandleChecked();
470 if (first->IsTheHole()) {
478 if (elms_obj->IsFixedArray()) {
482 elms->set(len - 1, heap->the_hole_value());
486 elms->set_the_hole(len - 1);
499 Heap* heap = isolate->heap();
504 if (!maybe_elms_obj.ToHandle(&elms_obj) ||
510 DCHECK(!array->map()->is_observed());
511 if (!array->HasFastSmiOrObjectElements()) {
514 int len = Smi::cast(array->length())->value();
515 int to_add = args.length() - 1;
516 int new_length = len + to_add;
530 if (new_length > elms->length()) {
532 int capacity = new_length + (new_length >> 1) + 16;
534 isolate->factory()->NewUninitializedFixedArray(capacity);
539 elms, 0, kind, new_elms, to_add,
543 array->set_elements(*elms);
552 for (
int i = 0;
i < to_add;
i++) {
553 elms->set(
i, args[
i + 1],
mode);
564 Heap* heap = isolate->heap();
567 int relative_start = 0;
568 int relative_end = 0;
571 if (receiver->IsJSArray()) {
572 JSArray* array = JSArray::cast(*receiver);
583 len = Smi::cast(array->length())->value();
588 isolate->context()->native_context()->sloppy_arguments_map();
590 bool is_arguments_object_with_fast_elements =
591 receiver->IsJSObject() &&
592 JSObject::cast(*receiver)->map() == arguments_map;
593 if (!is_arguments_object_with_fast_elements) {
597 JSObject*
object = JSObject::cast(*receiver);
605 if (!len_obj->IsSmi()) {
609 len = Smi::cast(len_obj)->value();
610 if (len > object->elements()->length()) {
617 int n_arguments = args.length() - 1;
624 if (n_arguments > 0) {
627 relative_start = Smi::cast(arg1)->value();
628 }
else if (arg1->IsHeapNumber()) {
629 double start = HeapNumber::cast(arg1)->value();
630 if (start < kMinInt || start >
kMaxInt) {
634 relative_start = std::isnan(start) ? 0 :
static_cast<int>(start);
635 }
else if (!arg1->IsUndefined()) {
639 if (n_arguments > 1) {
642 relative_end = Smi::cast(arg2)->value();
643 }
else if (arg2->IsHeapNumber()) {
644 double end = HeapNumber::cast(arg2)->value();
645 if (end < kMinInt || end >
kMaxInt) {
649 relative_end = std::isnan(end) ? 0 :
static_cast<int>(end);
650 }
else if (!arg2->IsUndefined()) {
659 int k = (relative_start < 0) ?
Max(len + relative_start, 0)
660 :
Min(relative_start, len);
663 int final = (relative_end < 0) ?
Max(len + relative_end, 0)
664 :
Min(relative_end, len);
667 int result_len =
Max(
final - k, 0);
677 for (
int i = k;
i <
final;
i++) {
678 if (!accessor->
HasElement(
object,
object,
i, elms)) {
685 }
else if (!receiver->IsJSArray()) {
692 isolate->factory()->NewJSArray(kind, result_len, result_len);
695 if (result_len == 0)
return *result_array;
699 elms, k, kind,
handle(result_array->elements(), isolate), 0, result_len);
700 return *result_array;
706 Heap* heap = isolate->heap();
711 if (!maybe_elms_obj.ToHandle(&elms_obj) ||
717 DCHECK(!array->map()->is_observed());
719 int len = Smi::cast(array->length())->value();
721 int n_arguments = args.length() - 1;
723 int relative_start = 0;
724 if (n_arguments > 0) {
728 relative_start = Smi::cast(arg1)->value();
729 }
else if (arg1->IsHeapNumber()) {
730 double start = HeapNumber::cast(arg1)->value();
731 if (start < kMinInt || start >
kMaxInt) {
735 relative_start = std::isnan(start) ? 0 :
static_cast<int>(start);
736 }
else if (!arg1->IsUndefined()) {
741 int actual_start = (relative_start < 0) ?
Max(len + relative_start, 0)
742 :
Min(relative_start, len);
749 int actual_delete_count;
750 if (n_arguments == 1) {
751 DCHECK(len - actual_start >= 0);
752 actual_delete_count = len - actual_start;
755 if (n_arguments > 1) {
759 value = Smi::cast(arg2)->value();
765 actual_delete_count =
Min(
Max(value, 0), len - actual_start);
770 int item_count = (n_arguments > 1) ? (n_arguments - 2) : 0;
771 int new_length = len - actual_delete_count + item_count;
778 if (new_length == 0) {
780 elms_obj, elements_kind, actual_delete_count);
781 array->set_elements(heap->empty_fixed_array());
787 isolate->factory()->NewJSArray(elements_kind,
789 actual_delete_count);
791 if (actual_delete_count > 0) {
795 elms_obj, actual_start, elements_kind,
796 handle(result_array->elements(), isolate), 0, actual_delete_count);
799 bool elms_changed =
false;
800 if (item_count < actual_delete_count) {
803 ((actual_start + item_count) <
804 (len - actual_delete_count - actual_start));
806 const int delta = actual_delete_count - item_count;
808 if (elms_obj->IsFixedDoubleArray()) {
824 if (elms_obj->IsFixedDoubleArray()) {
828 elms->FillWithHoles(len - delta, len);
833 elms->FillWithHoles(len - delta, len);
838 if (elms_obj->IsFixedDoubleArray()) {
842 *elms, actual_start + actual_delete_count,
843 (len - actual_delete_count - actual_start));
844 elms->FillWithHoles(new_length, len);
849 actual_start + actual_delete_count,
850 (len - actual_delete_count - actual_start));
851 elms->FillWithHoles(new_length, len);
854 }
else if (item_count > actual_delete_count) {
861 if (new_length > elms->length()) {
863 int capacity = new_length + (new_length >> 1) + 16;
865 isolate->factory()->NewUninitializedFixedArray(capacity);
871 if (actual_start > 0) {
874 elms, 0, kind, new_elms, 0, actual_start);
877 elms, actual_start + actual_delete_count, kind,
878 new_elms, actual_start + item_count,
886 actual_start + actual_delete_count,
887 (len - actual_delete_count - actual_start));
893 for (
int k = actual_start; k < actual_start + item_count; k++) {
894 Object* arg = args[3 + k - actual_start];
896 elms->set(k, Smi::cast(arg)->value());
898 elms->set(k, HeapNumber::cast(arg)->value());
905 for (
int k = actual_start; k < actual_start + item_count; k++) {
906 elms->set(k, args[3 + k - actual_start],
mode);
911 array->set_elements(*elms_obj);
916 return *result_array;
923 int n_arguments = args.length();
926 bool has_double =
false;
929 Heap* heap = isolate->heap();
932 JSObject::cast(native_context->array_function()->prototype());
940 bool is_holey =
false;
941 for (
int i = 0;
i < n_arguments;
i++) {
944 if (!arg->IsJSArray() || !JSArray::cast(arg)->HasFastElements() ||
949 int len = Smi::cast(JSArray::cast(arg)->length())->value();
963 ElementsKind arg_kind = JSArray::cast(arg)->map()->elements_kind();
967 elements_kind = arg_kind;
980 isolate->factory()->NewJSArray(elements_kind,
984 if (result_len == 0)
return *result_array;
989 for (
int i = 0;
i < n_arguments;
i++) {
992 JSArray* array = JSArray::cast(args[
i]);
993 int len = Smi::cast(array->length())->value();
996 accessor->
CopyElements(array, 0, from_kind, storage, j, len);
1003 return *result_array;
1015 NewTypeError(
"strict_poison_pill", HandleVector<Object>(
NULL, 0)));
1023 NewTypeError(
"generator_poison_pill", HandleVector<Object>(
NULL, 0)));
1041 return iter.GetCurrent();
1044 return heap->null_value();
1060 if (!recv->IsJSObject())
return heap->null_value();
1061 Object* sig_obj = info->signature();
1062 if (sig_obj->IsUndefined())
return recv;
1065 Object* recv_type = sig->receiver();
1067 if (!recv_type->IsUndefined()) {
1068 holder =
FindHidden(heap, holder, FunctionTemplateInfo::cast(recv_type));
1069 if (holder == heap->null_value())
return heap->null_value();
1071 Object* args_obj = sig->args();
1073 if (args_obj->IsUndefined())
return holder;
1074 FixedArray* args = FixedArray::cast(args_obj);
1075 int length = args->
length();
1076 if (argc <= length) length = argc - 1;
1077 for (
int i = 0;
i < length;
i++) {
1079 if (argtype->IsUndefined())
continue;
1082 current =
FindHidden(heap, current, FunctionTemplateInfo::cast(argtype));
1083 if (current == heap->null_value()) current = heap->undefined_value();
1090 template <
bool is_construct>
1092 BuiltinArguments<NEEDS_CALLED_FUNCTION> args,
Isolate* isolate) {
1093 DCHECK(is_construct == CalledAsConstructor(isolate));
1098 DCHECK(function->shared()->IsApiFunction());
1101 function->shared()->get_api_func_data(), isolate);
1105 isolate->
factory()->ConfigureInstance(
1113 if (recv->IsUndefined()) args[0] =
function->global_proxy();
1116 Object* raw_holder =
TypeCheck(heap, args.length(), &args[0], *fun_data);
1118 if (raw_holder->IsNull()) {
1122 NewTypeError(
"illegal_invocation",
HandleVector(&
function, 1)));
1125 Object* raw_call_data = fun_data->call_code();
1126 if (!raw_call_data->IsUndefined()) {
1128 Object* callback_obj = call_data->callback();
1130 v8::ToCData<v8::FunctionCallback>(callback_obj);
1131 Object* data_obj = call_data->data();
1134 LOG(isolate, ApiObjectAccess(
"call", JSObject::cast(*args.receiver())));
1135 DCHECK(raw_holder->IsJSObject());
1147 result = heap->undefined_value();
1149 result = *
reinterpret_cast<Object**
>(*value);
1154 if (!is_construct || result->IsJSObject())
return result;
1157 return *args.receiver();
1162 return HandleApiCallHelper<false>(args, isolate);
1167 return HandleApiCallHelper<true>(args, isolate);
1176 bool is_construct_call,
1177 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
1180 DCHECK(!CalledAsConstructor(isolate));
1186 JSObject* obj = JSObject::cast(*receiver);
1191 JSFunction* constructor = JSFunction::cast(obj->
map()->constructor());
1192 DCHECK(constructor->shared()->IsApiFunction());
1194 constructor->shared()->get_api_func_data()->instance_call_handler();
1195 DCHECK(!handler->IsUndefined());
1197 Object* callback_obj = call_data->callback();
1199 v8::ToCData<v8::FunctionCallback>(callback_obj);
1205 LOG(isolate, ApiObjectAccess(
"call non-function", obj));
1216 result = heap->undefined_value();
1218 result = *
reinterpret_cast<Object**
>(*value);
1433 #define DEF_ENUM_C(name, ignore) FUNCTION_ADDR(Builtin_##name),
1439 #define DEF_JS_NAME(name, ignore) #name,
1440 #define DEF_JS_ARGC(ignore, argc) argc,
1460 #define BUILTIN_FUNCTION_TABLE_INIT { V8_ONCE_INIT, {} }
1491 #define DEF_FUNCTION_PTR_C(aname, aextra_args) \
1492 functions->generator = FUNCTION_ADDR(Generate_Adaptor); \
1493 functions->c_code = FUNCTION_ADDR(Builtin_##aname); \
1494 functions->s_name = #aname; \
1495 functions->name = c_##aname; \
1496 functions->flags = Code::ComputeFlags(Code::BUILTIN); \
1497 functions->extra_args = aextra_args; \
1500 #define DEF_FUNCTION_PTR_A(aname, kind, state, extra) \
1501 functions->generator = FUNCTION_ADDR(Generate_##aname); \
1502 functions->c_code = NULL; \
1503 functions->s_name = #aname; \
1504 functions->name = k##aname; \
1505 functions->flags = Code::ComputeFlags(Code::kind, \
1508 functions->extra_args = NO_EXTRA_ARGUMENTS; \
1511 #define DEF_FUNCTION_PTR_H(aname, kind) \
1512 functions->generator = FUNCTION_ADDR(Generate_##aname); \
1513 functions->c_code = NULL; \
1514 functions->s_name = #aname; \
1515 functions->name = k##aname; \
1516 functions->flags = Code::ComputeHandlerFlags(Code::kind); \
1517 functions->extra_args = NO_EXTRA_ARGUMENTS; \
1525 #undef DEF_FUNCTION_PTR_C
1526 #undef DEF_FUNCTION_PTR_A
1543 const size_t buffer_size = 32*
KB;
1545 const size_t buffer_size = 8*
KB;
1547 union {
int force_alignment;
byte buffer[buffer_size]; } u;
1552 if (create_heap_objects) {
1556 Generator g = FUNCTION_CAST<Generator>(functions[
i].generator);
1561 g(&masm, functions[
i].
name, functions[
i].extra_args);
1570 CodeCreateEvent(Logger::BUILTIN_TAG, *code, functions[
i].s_name));
1573 #ifdef ENABLE_DISASSEMBLER
1574 if (FLAG_print_builtin_code) {
1577 os <<
"Builtin: " << functions[
i].
s_name <<
"\n";
1578 code->Disassemble(functions[
i].s_name, os);
1628 #define DEFINE_BUILTIN_ACCESSOR_C(name, ignore) \
1629 Handle<Code> Builtins::name() { \
1630 Code** code_address = \
1631 reinterpret_cast<Code**>(builtin_address(k##name)); \
1632 return Handle<Code>(code_address); \
1634 #define DEFINE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \
1635 Handle<Code> Builtins::name() { \
1636 Code** code_address = \
1637 reinterpret_cast<Code**>(builtin_address(k##name)); \
1638 return Handle<Code>(code_address); \
1640 #define DEFINE_BUILTIN_ACCESSOR_H(name, kind) \
1641 Handle<Code> Builtins::name() { \
1642 Code** code_address = \
1643 reinterpret_cast<Code**>(builtin_address(k##name)); \
1644 return Handle<Code>(code_address); \
1650 #undef DEFINE_BUILTIN_ACCESSOR_C
1651 #undef DEFINE_BUILTIN_ACCESSOR_A
#define DEF_FUNCTION_PTR_A(aname, kind, state, extra)
#define DEF_ARG_TYPE(name, spec)
#define DEF_ENUM_C(name, ignore)
#define DEF_FUNCTION_PTR_C(aname, aextra_args)
#define DEF_JS_ARGC(ignore, argc)
#define DEF_JS_NAME(name, ignore)
#define BUILTIN_FUNCTION_TABLE_INIT
#define DEFINE_BUILTIN_ACCESSOR_A(name, kind, state, extra)
#define DEFINE_BUILTIN_ACCESSOR_H(name, kind)
#define DEF_FUNCTION_PTR_H(aname, kind)
#define DEFINE_BUILTIN_ACCESSOR_C(name, ignore)
#define BUILTIN_LIST_C(V)
#define BUILTIN_LIST_DEBUG_A(V)
#define BUILTINS_LIST_JS(V)
#define BUILTIN_LIST_H(V)
#define BUILTIN_LIST_A(V)
bool IsEmpty() const
Returns true if the handle is empty.
void GetCode(CodeDesc *desc)
BuiltinDesc * functions()
BuiltinDesc functions_[Builtins::builtin_count+1]
void IterateBuiltins(ObjectVisitor *v)
static void InitBuiltinFunctionTable()
const char * Lookup(byte *pc)
static void Generate_InterruptCheck(MacroAssembler *masm)
Object * builtins_[builtin_count]
void SetUp(Isolate *isolate, bool create_heap_objects)
const char * name(int index)
const char * names_[builtin_count]
static void Generate_StackCheck(MacroAssembler *masm)
static Address const c_functions_[cfunction_count]
static int const javascript_argc_[id_count]
static const char *const javascript_names_[id_count]
Context * native_context()
static void GenerateStoreICDebugBreak(MacroAssembler *masm)
static void GenerateLoadICDebugBreak(MacroAssembler *masm)
static void GeneratePlainReturnLiveEdit(MacroAssembler *masm)
static void GenerateCallConstructStubDebugBreak(MacroAssembler *masm)
static void GenerateCallConstructStubRecordDebugBreak(MacroAssembler *masm)
static void GenerateCallFunctionStubDebugBreak(MacroAssembler *masm)
static void GenerateCompareNilICDebugBreak(MacroAssembler *masm)
static void GenerateKeyedStoreICDebugBreak(MacroAssembler *masm)
static void GenerateCallICStubDebugBreak(MacroAssembler *masm)
static void GenerateFrameDropperLiveEdit(MacroAssembler *masm)
static void GenerateKeyedLoadICDebugBreak(MacroAssembler *masm)
static void GenerateReturnDebugBreak(MacroAssembler *masm)
static void GenerateSlotDebugBreak(MacroAssembler *masm)
static void GenerateStoreSlow(MacroAssembler *masm)
virtual void CopyElements(Handle< FixedArrayBase > source, uint32_t source_start, ElementsKind source_kind, Handle< FixedArrayBase > destination, uint32_t destination_start, int copy_size)=0
static const int kCopyToEndAndInitializeToHole
virtual bool HasElement(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
virtual MUST_USE_RESULT MaybeHandle< Object > Get(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
static ElementsAccessor * ForKind(ElementsKind elements_kind)
virtual MUST_USE_RESULT MaybeHandle< Object > SetLength(Handle< JSArray > holder, Handle< Object > new_length)=0
static const int kCallerFPOffset
static const int kMaxLength
static const int kMaxLength
v8::Handle< v8::Value > Call(FunctionCallback f)
bool IsTemplateFor(Object *object)
static Handle< T > cast(Handle< S > that)
void MoveElements(FixedArray *array, int dst_index, int src_index, int len)
LargeObjectSpace * lo_space()
bool CanMoveObjectStart(HeapObject *object)
FixedArrayBase * LeftTrimFixedArray(FixedArrayBase *obj, int elements_to_trim)
static const int kArgumentsLengthIndex
static Address c_entry_fp(ThreadLocalTop *thread)
Handle< Context > native_context()
CodeTracer * GetCodeTracer()
static bool WouldChangeReadOnlyLength(Handle< JSArray > array, uint32_t index)
static void TransitionElementsKind(Handle< JSObject > object, ElementsKind to_kind)
static Handle< FixedArray > EnsureWritableFastElements(Handle< JSObject > object)
static void EnsureCanContainElements(Handle< JSObject > object, Object **elements, uint32_t count, EnsureElementsMode mode)
ElementsKind GetElementsKind()
static void GeneratePreMonomorphic(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm)
static void GenerateMiss(MacroAssembler *masm)
static void GenerateString(MacroAssembler *masm)
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
static void GenerateGeneric(MacroAssembler *masm)
static void GenerateMiss(MacroAssembler *masm)
static void GeneratePreMonomorphic(MacroAssembler *masm)
static void GenerateSloppyArguments(MacroAssembler *masm)
static void GenerateGeneric(MacroAssembler *masm, StrictMode strict_mode)
static void GenerateInitialize(MacroAssembler *masm)
bool Contains(HeapObject *obj)
static void GenerateNormal(MacroAssembler *masm)
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
static void GenerateMiss(MacroAssembler *masm)
void TailCallRuntime(Runtime::FunctionId fid, int num_arguments, int result_size)
Handle< Object > CodeObject()
bool has_instance_call_handler()
static Object *& Object_at(Address addr)
static Address & Address_at(Address addr)
static void GenerateLoadViaGetterForDeopt(MacroAssembler *masm)
static void GenerateStoreViaSetterForDeopt(MacroAssembler *masm)
static void GenerateSlow(MacroAssembler *masm)
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
void VerifyApiCallResultType()
A class to uniformly access the prototype of any Object and walk its prototype chain.
bool IsAtEnd(WhereToEnd where_to_end=END_AT_NULL) const
Object * GetCurrent() const
static const int kMaxValue
static Smi * FromInt(int value)
static const int kMarkerOffset
static void GenerateMiss(MacroAssembler *masm)
static void GenerateNormal(MacroAssembler *masm)
const T & at(int index) const
Handle< Object > receiver()
Handle< JSFunction > called_function()
BuiltinArguments(int length, Object **arguments)
Handle< S > at(int index)
#define PROFILE(IsolateGetter, Call)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate)
#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call)
#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call)
#define RETURN_FAILURE_ON_EXCEPTION(isolate, call)
#define LOG(isolate, Call)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
void CallOnce(OnceType *once, NoArgFunction init_func)
HANDLE HANDLE LPSTACKFRAME64 StackFrame
@ DONT_ALLOW_DOUBLE_ELEMENTS
static void Generate_KeyedLoadIC_Generic(MacroAssembler *masm)
bool IsFastHoleyElementsKind(ElementsKind kind)
static void Generate_CallFunctionStub_DebugBreak(MacroAssembler *masm)
static void Generate_KeyedStoreIC_Miss(MacroAssembler *masm)
static bool ArrayPrototypeHasNoElements(Heap *heap, Context *native_context, JSObject *array_proto)
static void Generate_KeyedLoadIC_Slow(MacroAssembler *masm)
static void MoveDoubleElements(FixedDoubleArray *dst, int dst_index, FixedDoubleArray *src, int src_index, int len)
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
static MUST_USE_RESULT Object * HandleApiCallAsFunctionOrConstructor(Isolate *isolate, bool is_construct_call, BuiltinArguments< NO_EXTRA_ARGUMENTS > args)
bool IsFastSmiOrObjectElementsKind(ElementsKind kind)
static void Generate_KeyedStoreIC_DebugBreak(MacroAssembler *masm)
static void Generate_StoreIC_DebugBreak(MacroAssembler *masm)
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, ElementsKind to_kind)
static void Generate_KeyedStoreIC_PreMonomorphic_Strict(MacroAssembler *masm)
static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler *masm)
static void Generate_KeyedStoreIC_Generic(MacroAssembler *masm)
static void Generate_KeyedStoreIC_Initialize_Strict(MacroAssembler *masm)
static void Generate_CallConstructStub_DebugBreak(MacroAssembler *masm)
ElementsKind GetPackedElementsKind(ElementsKind holey_kind)
static void Generate_LoadIC_Normal(MacroAssembler *masm)
static void Generate_KeyedLoadIC_Miss(MacroAssembler *masm)
bool IsHoleyElementsKind(ElementsKind kind)
static void Generate_LoadIC_Getter_ForDeopt(MacroAssembler *masm)
static void Generate_LoadIC_DebugBreak(MacroAssembler *masm)
void MemMove(void *dest, const void *src, size_t size)
kSerializedDataOffset Object
static void Generate_KeyedLoadIC_String(MacroAssembler *masm)
static void Generate_CompareNilIC_DebugBreak(MacroAssembler *masm)
static void Generate_StoreIC_Miss(MacroAssembler *masm)
bool IsFastDoubleElementsKind(ElementsKind kind)
Handle< T > handle(T *t, Isolate *isolate)
static void Generate_CallICStub_DebugBreak(MacroAssembler *masm)
static void Generate_KeyedStoreIC_Initialize(MacroAssembler *masm)
static bool IsJSArrayFastElementMovingAllowed(Heap *heap, JSArray *receiver)
static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler *masm)
static MUST_USE_RESULT Object * CallJsBuiltin(Isolate *isolate, const char *name, BuiltinArguments< NO_EXTRA_ARGUMENTS > args)
static MUST_USE_RESULT Object * HandleApiCallHelper(BuiltinArguments< NEEDS_CALLED_FUNCTION > args, Isolate *isolate)
ElementsKind GetHoleyElementsKind(ElementsKind packed_kind)
static void Generate_KeyedLoadIC_PreMonomorphic(MacroAssembler *masm)
static LifetimePosition Max(LifetimePosition a, LifetimePosition b)
static void Generate_PlainReturn_LiveEdit(MacroAssembler *masm)
static void Generate_LoadIC_Slow(MacroAssembler *masm)
static void Generate_Return_DebugBreak(MacroAssembler *masm)
static MUST_USE_RESULT MaybeHandle< FixedArrayBase > EnsureJSArrayWithWritableFastElements(Isolate *isolate, Handle< Object > receiver, Arguments *args, int first_added_arg)
Vector< Handle< Object > > HandleVector(v8::internal::Handle< T > *elms, int length)
static void Generate_CallConstructStub_Recording_DebugBreak(MacroAssembler *masm)
static Object * TypeCheck(Heap *heap, int argc, Object **argv, FunctionTemplateInfo *info)
static void Generate_FrameDropper_LiveEdit(MacroAssembler *masm)
static void Generate_KeyedStoreIC_Slow(MacroAssembler *masm)
static void Generate_KeyedStoreIC_SloppyArguments(MacroAssembler *masm)
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
static void Generate_KeyedLoadIC_DebugBreak(MacroAssembler *masm)
static void Generate_KeyedLoadIC_Initialize(MacroAssembler *masm)
static BuiltinFunctionTable builtin_function_table
static void Generate_LoadIC_Miss(MacroAssembler *masm)
static void Generate_StoreIC_Normal(MacroAssembler *masm)
ElementsKind GetInitialFastElementsKind()
static void Generate_Slot_DebugBreak(MacroAssembler *masm)
static void Generate_StoreIC_Slow(MacroAssembler *masm)
static void Generate_KeyedStoreIC_PreMonomorphic(MacroAssembler *masm)
static Object * FindHidden(Heap *heap, Object *object, FunctionTemplateInfo *type)
ArrayStorageAllocationMode
@ INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE
@ DONT_INITIALIZE_ARRAY_ELEMENTS
bool IsFastObjectElementsKind(ElementsKind kind)
Debugger support for the V8 JavaScript engine.
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)
BuiltinExtraArguments extra_args