Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: src/ic/ic.cc

Issue 1895093002: Create per-descriptor-index LoadApiGetterStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698