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

Unified Diff: src/ppc/code-stubs-ppc.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
« no previous file with comments | « src/objects-inl.h ('k') | src/prototype.h » ('j') | src/prototype.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/code-stubs-ppc.cc
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc
index a835d572dd61da0fdffa182786ae37006d263d57..5d31e0fb04e5c40f1fba957cfe45ff4ca5cb6319 100644
--- a/src/ppc/code-stubs-ppc.cc
+++ b/src/ppc/code-stubs-ppc.cc
@@ -1458,14 +1458,23 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
// Loop through the prototype chain looking for the {function} prototype.
// Assume true, and change to false if not found.
Register const object_instance_type = function_map;
+ Register const map_bit_field = function_map;
Register const null = scratch;
Register const result = r3;
- Label done, loop, proxy_case;
+
+ Label done, loop, fast_runtime_fallback;
__ LoadRoot(result, Heap::kTrueValueRootIndex);
__ LoadRoot(null, Heap::kNullValueRootIndex);
__ bind(&loop);
+
+ // Check if the object needs to be access checked.
+ __ lbz(map_bit_field, FieldMemOperand(object_map, Map::kBitFieldOffset));
+ __ TestBit(map_bit_field, Map::kIsCallable, r0);
+ __ bne(&fast_runtime_fallback, cr0);
+ // Check if the current object is a Proxy.
__ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE);
- __ beq(&proxy_case);
+ __ beq(&fast_runtime_fallback);
+
__ LoadP(object, FieldMemOperand(object_map, Map::kPrototypeOffset));
__ cmp(object, function_prototype);
__ beq(&done);
@@ -1477,8 +1486,8 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
__ StoreRoot(result, Heap::kInstanceofCacheAnswerRootIndex);
__ Ret();
- // Proxy-case: Call the %HasInPrototypeChain runtime function.
- __ bind(&proxy_case);
+ // Found Proxy or access check needed: Call the runtime
+ __ bind(&fast_runtime_fallback);
__ Push(object, function_prototype);
// Invalidate the instanceof cache.
__ LoadSmiLiteral(scratch, Smi::FromInt(0));
« no previous file with comments | « src/objects-inl.h ('k') | src/prototype.h » ('j') | src/prototype.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698