43 char IC::TransitionMarkFromState(
IC::State state) {
61 void IC::TraceIC(
const char* type,
67 HEAP->undefined_value(),
68 HEAP->undefined_value());
70 StackFrameIterator it;
71 while (it.frame()->fp() != this->
fp()) it.Advance();
73 if (raw_frame->is_internal()) {
74 Isolate*
isolate = new_target->GetIsolate();
76 Builtins::kFunctionApply);
77 if (raw_frame->unchecked_code() == apply_builtin) {
80 raw_frame = it.frame();
88 TransitionMarkFromState(old_state),
89 TransitionMarkFromState(new_state),
90 new_can_grow ?
".GROW" :
"");
96 #define TRACE_GENERIC_IC(type, reason) \
98 if (FLAG_trace_ic) { \
99 PrintF("[%s patching generic stub in ", type); \
100 JavaScriptFrame::PrintTop(stdout, false, true); \
101 PrintF(" (%s)]\n", reason); \
106 #define TRACE_GENERIC_IC(type, reason)
109 #define TRACE_IC(type, name, old_state, new_target) \
110 ASSERT((TraceIC(type, name, old_state, new_target), true))
113 ASSERT(isolate == Isolate::Current());
127 pc_address =
reinterpret_cast<Address*
>(fp + kCallerPCOffset);
131 StackFrameIterator it;
132 for (
int i = 0; i < depth + 1; i++) it.Advance();
134 ASSERT(fp == frame->fp() && pc_address == frame->pc_address());
137 pc_address_ = pc_address;
141 #ifdef ENABLE_DEBUGGER_SUPPORT
142 Address IC::OriginalCodeAddress()
const {
147 StackFrameIterator it;
148 while (it.frame()->fp() != this->
fp()) it.Advance();
155 ASSERT(Debug::HasDebugInfo(shared));
156 Code* original_code = Debug::GetDebugInfo(shared)->original_code();
157 ASSERT(original_code->IsCode());
172 static bool HasNormalObjectsInPrototypeChain(
Isolate* isolate,
173 LookupResult* lookup,
175 Object* end = lookup->IsProperty()
176 ? lookup->holder() :
Object::cast(isolate->heap()->null_value());
177 for (
Object* current = receiver;
180 if (current->IsJSObject() &&
182 !current->IsJSGlobalProxy() &&
183 !current->IsJSGlobalObject()) {
192 static bool TryRemoveInvalidPrototypeDependentStub(Code* target,
198 if (cache_holder ==
OWN_MAP && !receiver->IsJSObject()) {
203 receiver->GetPrototype()->IsNull()) {
219 map->RemoveFromCodeCache(
String::cast(name), target, index);
230 if (state !=
MONOMORPHIC || !name->IsString())
return state;
231 if (receiver->IsUndefined() || receiver->IsNull())
return state;
237 if (kind == Code::KEYED_LOAD_IC ||
238 kind == Code::KEYED_STORE_IC ||
239 kind == Code::KEYED_CALL_IC) {
248 if (kind != Code::CALL_IC &&
249 TryRemoveInvalidPrototypeDependentStub(target, receiver, name)) {
259 if (receiver->IsJSBuiltinsObject()) {
271 !it.
done(); it.next()) {
272 RelocInfo* info = it.rinfo();
273 if (info->pc() == addr)
return info->rmode();
300 bool was_uninitialized =
302 bool is_uninitialized =
304 return (was_uninitialized && !is_uninitialized) ? 1 :
305 (!was_uninitialized && is_uninitialized) ? -1 : 0;
310 if (FLAG_type_info_threshold == 0 && !FLAG_watch_ic_patching) {
314 inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
315 if (host->
kind() != Code::FUNCTION)
return;
317 if (FLAG_type_info_threshold > 0 &&
320 int delta = ComputeTypeInfoCountDelta(old_target->
ic_state(),
323 if (host->type_feedback_info()->IsTypeFeedbackInfo() && delta != 0) {
329 if (host->type_feedback_info()->IsTypeFeedbackInfo()) {
334 if (FLAG_watch_ic_patching) {
336 Isolate::Current()->runtime_profiler()->NotifyICChanged();
350 switch (target->
kind()) {
351 case Code::LOAD_IC:
return LoadIC::Clear(address, target);
352 case Code::KEYED_LOAD_IC:
353 return KeyedLoadIC::Clear(address, target);
354 case Code::STORE_IC:
return StoreIC::Clear(address, target);
355 case Code::KEYED_STORE_IC:
356 return KeyedStoreIC::Clear(address, target);
359 case Code::COMPARE_IC:
return CompareIC::Clear(address, target);
360 case Code::UNARY_OP_IC:
361 case Code::BINARY_OP_IC:
362 case Code::TO_BOOLEAN_IC:
375 Isolate::Current()->stub_cache()->FindCallInitialize(
377 contextual ? RelocInfo::CODE_TARGET_CONTEXT : RelocInfo::CODE_TARGET,
383 void KeyedLoadIC::Clear(
Address address,
Code* target) {
392 void LoadIC::Clear(
Address address, Code* target) {
398 void StoreIC::Clear(
Address address, Code* target) {
402 ? initialize_stub_strict()
403 : initialize_stub());
407 void KeyedStoreIC::Clear(
Address address, Code* target) {
411 ? initialize_stub_strict()
412 : initialize_stub());
416 void CompareIC::Clear(
Address address, Code* target) {
418 if (target->major_key() != CodeStub::CompareIC)
return;
427 static bool HasInterceptorGetter(JSObject*
object) {
428 return !
object->GetNamedInterceptor()->getter()->IsUndefined();
432 static void LookupForRead(Handle<Object>
object,
434 LookupResult* lookup) {
438 object->Lookup(*name, lookup);
442 if (!lookup->IsInterceptor() || !lookup->IsCacheable()) {
446 Handle<JSObject> holder(lookup->holder());
447 if (HasInterceptorGetter(*holder)) {
451 holder->LocalLookupRealNamedProperty(*name, lookup);
452 if (lookup->IsFound()) {
453 ASSERT(!lookup->IsInterceptor());
457 Handle<Object> proto(holder->GetPrototype());
458 if (proto->IsNull()) {
459 ASSERT(!lookup->IsFound());
471 if (delegate->IsJSFunction() && !
object->IsJSFunctionProxy()) {
475 StackFrameLocator locator;
487 while (callee->IsJSFunctionProxy()) {
491 if (callee->IsJSFunction()) {
493 if (!function->shared()->is_classic_mode() ||
function->IsBuiltin()) {
500 if (object->IsString() ||
object->IsNumber() ||
object->IsBoolean()) {
503 StackFrameLocator locator;
517 if (object->IsUndefined() ||
object->IsNull()) {
518 return TypeError(
"non_object_property_call",
object, name);
524 if (name->AsArrayIndex(&index)) {
527 if (result->IsJSFunction())
return *result;
531 if (result->IsJSFunction())
return *result;
537 LookupResult lookup(
isolate());
538 LookupForRead(
object, name, &lookup);
540 if (!lookup.IsFound()) {
545 :
TypeError(
"undefined_method",
object, name);
550 UpdateCaches(&lookup, state, extra_ic_state,
object, name);
559 if (lookup.IsInterceptor() && attr ==
ABSENT) {
564 :
TypeError(
"undefined_method",
object, name);
567 ASSERT(!result->IsTheHole());
574 if (result->IsJSFunction()) {
576 #ifdef ENABLE_DEBUGGER_SUPPORT
579 if (debug->StepInActive()) {
582 debug->HandleStepIn(
function,
object,
fp(),
false);
590 if (result->IsJSFunction())
return *result;
592 return TypeError(
"property_not_function",
object, name);
601 JSFunction*
function = lookup->GetConstantFunction();
602 if (!function->shared()->HasBuiltinFunctionId())
return false;
612 switch (function->shared()->builtin_function_id()) {
613 case kStringCharCodeAt:
615 if (object->IsString()) {
622 argc >= 1 && args[1]->IsNumber()) {
624 if (index < 0 || index >= string->
length()) {
647 switch (lookup->type()) {
649 int index = lookup->GetFieldIndex();
651 argc,
kind_, extra_state, name,
object, holder, index);
659 argc,
kind_, extra_state, name,
object, holder,
function);
666 if (holder->IsGlobalObject()) {
672 argc,
kind_, extra_state, name, receiver, global, cell,
function);
680 argc,
kind_, extra_state);
685 ASSERT(HasInterceptorGetter(*holder));
687 argc,
kind_, extra_state, name,
object, holder);
700 if (!lookup->IsProperty() || !lookup->IsCacheable())
return;
702 if (lookup->holder() != *
object &&
703 HasNormalObjectsInPrototypeChain(
704 isolate(), lookup, object->GetPrototype())) {
712 bool had_proto_failure =
false;
719 argc,
kind_, extra_ic_state);
721 if (
kind_ == Code::CALL_IC &&
725 }
else if (
kind_ == Code::CALL_IC &&
726 TryRemoveInvalidPrototypeDependentStub(
target(),
729 had_proto_failure =
true;
734 argc,
kind_, extra_ic_state);
769 if (key->IsSymbol()) {
776 if (object->IsUndefined() ||
object->IsNull()) {
777 return TypeError(
"non_object_property_call",
object, key);
780 if (FLAG_use_ic && state !=
MEGAMORPHIC && object->IsHeapObject()) {
784 if (object->IsJSObject() &&
787 argc, Code::KEYED_CALL_IC);
790 }
else if (!object->IsAccessCheckNeeded()) {
805 if (result->IsJSFunction())
return *result;
808 if (result->IsJSFunction())
return *result;
810 return TypeError(
"property_not_function",
object, key);
819 if (object->IsUndefined() ||
object->IsNull()) {
820 return TypeError(
"non_object_property_load",
object, name);
828 if ((object->IsString() ||
object->IsStringWrapper()) &&
829 name->Equals(isolate()->heap()->length_symbol())) {
832 stub = pre_monomorphic_stub();
834 stub =
object->IsString()
837 }
else if (state ==
MONOMORPHIC && object->IsStringWrapper()) {
840 stub = megamorphic_stub();
845 if (FLAG_trace_ic)
PrintF(
"[LoadIC : +#length /string]\n");
856 if (object->IsJSArray() &&
857 name->Equals(
isolate()->heap()->length_symbol())) {
860 stub = pre_monomorphic_stub();
864 stub = megamorphic_stub();
869 if (FLAG_trace_ic)
PrintF(
"[LoadIC : +#length /array]\n");
876 if (object->IsJSFunction() &&
877 name->Equals(
isolate()->heap()->prototype_symbol()) &&
881 stub = pre_monomorphic_stub();
885 stub = megamorphic_stub();
890 if (FLAG_trace_ic)
PrintF(
"[LoadIC : +#prototype /function]\n");
900 if (name->AsArrayIndex(&index))
return object->GetElement(index);
903 LookupResult lookup(
isolate());
904 LookupForRead(
object, name, &lookup);
907 if (!lookup.IsFound()) {
911 LOG(
isolate(), SuspectReadEvent(*name, *
object));
916 UpdateCaches(&lookup, state,
object, name);
920 if (lookup.IsInterceptor() || lookup.IsHandler()) {
934 return object->GetProperty(*
object, &lookup, *name, &attr);
938 void LoadIC::UpdateCaches(LookupResult* lookup,
943 if (!lookup->IsCacheable())
return;
947 if (!object->IsJSObject())
return;
950 if (HasNormalObjectsInPrototypeChain(
isolate(), lookup, *
object))
return;
958 code = pre_monomorphic_stub();
959 }
else if (!lookup->IsProperty()) {
964 Handle<JSObject> holder(lookup->holder());
965 switch (lookup->type()) {
968 name, receiver, holder, lookup->GetFieldIndex());
971 Handle<JSFunction> constant(lookup->GetConstantFunction());
973 name, receiver, holder, constant);
977 if (holder->IsGlobalObject()) {
979 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(lookup));
981 name, receiver, global, cell, lookup->IsDontDelete());
987 if (!holder.is_identical_to(receiver))
return;
992 Handle<Object> callback(lookup->GetCallbackObject());
993 if (callback->IsAccessorInfo()) {
995 if (v8::ToCData<Address>(info->getter()) == 0)
return;
996 if (!info->IsCompatibleReceiver(*receiver))
return;
998 name, receiver, holder, info);
999 }
else if (callback->IsAccessorPair()) {
1000 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter());
1001 if (!getter->IsJSFunction())
return;
1002 if (holder->IsGlobalObject())
return;
1003 if (!holder->HasFastProperties())
return;
1005 name, receiver, holder, Handle<JSFunction>::cast(getter));
1007 ASSERT(callback->IsForeign());
1014 ASSERT(HasInterceptorGetter(*holder));
1016 name, receiver, holder);
1063 for (
int i = 0; i < receiver_maps->length(); ++i) {
1066 receiver_map, strict_mode, growth_mode);
1067 handler_ics.Add(cached_stub);
1071 receiver_maps, &handler_ics);
1074 CodeCreateEvent(Logger::KEYED_LOAD_MEGAMORPHIC_IC_TAG, *code, 0));
1082 if (key->IsHeapNumber()) {
1085 key = isolate->
factory()->nan_symbol();
1087 int int_value =
FastD2I(value);
1092 }
else if (key->IsUndefined()) {
1093 key = isolate->
factory()->undefined_symbol();
1102 bool force_generic_stub) {
1105 key = TryConvertKey(key,
isolate());
1107 if (key->IsSymbol()) {
1112 if (object->IsUndefined() ||
object->IsNull()) {
1113 return TypeError(
"non_object_property_load",
object, name);
1120 if (object->IsString() &&
1121 name->Equals(
isolate()->heap()->length_symbol())) {
1132 if (object->IsJSArray() &&
1133 name->Equals(
isolate()->heap()->length_symbol())) {
1140 return array->length();
1144 if (object->IsJSFunction() &&
1145 name->Equals(
isolate()->heap()->prototype_symbol()) &&
1161 if (name->AsArrayIndex(&index)) {
1163 if (FLAG_use_ic)
set_target(*generic_stub());
1168 LookupResult lookup(
isolate());
1169 LookupForRead(
object, name, &lookup);
1177 UpdateCaches(&lookup, state,
object, name);
1181 if (lookup.IsInterceptor()) {
1194 return object->GetProperty(*
object, &lookup, *name, &attr);
1199 bool use_ic = FLAG_use_ic && !
object->IsAccessCheckNeeded();
1203 if (!force_generic_stub) {
1204 if (object->IsString() && key->IsNumber()) {
1208 }
else if (object->IsJSObject()) {
1210 if (receiver->elements()->map() ==
1211 isolate()->
heap()->non_strict_arguments_elements_map()) {
1212 stub = non_strict_arguments_stub();
1213 }
else if (receiver->HasIndexedInterceptor()) {
1214 stub = indexed_interceptor_stub();
1215 }
else if (key->IsSmi() && (
target() != *non_strict_arguments_stub())) {
1232 void KeyedLoadIC::UpdateCaches(LookupResult* lookup,
1237 if (!lookup->IsProperty() || !lookup->IsCacheable())
return;
1239 if (!object->IsJSObject())
return;
1242 if (HasNormalObjectsInPrototypeChain(
isolate(), lookup, *
object))
return;
1251 code = pre_monomorphic_stub();
1255 switch (lookup->type()) {
1258 name, receiver, holder, lookup->GetFieldIndex());
1263 name, receiver, holder, constant);
1267 Handle<Object> callback_object(lookup->GetCallbackObject());
1268 if (!callback_object->IsAccessorInfo())
return;
1269 Handle<AccessorInfo> callback =
1271 if (v8::ToCData<Address>(callback->getter()) == 0)
return;
1272 if (!callback->IsCompatibleReceiver(*receiver))
return;
1274 name, receiver, holder, callback);
1278 ASSERT(HasInterceptorGetter(lookup->holder()));
1280 name, receiver, holder);
1285 code = generic_stub();
1303 static bool StoreICableLookup(LookupResult* lookup) {
1305 if (!lookup->IsFound())
return false;
1308 if (!lookup->IsCacheable())
return false;
1311 if (lookup->IsTransition()) {
1312 return !lookup->GetTransitionDetails().IsReadOnly();
1314 return !lookup->IsReadOnly();
1318 static bool LookupForWrite(Handle<JSObject> receiver,
1319 Handle<String> name,
1320 LookupResult* lookup) {
1321 receiver->LocalLookup(*name, lookup);
1322 if (!lookup->IsFound()) {
1323 receiver->map()->LookupTransition(*receiver, *name, lookup);
1325 if (!StoreICableLookup(lookup)) {
1327 receiver->Lookup(*name, lookup);
1328 return lookup->IsPropertyCallbacks() && StoreICableLookup(lookup);
1331 if (lookup->IsInterceptor() &&
1332 receiver->GetNamedInterceptor()->setter()->IsUndefined()) {
1333 receiver->LocalLookupRealNamedProperty(*name, lookup);
1334 return StoreICableLookup(lookup);
1346 if (!object->IsJSObject()) {
1348 if (object->IsJSProxy()) {
1355 if (object->IsUndefined() ||
object->IsNull()) {
1356 return TypeError(
"non_object_property_store",
object, name);
1360 if (strict_mode ==
kStrictMode && object->IsString() &&
1361 name->Equals(
isolate()->heap()->length_symbol())) {
1362 return TypeError(
"strict_read_only_property",
object, name);
1373 if (name->AsArrayIndex(&index)) {
1383 if (receiver->IsJSArray() &&
1384 name->Equals(
isolate()->heap()->length_symbol()) &&
1386 receiver->HasFastProperties()) {
1388 if (FLAG_trace_ic)
PrintF(
"[StoreIC : +#length /array]\n");
1394 return receiver->SetProperty(*name, *value,
NONE, strict_mode);
1398 if (!receiver->IsJSGlobalProxy()) {
1399 LookupResult lookup(
isolate());
1401 if (LookupForWrite(receiver, name, &lookup)) {
1403 UpdateCaches(&lookup, state, strict_mode, receiver, name, value);
1409 if (lookup.IsProperty() && lookup.IsReadOnly()) {
1410 return TypeError(
"strict_read_only_property",
object, name);
1418 if (receiver->IsJSGlobalProxy()) {
1423 ? global_proxy_stub_strict()
1424 : global_proxy_stub();
1432 return receiver->SetProperty(*name,
1440 void StoreIC::UpdateCaches(LookupResult* lookup,
1446 ASSERT(!receiver->IsJSGlobalProxy());
1447 ASSERT(StoreICableLookup(lookup));
1448 ASSERT(lookup->IsFound());
1451 ASSERT(!lookup->IsHandler());
1467 lookup->GetFieldIndex(),
1472 if (receiver->IsGlobalObject()) {
1479 name, global, cell, strict_mode);
1481 if (!holder.is_identical_to(receiver))
return;
1486 Handle<Object> callback(lookup->GetCallbackObject());
1487 if (callback->IsAccessorInfo()) {
1489 if (v8::ToCData<Address>(info->setter()) == 0)
return;
1490 if (!holder->HasFastProperties())
return;
1491 if (!info->IsCompatibleReceiver(*receiver))
return;
1493 name, receiver, holder, info, strict_mode);
1494 }
else if (callback->IsAccessorPair()) {
1495 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter());
1496 if (!setter->IsJSFunction())
return;
1497 if (holder->IsGlobalObject())
return;
1498 if (!holder->HasFastProperties())
return;
1500 name, receiver, holder, Handle<JSFunction>::cast(setter),
1503 ASSERT(callback->IsForeign());
1510 ASSERT(!receiver->GetNamedInterceptor()->setter()->IsUndefined());
1512 name, receiver, strict_mode);
1517 Handle<Map> transition(lookup->GetTransitionTarget());
1518 int descriptor = transition->LastAdded();
1520 DescriptorArray* target_descriptors = transition->instance_descriptors();
1521 PropertyDetails details = target_descriptors->GetDetails(descriptor);
1523 if (details.type() !=
FIELD || details.attributes() !=
NONE)
return;
1525 int field_index = target_descriptors->GetFieldIndex(descriptor);
1527 name, receiver, field_index, transition, strict_mode);
1544 ? megamorphic_stub_strict()
1545 : megamorphic_stub());
1556 static bool AddOneReceiverMapIfMissing(
MapHandleList* receiver_maps,
1557 Handle<Map> new_receiver_map) {
1558 ASSERT(!new_receiver_map.is_null());
1559 for (
int current = 0; current < receiver_maps->length(); ++current) {
1560 if (!receiver_maps->at(current).is_null() &&
1561 receiver_maps->at(current).is_identical_to(new_receiver_map)) {
1565 receiver_maps->Add(new_receiver_map);
1570 void KeyedIC::GetReceiverMapsForStub(Handle<Code> stub,
1572 ASSERT(stub->is_inline_cache_stub());
1574 return result->Add(
isolate()->factory()->string_map());
1575 }
else if (stub->is_keyed_load_stub() || stub->is_keyed_store_stub()) {
1577 result->Add(Handle<Map>(stub->FindFirstMap()));
1580 AssertNoAllocation no_allocation;
1581 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
1582 for (RelocIterator it(*stub, mask); !it.done(); it.next()) {
1583 RelocInfo* info = it.rinfo();
1584 Handle<Object> object(info->target_object());
1586 AddOneReceiverMapIfMissing(result, Handle<Map>::cast(
object));
1607 return generic_stub;
1610 bool monomorphic =
false;
1611 bool is_transition_stub = IsTransitionStubKind(stub_kind);
1621 if (ic_state ==
MONOMORPHIC && (is_transition_stub || stub_kind ==
LOAD)) {
1630 target_receiver_maps.
at(0)->elements_kind(),
1631 receiver->GetElementsKind());
1636 if (is_transition_stub) {
1637 monomorphic_map = ComputeTransitionedMap(receiver, stub_kind);
1638 ASSERT(*monomorphic_map != *receiver_map);
1639 stub_kind = GetNoTransitionStubKind(stub_kind);
1641 return ComputeMonomorphicStub(
1642 monomorphic_map, stub_kind, strict_mode, generic_stub);
1649 AddOneReceiverMapIfMissing(&target_receiver_maps, receiver_map);
1650 if (IsTransitionStubKind(stub_kind)) {
1651 Handle<Map> new_map = ComputeTransitionedMap(receiver, stub_kind);
1652 map_added |= AddOneReceiverMapIfMissing(&target_receiver_maps, new_map);
1658 return generic_stub;
1665 return generic_stub;
1678 Handle<Object> probe = cache->Lookup(&target_receiver_maps, flags);
1696 ASSERT(receiver_map->has_dictionary_elements() ||
1697 receiver_map->has_fast_smi_or_object_elements() ||
1698 receiver_map->has_fast_double_elements() ||
1699 receiver_map->has_external_array_elements());
1700 bool is_js_array = receiver_map->instance_type() ==
JS_ARRAY_TYPE;
1702 receiver_map->elements_kind(),
1712 ElementsKind elements_kind = receiver_map->elements_kind();
1717 receiver_map, stub_kind, strict_mode);
1719 return generic_stub;
1724 Handle<Map> KeyedIC::ComputeTransitionedMap(Handle<JSObject> receiver,
1725 StubKind stub_kind) {
1726 switch (stub_kind) {
1770 for (
int i = 0; i < receiver_maps->length(); ++i) {
1774 receiver_map->FindTransitionedMap(receiver_maps);
1775 if (!transitioned_map.
is_null()) {
1777 receiver_map->elements_kind(),
1778 transitioned_map->elements_kind(),
1780 strict_mode, grow_mode).GetCode();
1787 handler_ics.Add(cached_stub);
1788 transitioned_maps.Add(transitioned_map);
1792 receiver_maps, &handler_ics, &transitioned_maps);
1795 CodeCreateEvent(Logger::KEYED_STORE_MEGAMORPHIC_IC_TAG, *code, 0));
1805 bool allow_growth = receiver->IsJSArray() &&
1811 if (receiver->HasFastSmiElements()) {
1812 if (value->IsHeapNumber()) {
1813 if (receiver->HasFastHoleyElements()) {
1819 if (value->IsHeapObject()) {
1820 if (receiver->HasFastHoleyElements()) {
1826 }
else if (receiver->HasFastDoubleElements()) {
1827 if (!value->IsSmi() && !value->IsHeapNumber()) {
1828 if (receiver->HasFastHoleyElements()) {
1838 if (receiver->HasFastSmiElements()) {
1839 if (value->IsHeapNumber()) {
1840 if (receiver->HasFastHoleyElements()) {
1845 }
else if (value->IsHeapObject()) {
1846 if (receiver->HasFastHoleyElements()) {
1852 }
else if (receiver->HasFastDoubleElements()) {
1853 if (!value->IsSmi() && !value->IsHeapNumber()) {
1854 if (receiver->HasFastHoleyElements()) {
1871 bool force_generic) {
1874 key = TryConvertKey(key,
isolate());
1876 if (key->IsSymbol()) {
1880 if (object->IsJSProxy()) {
1882 *name, *value,
NONE, strict_mode);
1887 if (object->IsUndefined() ||
object->IsNull()) {
1888 return TypeError(
"non_object_property_store",
object, name);
1892 if (!object->IsJSObject())
return *value;
1897 if (name->AsArrayIndex(&index)) {
1905 if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) {
1906 LookupResult lookup(
isolate());
1907 if (LookupForWrite(receiver, name, &lookup)) {
1908 UpdateCaches(&lookup, state, strict_mode, receiver, name, value);
1913 return receiver->SetProperty(*name, *value,
NONE, strict_mode);
1918 bool use_ic = FLAG_use_ic && !
object->IsAccessCheckNeeded();
1919 ASSERT(!(use_ic && object->IsJSGlobalProxy()));
1923 ? generic_stub_strict()
1925 if (object->IsJSObject()) {
1927 if (receiver->elements()->map() ==
1928 isolate()->
heap()->non_strict_arguments_elements_map()) {
1929 stub = non_strict_arguments_stub();
1930 }
else if (!force_generic) {
1931 if (key->IsSmi() && (
target() != *non_strict_arguments_stub())) {
1932 StubKind stub_kind = GetStubKind(receiver, key, value);
1933 stub =
ComputeStub(receiver, stub_kind, strict_mode, stub);
1939 if (!stub.
is_null()) set_target(*stub);
1946 isolate(),
object , key, value,
NONE, strict_mode);
1950 void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
1956 ASSERT(!receiver->IsJSGlobalProxy());
1957 ASSERT(StoreICableLookup(lookup));
1958 ASSERT(lookup->IsFound());
1961 ASSERT(!lookup->IsHandler());
1976 name, receiver, lookup->GetFieldIndex(),
1980 Handle<Map> transition(lookup->GetTransitionTarget());
1981 int descriptor = transition->LastAdded();
1983 DescriptorArray* target_descriptors = transition->instance_descriptors();
1984 PropertyDetails details = target_descriptors->
GetDetails(descriptor);
1986 if (details.type() ==
FIELD && details.attributes() ==
NONE) {
1987 int field_index = target_descriptors->
GetFieldIndex(descriptor);
1989 name, receiver, field_index, transition, strict_mode);
2001 ? generic_stub_strict()
2019 ? *megamorphic_stub_strict()
2020 : *megamorphic_stub());
2037 ASSERT(args.length() == 2);
2041 MaybeObject* maybe_result = ic.LoadFunction(state,
2046 JSFunction* raw_function =
NULL;
2047 if (!maybe_result->To(&raw_function))
return maybe_result;
2054 if (raw_function->
is_compiled())
return raw_function;
2065 ASSERT(args.length() == 2);
2068 MaybeObject* maybe_result =
2069 ic.LoadFunction(state, args.at<
Object>(0), args.at<
Object>(1));
2071 JSFunction* raw_function =
NULL;
2072 if (!maybe_result->To(&raw_function))
return maybe_result;
2074 if (raw_function->
is_compiled())
return raw_function;
2085 ASSERT(args.length() == 2);
2088 return ic.Load(state, args.at<
Object>(0), args.at<
String>(1));
2095 ASSERT(args.length() == 2);
2098 return ic.Load(state, args.at<
Object>(0), args.at<
Object>(1),
false);
2104 ASSERT(args.length() == 2);
2107 return ic.Load(state, args.at<
Object>(0), args.at<
Object>(1),
true);
2114 ASSERT(args.length() == 3);
2118 return ic.Store(state,
2127 NoHandleAllocation nha;
2129 ASSERT(args.length() == 2);
2138 LookupResult debug_lookup(isolate);
2139 receiver->LocalLookup(isolate->
heap()->length_symbol(), &debug_lookup);
2140 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly());
2144 { MaybeObject* maybe_result = receiver->SetElementsLength(len);
2145 if (!maybe_result->ToObject(&result))
return maybe_result;
2155 NoHandleAllocation na;
2156 ASSERT(args.length() == 3);
2164 ASSERT(object->HasFastProperties());
2165 ASSERT(object->map()->unused_property_fields() == 0);
2168 FixedArray* old_storage =
object->properties();
2170 int new_size = old_storage->length() + new_unused + 1;
2172 { MaybeObject* maybe_result = old_storage->CopySize(new_size);
2173 if (!maybe_result->ToObject(&result))
return maybe_result;
2176 new_storage->
set(old_storage->length(), value);
2179 object->set_properties(new_storage);
2180 object->set_map(transition);
2190 ASSERT(args.length() == 3);
2194 return ic.Store(state,
2204 NoHandleAllocation na;
2205 ASSERT(args.length() == 3);
2223 ASSERT(args.length() == 3);
2227 return ic.Store(state,
2242 switch (type_info) {
2244 case SMI:
return "Smi";
2246 case GENERIC:
return "Generic";
2247 default:
return "Invalid";
2253 switch (type_info) {
2269 if (operand_type.
IsSmi()) {
2271 }
else if (operand_type.
IsNumber()) {
2282 switch (previous_type) {
2284 return current_type;
2307 switch (type_info) {
2309 case SMI:
return "SMI";
2310 case INT32:
return "Int32s";
2312 case ODDBALL:
return "Oddball";
2314 case STRING:
return "Strings";
2315 case GENERIC:
return "Generic";
2316 default:
return "Invalid";
2322 switch (type_info) {
2344 if (x == y)
return x;
2350 if (x > y)
return x;
2362 if (left_type.
IsSmi() && right_type.
IsSmi()) {
2380 }
else if (right_type.
IsString()) {
2385 if (left->IsUndefined() && right->IsNumber())
return ODDBALL;
2386 if (left->IsNumber() && right->IsUndefined())
return ODDBALL;
2393 ASSERT(args.length() == 4);
2408 if (FLAG_trace_ic) {
2409 PrintF(
"[UnaryOpIC (%s->%s)#%s]\n",
2423 builtin = builtins->javascript_builtin(Builtins::UNARY_MINUS);
2425 case Token::BIT_NOT:
2426 builtin = builtins->javascript_builtin(Builtins::BIT_NOT);
2434 bool caught_exception;
2437 if (caught_exception) {
2444 ASSERT(args.length() == 5);
2449 int key = args.smi_at(2);
2484 if (FLAG_trace_ic) {
2485 PrintF(
"[BinaryOpIC (%s->(%s->%s))#%s]\n",
2517 builtin = builtins->javascript_builtin(Builtins::MOD);
2519 case Token::BIT_AND:
2520 builtin = builtins->javascript_builtin(Builtins::BIT_AND);
2523 builtin = builtins->javascript_builtin(Builtins::BIT_OR);
2525 case Token::BIT_XOR:
2526 builtin = builtins->javascript_builtin(Builtins::BIT_XOR);
2529 builtin = builtins->javascript_builtin(Builtins::SHR);
2532 builtin = builtins->javascript_builtin(Builtins::SAR);
2535 builtin = builtins->javascript_builtin(Builtins::SHL);
2543 bool caught_exception;
2550 if (caught_exception) {
2557 Code* CompareIC::GetRawUninitialized(
Token::Value op) {
2560 CHECK(stub.FindCodeInCache(&code));
2567 return stub.GetCode();
2574 ASSERT(key == CodeStub::CompareIC);
2589 case SMIS:
return "SMIS";
2591 case OBJECTS:
return "OBJECTS";
2593 case SYMBOLS:
return "SYMBOLS";
2594 case STRINGS:
return "STRINGS";
2595 case GENERIC:
return "GENERIC";
2604 bool has_inlined_smi_code,
2609 if (x->IsSmi() && y->IsSmi())
return SMIS;
2610 if (x->IsNumber() && y->IsNumber())
return HEAP_NUMBERS;
2614 if ((x->IsNumber() && y->IsUndefined()) ||
2615 (y->IsNumber() && x->IsUndefined())) {
2619 if (x->IsSymbol() && y->IsSymbol()) {
2624 if (x->IsString() && y->IsString())
return STRINGS;
2626 if (x->IsJSObject() && y->IsJSObject()) {
2627 if (Handle<JSObject>::cast(x)->map() ==
2637 return has_inlined_smi_code && x->IsNumber() && y->IsNumber()
2657 NoHandleAllocation na;
2658 ASSERT(args.length() == 3);
2659 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2)));
2660 ic.UpdateCaches(args.at<
Object>(0), args.at<
Object>(1));
2666 ASSERT(args.length() == 3);
2674 bool to_boolean_value = new_types.Record(
object);
2675 old_types.TraceTransition(new_types);
2690 static const Address IC_utilities[] = {
2691 #define ADDR(name) FUNCTION_ADDR(name),
2699 return IC_utilities[id];
virtual Handle< Code > string_stub()
static const int kCallerFPOffset
int IndexInCodeCache(Object *name, Code *code)
static TypeInfo GetTypeInfo(Handle< Object > operand)
static Handle< Object > SetProperty(Handle< JSReceiver > object, Handle< String > key, Handle< Object > value, PropertyAttributes attributes, StrictModeFlag strict_mode)
Code * builtin(Name name)
static bool CompileLazy(Handle< JSFunction > function, ClearExceptionFlag flag)
Object * function() const
static Object *& Object_at(Address addr)
bool IsExternalArrayElementsKind(ElementsKind kind)
void UpdateCaches(LookupResult *lookup, State state, Code::ExtraICState extra_ic_state, Handle< Object > object, Handle< String > name)
virtual Code::Kind kind() const =0
Handle< Code > ComputeLoadNormal()
Handle< Code > ComputeCallGlobal(int argc, Code::Kind, Code::ExtraICState extra_state, Handle< String > name, Handle< JSObject > receiver, Handle< GlobalObject > holder, Handle< JSGlobalPropertyCell > cell, Handle< JSFunction > function)
void set(int index, Object *value)
void PrintF(const char *format,...)
Handle< Code > ComputeKeyedLoadFunctionPrototype(Handle< String > name, Handle< JSFunction > receiver)
Handle< Code > ComputeStoreField(Handle< String > name, Handle< JSObject > receiver, int field_index, Handle< Map > transition, StrictModeFlag strict_mode)
static TypeFeedbackInfo * cast(Object *obj)
static String * cast(Object *obj)
virtual bool IsGeneric() const
static const char * GetName(TypeInfo type_info)
Code * Set(String *name, Map *map, Code *code)
virtual Handle< Code > GetElementStubWithoutMapCheck(bool is_js_array, ElementsKind elements_kind, KeyedAccessGrowMode grow_mode)
double DoubleToInteger(double x)
int unused_property_fields()
static const char * Name(Value tok)
static Smi * FromInt(int value)
#define LOG(isolate, Call)
MUST_USE_RESULT MaybeObject * LoadFunction(State state, Handle< Object > object, Handle< Object > key)
MUST_USE_RESULT MaybeObject * Load(State state, Handle< Object > object, Handle< String > name)
static Handle< T > cast(Handle< S > that)
static Map * cast(Object *obj)
static KeyedAccessGrowMode GetKeyedAccessGrowMode(ExtraICState extra_ic_state)
static Failure * Exception()
#define TRACE_IC(type, name, old_state, new_target)
static MUST_USE_RESULT MaybeObject * SetObjectProperty(Isolate *isolate, Handle< Object > object, Handle< Object > key, Handle< Object > value, PropertyAttributes attr, StrictModeFlag strict_mode)
Handle< Code > ComputeLoadCallback(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< AccessorInfo > callback)
void change_ic_with_type_info_count(int count)
Handle< Code > ComputeKeyedLoadOrStoreElement(Handle< Map > receiver_map, KeyedIC::StubKind stub_kind, StrictModeFlag strict_mode)
static const int kCallerSPOffset
List< Handle< Map > > MapHandleList
Failure * TypeError(const char *type, Handle< Object > object, Handle< Object > key)
#define ASSERT(condition)
Handle< Code > ComputeStoreViaSetter(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< JSFunction > setter, StrictModeFlag strict_mode)
Handle< Code > ComputeCallMegamorphic(int argc, Code::Kind kind, Code::ExtraICState state)
void set_profiler_ticks(int ticks)
int ComputeExpressionsCount() const
#define PROFILE(isolate, Call)
static State StateFrom(Code *target, Object *receiver, Object *name)
Handle< Code > ComputeKeyedLoadInterceptor(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder)
static TypeInfo GetTypeInfo(Handle< Object > left, Handle< Object > right)
static const char * GetName(TypeInfo type_info)
Isolate * isolate() const
static const ExtraICState kNoExtraICState
Handle< Code > ComputeKeyedLoadCallback(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< AccessorInfo > callback)
Handle< Object > GetProperty(Handle< JSReceiver > obj, const char *name)
#define RETURN_IF_EMPTY_HANDLE(isolate, call)
bool IsFastElementsKind(ElementsKind kind)
static uint32_t update(uint32_t previous, StringStubFeedbackvalue)
static TypeInfo TypeFromValue(Handle< Object > value)
MUST_USE_RESULT MaybeObject * Store(State state, StrictModeFlag strict_mode, Handle< Object > object, Handle< String > name, Handle< Object > value)
static Code * cast(Object *obj)
static State ToState(TypeInfo type_info)
void ReceiverToObjectIfRequired(Handle< Object > callee, Handle< Object > object)
void change_own_type_change_checksum()
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check)
static Smi * cast(Object *object)
Handle< Code > ComputeKeyedLoadArrayLength(Handle< String > name, Handle< JSArray > receiver)
Handle< Code > ComputeCallInterceptor(int argc, Code::Kind, Code::ExtraICState extra_state, Handle< String > name, Handle< Object > object, Handle< JSObject > holder)
Handle< Code > ComputeCallArguments(int argc, Code::Kind kind)
Handle< Code > ComputeLoadField(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, int field_index)
static JSFunctionProxy * cast(Object *obj)
const uint32_t kNotStringTag
HANDLE HANDLE LPSTACKFRAME64 StackFrame
static const int kCallerPCOffset
Handle< Code > ComputeStoreNormal(StrictModeFlag strict_mode)
static void Update(Handle< PolymorphicCodeCache > cache, MapHandleList *maps, Code::Flags flags, Handle< Code > code)
static void PrintTop(FILE *file, bool print_args, bool print_line_number)
static void PostPatching(Address address, Code *target, Code *old_target)
Handle< Code > ComputeCallField(int argc, Code::Kind, Code::ExtraICState extra_state, Handle< String > name, Handle< Object > object, Handle< JSObject > holder, int index)
static Address c_entry_fp(ThreadLocalTop *thread)
static InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags)
IC(FrameDepth depth, Isolate *isolate)
static const int kCallerFPOffset
V8EXPORT Local< Value > GetPrototype()
static bool IsValid(intptr_t value)
byte * instruction_start()
static Handle< Map > GetElementsTransitionMap(Handle< JSObject > object, ElementsKind to_kind)
static StrictModeFlag GetStrictMode(ExtraICState extra_ic_state)
void SetExpression(int index, Object *value)
Handle< Object > SetProperty(Handle< Object > object, Handle< Object > key, Handle< Object > value, PropertyAttributes attributes, StrictModeFlag strict_mode)
int Compare(const T &a, const T &b)
static Code * GetTargetAtAddress(Address address)
static Address & Address_at(Address addr)
Handle< Code > ComputeKeyedLoadStringLength(Handle< String > name, Handle< String > receiver)
int GetFieldIndex(int descriptor_number)
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, ElementsKind to_kind)
MUST_USE_RESULT MaybeObject * LoadFunction(State state, Code::ExtraICState extra_ic_state, Handle< Object > object, Handle< String > name)
static ExtraICState ComputeExtraICState(KeyedAccessGrowMode grow_mode, StrictModeFlag strict_mode)
static bool decode(uint32_t value)
static Register from_code(int code)
static void Clear(Address address, Code *target)
static State ToState(TypeInfo type_info)
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, int argc=-1, InlineCacheHolderFlag holder=OWN_MAP)
static MUST_USE_RESULT Handle< Object > SetElement(Handle< JSObject > object, uint32_t index, Handle< Object > value, PropertyAttributes attr, StrictModeFlag strict_mode, SetPropertyMode set_mode=SET_PROPERTY)
bool is_inline_cache_stub()
PropertyDetails GetDetails(int descriptor_number)
Handle< Code > ComputeStoreGlobal(Handle< String > name, Handle< GlobalObject > receiver, Handle< JSGlobalPropertyCell > cell, StrictModeFlag strict_mode)
static JavaScriptFrame * cast(StackFrame *frame)
virtual Handle< Code > GetElementStubWithoutMapCheck(bool is_js_array, ElementsKind elements_kind, KeyedAccessGrowMode grow_mode)
Failure * Throw(Object *exception, MessageLocation *location=NULL)
InlineCacheState ic_state()
static bool IsEqualityOp(Value op)
Handle< Code > ComputeStoreInterceptor(Handle< String > name, Handle< JSObject > receiver, StrictModeFlag strict_mode)
static Handle< Object > Call(Handle< Object > callable, Handle< Object > receiver, int argc, Handle< Object > argv[], bool *pending_exception, bool convert_receiver=false)
static JSArray * cast(Object *obj)
virtual Handle< Code > ComputePolymorphicStub(MapHandleList *receiver_maps, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)
Handle< Code > ComputeLoadViaGetter(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< JSFunction > getter)
static TypeInfo ComputeNewType(TypeInfo type, TypeInfo previous)
Handle< Object > TryCallAsFunction(Handle< Object > object)
Handle< Code > ComputeKeyedLoadField(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, int field_index)
MUST_USE_RESULT MaybeObject * Load(State state, Handle< Object > object, Handle< Object > key, bool force_generic_stub)
Handle< Code > ComputeCallNormal(int argc, Code::Kind kind, Code::ExtraICState state)
#define IC_UTIL_LIST(ICU)
Handle< Object > NewReferenceError(const char *type, Vector< Handle< Object > > args)
Handle< Code > ComputeKeyedStoreField(Handle< String > name, Handle< JSObject > receiver, int field_index, Handle< Map > transition, StrictModeFlag strict_mode)
ExtraICState extra_ic_state()
static Object * cast(Object *value)
static MUST_USE_RESULT MaybeObject * FunctionGetPrototype(Object *object, void *)
Handle< Object > NewTypeError(const char *type, Vector< Handle< Object > > args)
static Address target_address_from_return_address(Address pc)
static Token::Value ComputeOperation(Code *target)
static Handle< Object > GetFunctionDelegate(Handle< Object > object)
static JSValue * cast(Object *obj)
static Handle< T > null()
static const int kCallerPCOffset
virtual Handle< Code > ComputePolymorphicStub(MapHandleList *receiver_maps, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)
static JSObject * GetCodeCacheHolder(Object *object, InlineCacheHolderFlag holder)
static void SetTargetAtAddress(Address address, Code *target)
MUST_USE_RESULT MaybeObject * GetProperty(String *key)
static MUST_USE_RESULT MaybeObject * GetObjectProperty(Isolate *isolate, Handle< Object > object, Handle< Object > key)
virtual Handle< Code > ComputePolymorphicStub(MapHandleList *receiver_maps, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)=0
static JSProxy * cast(Object *obj)
static State ComputeState(Code *target)
virtual Handle< Code > string_stub()
Handle< Code > ComputeMonomorphicStub(LookupResult *lookup, State state, Code::ExtraICState extra_state, Handle< Object > object, Handle< String > name)
Handle< Code > ComputeStub(Handle< JSObject > receiver, StubKind stub_kind, StrictModeFlag strict_mode, Handle< Code > default_stub)
static FixedArray * cast(Object *obj)
#define TRACE_GENERIC_IC(type, reason)
static Handle< Object > GetElement(Handle< Object > object, uint32_t index)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
bool TryUpdateExtraICState(LookupResult *lookup, Handle< Object > object, Code::ExtraICState *extra_ic_state)
void set_target(Code *code)
Handle< Code > ComputeCallPreMonomorphic(int argc, Code::Kind kind, Code::ExtraICState extra_state)
virtual Handle< Code > GetElementStubWithoutMapCheck(bool is_js_array, ElementsKind elements_kind, KeyedAccessGrowMode grow_mode)=0
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
Handle< Code > ComputeLoadNonexistent(Handle< String > name, Handle< JSObject > receiver)
static TypeInfo JoinTypes(TypeInfo x, TypeInfo y)
Handle< Code > ComputeLoadConstant(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< JSFunction > value)
Vector< Handle< Object > > HandleVector(v8::internal::Handle< T > *elms, int length)
const int kMaxKeyedPolymorphism
Handle< Code > ComputeLoadInterceptor(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder)
Handle< Code > CompileLoadPolymorphic(MapHandleList *receiver_maps, CodeHandleList *handler_ics)
Handle< Code > ComputeCallConstant(int argc, Code::Kind, Code::ExtraICState extra_state, Handle< String > name, Handle< Object > object, Handle< JSObject > holder, Handle< JSFunction > function)
Handle< Code > CompileStorePolymorphic(MapHandleList *receiver_maps, CodeHandleList *handler_stubs, MapHandleList *transitioned_maps)
static const char * GetStateName(State state)
MUST_USE_RESULT MaybeObject * Store(State state, StrictModeFlag strict_mode, Handle< Object > object, Handle< Object > name, Handle< Object > value, bool force_generic)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including flags
ThreadLocalTop * thread_local_top()
RelocInfo::Mode ComputeMode()
static Address AddressFromUtilityId(UtilityId id)
static Handle< Code > GetUninitialized(Token::Value op)
Handle< Code > ComputeKeyedLoadConstant(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< JSFunction > value)
bool IsContextual(Handle< Object > receiver)
Failure * ReferenceError(const char *type, Handle< String > name)
Handle< Code > ComputeLoadGlobal(Handle< String > name, Handle< JSObject > receiver, Handle< GlobalObject > holder, Handle< JSGlobalPropertyCell > cell, bool is_dont_delete)
static JSObject * cast(Object *obj)
static MUST_USE_RESULT MaybeObject * GetElementOrCharAt(Isolate *isolate, Handle< Object > object, uint32_t index)
Handle< Code > ComputeMonomorphicStubWithoutMapCheck(Handle< Map > receiver_map, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)
static void Clear(Address address)
bool IsDictionaryElementsKind(ElementsKind kind)
static bool IsOrderedRelationalCompareOp(Value op)
Handle< Code > ComputeStoreCallback(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< AccessorInfo > callback, StrictModeFlag strict_mode)
static JSFunction * cast(Object *obj)