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

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') | src/lookup-inl.h » ('J')
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 15dc941503e8309798b78ea47f2ba01ec2fa8465..8752c6cfced1097a05a976fb521f6ce49037baa9 100644
--- a/src/ic/handler-compiler.cc
+++ b/src/ic/handler-compiler.cc
@@ -311,7 +311,25 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
Label miss;
InterceptorVectorSlotPush(receiver());
+ auto holder_orig = holder();
+ // Temporarily swap holder to check entire chain. What could go wrong?
+ if (holder()->GetNamedInterceptor()->non_masking()) {
+ DCHECK(!inline_followup);
+ JSObject* last = *holder();
+ PrototypeIterator iter(isolate(), last);
+ while (!iter.IsAtEnd()) {
+ last = JSObject::cast(iter.GetCurrent());
+ iter.Advance();
+ }
+ auto last_handle = handle(last);
+ set_holder(last_handle);
+ }
Register reg = FrontendHeader(receiver(), it->name(), &miss);
+ // Now do the check again, getting the holder into the right register...
+ if (holder_orig->GetNamedInterceptor()->non_masking()) {
+ set_holder(holder_orig);
+ reg = FrontendHeader(receiver(), it->name(), &miss);
+ }
FrontendFooter(it->name(), &miss);
InterceptorVectorSlotPop(reg);
@@ -320,6 +338,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
// prototypes and ultimate answer.
GenerateLoadInterceptorWithFollowup(it, reg);
} else {
+ // TODO(dcarney): add a function for calling nonmasking interceptors.
GenerateLoadInterceptor(reg);
}
return GetCode(kind(), Code::FAST, it->name());
« no previous file with comments | « src/api.cc ('k') | src/ic/ic.cc » ('j') | src/lookup-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698