Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 3d2769d9a84f5cd27f7258810d99cb5c08f27cf8..804068c61138069b09e4c7ec56a429f45080ce30 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3789,23 +3789,35 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
Register scratch1, |
Label* found) { |
DCHECK(!scratch1.is(scratch0)); |
- Factory* factory = isolate()->factory(); |
Register current = scratch0; |
- Label loop_again; |
+ Label loop_again, end; |
// scratch contained elements pointer. |
mov(current, object); |
+ ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); |
+ ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
+ CompareRoot(current, Heap::kNullValueRootIndex); |
+ b(eq, &end); |
// Loop based on the map going up the prototype chain. |
bind(&loop_again); |
ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); |
+ |
+ STATIC_ASSERT(JS_PROXY_TYPE < JS_OBJECT_TYPE); |
+ STATIC_ASSERT(JS_VALUE_TYPE < JS_OBJECT_TYPE); |
+ ldrb(scratch1, FieldMemOperand(current, Map::kInstanceTypeOffset)); |
+ cmp(scratch1, Operand(JS_OBJECT_TYPE)); |
+ b(lo, found); |
+ |
ldr(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); |
DecodeField<Map::ElementsKindBits>(scratch1); |
cmp(scratch1, Operand(DICTIONARY_ELEMENTS)); |
b(eq, found); |
ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
- cmp(current, Operand(factory->null_value())); |
+ CompareRoot(current, Heap::kNullValueRootIndex); |
b(ne, &loop_again); |
+ |
+ bind(&end); |
} |