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

Unified Diff: src/ic/handler-compiler.cc

Issue 962613002: add interceptors which do not mask existing properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/api.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-compiler.cc
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc
index db6405538b92ea023f26b1dc5828d3f5c08dc0cb..9c25f0a1564d753bd62a1bb3ecb1d9d31aad591c 100644
--- a/src/ic/handler-compiler.cc
+++ b/src/ic/handler-compiler.cc
@@ -312,10 +312,32 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
Label miss;
InterceptorVectorSlotPush(receiver());
+ bool lost_holder_register = false;
+ auto holder_orig = holder();
+ // non masking interceptors must check the entire chain, so temporarily reset
+ // the holder to be that last element for the FrontendHeader call.
+ if (holder()->GetNamedInterceptor()->non_masking()) {
+ DCHECK(!inline_followup);
+ JSObject* last = *holder();
+ PrototypeIterator iter(isolate(), last);
+ while (!iter.IsAtEnd()) {
+ lost_holder_register = true;
+ last = JSObject::cast(iter.GetCurrent());
+ iter.Advance();
+ }
+ auto last_handle = handle(last);
+ set_holder(last_handle);
+ }
Register reg = FrontendHeader(receiver(), it->name(), &miss);
+ // Reset the holder so further calculations are correct.
+ set_holder(holder_orig);
+ if (lost_holder_register) {
+ // Reload lost holder register.
+ auto cell = isolate()->factory()->NewWeakCell(holder());
+ __ LoadWeakValue(reg, cell, &miss);
+ }
FrontendFooter(it->name(), &miss);
InterceptorVectorSlotPop(reg);
-
if (inline_followup) {
// TODO(368): Compile in the whole chain: all the interceptors in
// prototypes and ultimate answer.
« no previous file with comments | « src/api.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698