Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 9c21b818781552e1e99e6b5e28dba3379a29c537..7a5bef8552b83cf6fdb0af2ee33e9f6920fef555 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3929,6 +3929,32 @@ Register GetRegisterThatIsNotOneOf(Register reg1, |
} |
+void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
+ Register object, |
+ Register scratch0, |
+ Register scratch1, |
+ Label* found) { |
+ ASSERT(!scratch1.is(scratch0)); |
+ Factory* factory = isolate()->factory(); |
+ Register current = scratch0; |
+ Label loop_again; |
+ |
+ // scratch contained elements pointer. |
+ mov(current, object); |
+ |
+ // Loop based on the map going up the prototype chain. |
+ bind(&loop_again); |
+ ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); |
+ ldr(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); |
+ Ubfx(scratch1, scratch1, Map::kElementsKindShift, Map::kElementsKindBitCount); |
+ cmp(scratch1, Operand(DICTIONARY_ELEMENTS)); |
+ b(eq, found); |
+ ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
+ cmp(current, Operand(factory->null_value())); |
+ b(ne, &loop_again); |
+} |
+ |
+ |
#ifdef DEBUG |
bool AreAliased(Register reg1, |
Register reg2, |