Index: src/ia32/builtins-ia32.cc |
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
index 3a9b4734e34bba0d905e19afef90025da458868c..3e56a584c6ea06dbc23b751e4ea3e6cc88895fd5 100644 |
--- a/src/ia32/builtins-ia32.cc |
+++ b/src/ia32/builtins-ia32.cc |
@@ -2663,14 +2663,12 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver, |
// Load the next prototype. |
__ bind(&next_prototype); |
__ mov(receiver, FieldOperand(receiver, HeapObject::kMapOffset)); |
+ __ test(FieldOperand(receiver, Map::kBitField3Offset), |
+ Immediate(Map::HasHiddenPrototype::kMask)); |
+ __ j(zero, receiver_check_failed); |
+ |
__ mov(receiver, FieldOperand(receiver, Map::kPrototypeOffset)); |
- // End if the prototype is null or not hidden. |
- __ CompareRoot(receiver, Heap::kNullValueRootIndex); |
- __ j(equal, receiver_check_failed); |
__ mov(scratch0, FieldOperand(receiver, HeapObject::kMapOffset)); |
- __ test(FieldOperand(scratch0, Map::kBitField3Offset), |
- Immediate(Map::IsHiddenPrototype::kMask)); |
- __ j(zero, receiver_check_failed); |
// Iterate. |
__ jmp(&prototype_loop_start, Label::kNear); |