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

Unified Diff: src/ic/ic.cc

Issue 2081143002: [ic] Don't compile load interceptor handlers for LoadGlobalIC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cleanup Created 4 years, 6 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
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index b4f2bb4ba2986cb4c6b4fc07dd05c57874fc3930..b3cd9b27e71fa3047249c7d3433a706aa71e5714 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -938,15 +938,22 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
code = slow_stub();
}
} else if (lookup->state() == LookupIterator::INTERCEPTOR) {
- // Perform a lookup behind the interceptor. Copy the LookupIterator since
- // the original iterator will be used to fetch the value.
- LookupIterator it = *lookup;
- it.Next();
- LookupForRead(&it);
- if (it.state() == LookupIterator::ACCESSOR &&
- !IsCompatibleReceiver(&it, receiver_map())) {
- TRACE_GENERIC_IC(isolate(), "LoadIC", "incompatible receiver type");
+ if (kind() == Code::LOAD_GLOBAL_IC) {
+ // The interceptor handler requires name but it is not passed explicitly
+ // to LoadGlobalIC and the LoadGlobalIC dispatcher also does not load
+ // it so we will just use slow stub.
code = slow_stub();
+ } else {
+ // Perform a lookup behind the interceptor. Copy the LookupIterator
+ // since the original iterator will be used to fetch the value.
+ LookupIterator it = *lookup;
+ it.Next();
+ LookupForRead(&it);
+ if (it.state() == LookupIterator::ACCESSOR &&
+ !IsCompatibleReceiver(&it, receiver_map())) {
+ TRACE_GENERIC_IC(isolate(), "LoadIC", "incompatible receiver type");
+ code = slow_stub();
+ }
}
}
if (code.is_null()) code = ComputeHandler(lookup);
@@ -2879,17 +2886,15 @@ RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptor) {
if (it.IsFound()) return *result;
+#ifdef DEBUG
LoadICNexus nexus(isolate);
LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
// It could actually be any kind of LoadICs here but the predicate handles
// all the cases properly.
- if (!ic.ShouldThrowReferenceError()) {
- return isolate->heap()->undefined_value();
- }
+ DCHECK(!ic.ShouldThrowReferenceError());
+#endif
- // Throw a reference error.
- THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewReferenceError(MessageTemplate::kNotDefined, it.name()));
+ return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/ic/ic.h ('k') | src/runtime/runtime.h » ('j') | test/cctest/test-api-interceptors.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698