diff options
Diffstat (limited to 'deps/v8/src/ic.cc')
-rw-r--r-- | deps/v8/src/ic.cc | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/deps/v8/src/ic.cc b/deps/v8/src/ic.cc index 5b62a8a09c..b4a333ec90 100644 --- a/deps/v8/src/ic.cc +++ b/deps/v8/src/ic.cc @@ -299,7 +299,6 @@ void LoadIC::ClearInlinedVersion(Address address) { // present) to guarantee failure by holding an invalid map (the null // value). The offset can be patched to anything. PatchInlinedLoad(address, Heap::null_value(), 0); - PatchInlinedContextualLoad(address, Heap::null_value(), Heap::null_value()); } @@ -721,14 +720,6 @@ Object* KeyedCallIC::LoadFunction(State state, } -#ifdef DEBUG -#define TRACE_IC_NAMED(msg, name) \ - if (FLAG_trace_ic) PrintF(msg, *(name)->ToCString()) -#else -#define TRACE_IC_NAMED(msg, name) -#endif - - Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) { // If the object is undefined or null it's illegal to try to get any // of its properties; throw a TypeError in that case. @@ -806,24 +797,15 @@ Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) { LOG(SuspectReadEvent(*name, *object)); } - bool can_be_inlined_precheck = + bool can_be_inlined = FLAG_use_ic && + state == PREMONOMORPHIC && lookup.IsProperty() && lookup.IsCacheable() && lookup.holder() == *object && + lookup.type() == FIELD && !object->IsAccessCheckNeeded(); - bool can_be_inlined = - can_be_inlined_precheck && - state == PREMONOMORPHIC && - lookup.type() == FIELD; - - bool can_be_inlined_contextual = - can_be_inlined_precheck && - state == UNINITIALIZED && - lookup.holder()->IsGlobalObject() && - lookup.type() == NORMAL; - if (can_be_inlined) { Map* map = lookup.holder()->map(); // Property's index in the properties array. If negative we have @@ -834,29 +816,32 @@ Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) { int offset = map->instance_size() + (index * kPointerSize); if (PatchInlinedLoad(address(), map, offset)) { set_target(megamorphic_stub()); - TRACE_IC_NAMED("[LoadIC : inline patch %s]\n", name); +#ifdef DEBUG + if (FLAG_trace_ic) { + PrintF("[LoadIC : inline patch %s]\n", *name->ToCString()); + } +#endif return lookup.holder()->FastPropertyAt(lookup.GetFieldIndex()); +#ifdef DEBUG } else { - TRACE_IC_NAMED("[LoadIC : no inline patch %s (patching failed)]\n", - name); + if (FLAG_trace_ic) { + PrintF("[LoadIC : no inline patch %s (patching failed)]\n", + *name->ToCString()); + } } } else { - TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inobject)]\n", name); - } - } else if (can_be_inlined_contextual) { - Map* map = lookup.holder()->map(); - JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( - lookup.holder()->property_dictionary()->ValueAt( - lookup.GetDictionaryEntry())); - if (PatchInlinedContextualLoad(address(), map, cell)) { - set_target(megamorphic_stub()); - TRACE_IC_NAMED("[LoadIC : inline contextual patch %s]\n", name); - ASSERT(cell->value() != Heap::the_hole_value()); - return cell->value(); + if (FLAG_trace_ic) { + PrintF("[LoadIC : no inline patch %s (not inobject)]\n", + *name->ToCString()); + } } } else { if (FLAG_use_ic && state == PREMONOMORPHIC) { - TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inlinable)]\n", name); + if (FLAG_trace_ic) { + PrintF("[LoadIC : no inline patch %s (not inlinable)]\n", + *name->ToCString()); +#endif + } } } |