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); |