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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1521953002: [proxies] fix access issue when having proxies on the prototype-chain of global objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ppc code mess Created 5 years 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/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index a97e7ecaaecbf0080165c71b3a5bb7e9a6eaa637..34813f8a08b606d8077180bce08a092906a726bc 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2517,11 +2517,16 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
// Loop through the prototype chain looking for the {function} prototype.
// Assume true, and change to false if not found.
- Label done, loop, proxy_case;
+ Label done, loop, fast_runtime_fallback;
__ LoadRoot(rax, Heap::kTrueValueRootIndex);
__ bind(&loop);
+
+ __ testb(FieldOperand(object_map, Map::kBitFieldOffset),
+ Immediate(1 << Map::kIsAccessCheckNeeded));
+ __ j(not_zero, &fast_runtime_fallback, Label::kNear);
__ CmpInstanceType(object_map, JS_PROXY_TYPE);
- __ j(equal, &proxy_case, Label::kNear);
+ __ j(equal, &fast_runtime_fallback, Label::kNear);
+
__ movp(object, FieldOperand(object_map, Map::kPrototypeOffset));
__ cmpp(object, function_prototype);
__ j(equal, &done, Label::kNear);
@@ -2533,8 +2538,8 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
__ StoreRoot(rax, Heap::kInstanceofCacheAnswerRootIndex);
__ ret(0);
- // Proxy-case: Call the %HasInPrototypeChain runtime function.
- __ bind(&proxy_case);
+ // Found Proxy or access check needed: Call the runtime.
+ __ bind(&fast_runtime_fallback);
__ PopReturnAddressTo(kScratchRegister);
__ Push(object);
__ Push(function_prototype);
« src/prototype.h ('K') | « src/prototype.h ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698