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

Unified Diff: src/arm/builtins-arm.cc

Issue 1576423003: Fix the receiver check in the HandleFastApiCall builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 11 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 | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 5996bb595233076d811046f7155a7d76133de359..2490accb69b56b3c37f437a8d3fa14fe86133142 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1306,17 +1306,10 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ b(eq, &receiver_check_passed);
// Walk the prototype chain.
+ __ ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
Label prototype_loop_start;
__ bind(&prototype_loop_start);
- // End if the receiver is null or if it's a hidden type.
- __ CompareRoot(receiver, Heap::kNullValueRootIndex);
- __ b(eq, receiver_check_failed);
- __ ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
- __ ldr(ip, FieldMemOperand(map, Map::kBitField3Offset));
- __ tst(ip, Operand(Map::IsHiddenPrototype::kMask));
- __ b(ne, receiver_check_failed);
-
// Get the constructor, if any.
__ GetMapConstructor(constructor, map, ip, ip);
__ cmp(ip, Operand(JS_FUNCTION_TYPE));
@@ -1346,9 +1339,17 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
eq);
__ b(&function_template_loop, eq);
- // Load the next prototype and iterate.
+ // Load the next prototype.
__ bind(&next_prototype);
__ ldr(receiver, FieldMemOperand(map, Map::kPrototypeOffset));
+ // End if the prototype is null or not hidden.
+ __ CompareRoot(receiver, Heap::kNullValueRootIndex);
+ __ b(eq, receiver_check_failed);
+ __ ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
+ __ ldr(ip, FieldMemOperand(map, Map::kBitField3Offset));
+ __ tst(ip, Operand(Map::IsHiddenPrototype::kMask));
+ __ b(eq, receiver_check_failed);
+ // Iterate.
__ b(&prototype_loop_start);
__ bind(&receiver_check_passed);
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698