Index: src/arm64/builtins-arm64.cc |
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc |
index 506140d2bede6a26f2b39dbda53b50edcdd194b1..b6bae4ad0edc308cfb6d09b3628a05efdadec06f 100644 |
--- a/src/arm64/builtins-arm64.cc |
+++ b/src/arm64/builtins-arm64.cc |
@@ -1286,17 +1286,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(x16, FieldMemOperand(map, Map::kBitField3Offset)); |
- __ Tst(x16, Operand(Map::IsHiddenPrototype::kMask)); |
- __ B(ne, receiver_check_failed); |
- |
// Get the constructor, if any |
__ GetMapConstructor(constructor, map, x16, x16); |
__ cmp(x16, Operand(JS_FUNCTION_TYPE)); |
@@ -1326,9 +1319,17 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver, |
FieldMemOperand(type, FunctionTemplateInfo::kParentTemplateOffset)); |
__ B(&function_template_loop); |
- // 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(x16, FieldMemOperand(map, Map::kBitField3Offset)); |
+ __ Tst(x16, Operand(Map::IsHiddenPrototype::kMask)); |
+ __ B(eq, receiver_check_failed); |
+ // Iterate. |
__ B(&prototype_loop_start); |
__ Bind(&receiver_check_passed); |