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

Unified Diff: src/mips64/code-stubs-mips64.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/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc
index a913085c893ad3e6df2d8a7b449f18e76a8a4889..1aa549a3c40728fad9242b16ee83dfa7a76f77e2 100644
--- a/src/mips64/code-stubs-mips64.cc
+++ b/src/mips64/code-stubs-mips64.cc
@@ -1508,15 +1508,25 @@ 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 = v0;
- 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.
+ __ lbu(map_bit_field, FieldMemOperand(object_map, Map::kBitFieldOffset));
+ __ And(map_bit_field, map_bit_field, Operand(1 << Map::kIsAccessCheckNeeded));
+ __ Branch(&fast_runtime_fallback, ne, map_bit_field, Operand(zero_reg));
+ // Check if the current object is a Proxy.
__ lbu(object_instance_type,
FieldMemOperand(object_map, Map::kInstanceTypeOffset));
- __ Branch(&proxy_case, eq, object_instance_type, Operand(JS_PROXY_TYPE));
+ __ Branch(&fast_runtime_fallback, eq, object_instance_type,
+ Operand(JS_PROXY_TYPE));
+
__ ld(object, FieldMemOperand(object_map, Map::kPrototypeOffset));
__ Branch(&done, eq, object, Operand(function_prototype));
__ Branch(USE_DELAY_SLOT, &loop, ne, object, Operand(null));
@@ -1528,8 +1538,8 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
__ StoreRoot(result,
Heap::kInstanceofCacheAnswerRootIndex); // In delay slot.
- // 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.
DCHECK(Smi::FromInt(0) == 0);
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/objects-inl.h » ('j') | src/prototype.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698