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

Unified Diff: src/mips/code-stubs-mips.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/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index a66675c61138f242d31fd3a6e953176f2e95e08a..6f48d4dd6bfda9854f17ca919659e85858ace9a3 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -1506,15 +1506,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));
+
__ lw(object, FieldMemOperand(object_map, Map::kPrototypeOffset));
__ Branch(&done, eq, object, Operand(function_prototype));
__ Branch(USE_DELAY_SLOT, &loop, ne, object, Operand(null));
@@ -1526,8 +1536,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/isolate.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | src/prototype.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698