Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index 63d032c566bf2027b5bf0470aff19cc810907f48..1153bf9b343410607ab0dd7e3ff53198644cc26b 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -1044,8 +1044,9 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup, |
NamedLoadHandlerCompiler compiler(isolate(), map, holder, |
cache_holder); |
if (call_optimization.is_simple_api_call()) { |
- return compiler.CompileLoadCallback( |
- lookup->name(), call_optimization, lookup->GetAccessorIndex()); |
+ int index = lookup->GetAccessorIndex(); |
+ return compiler.CompileLoadCallback(lookup->name(), |
+ call_optimization, index); |
} |
int expected_arguments = Handle<JSFunction>::cast(getter) |
->shared() |
@@ -1054,13 +1055,18 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup, |
lookup->name(), lookup->GetAccessorIndex(), expected_arguments); |
} else if (accessors->IsAccessorInfo()) { |
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); |
- if (v8::ToCData<Address>(info->getter()) == 0) break; |
+ if (v8::ToCData<Address>(info->getter()) == nullptr) break; |
if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map)) { |
// This case should be already handled in LoadIC::UpdateCaches. |
UNREACHABLE(); |
break; |
} |
if (!holder->HasFastProperties()) break; |
+ if (receiver_is_holder) { |
+ int index = lookup->GetAccessorIndex(); |
+ LoadApiGetterStub stub(isolate(), true, index); |
+ return stub.GetCode(); |
+ } |
NamedLoadHandlerCompiler compiler(isolate(), map, holder, |
cache_holder); |
return compiler.CompileLoadCallback(lookup->name(), info); |