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(); |
} |