Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index c8fb60dafa93bb614d9afbe3701e00dbcab11b10..2b723b38baefda9126a2730eea1901221f59c38e 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -2292,6 +2292,20 @@ void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell, |
} |
+void MacroAssembler::GetMapConstructor(Register result, Register map, |
+ Register temp, Register temp2) { |
+ Label done, loop; |
+ ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
+ bind(&loop); |
+ JumpIfSmi(result, &done); |
+ CompareObjectType(result, temp, temp2, MAP_TYPE); |
+ b(ne, &done); |
+ ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
+ b(&loop); |
+ bind(&done); |
+} |
+ |
+ |
void MacroAssembler::TryGetFunctionPrototype(Register function, |
Register result, |
Register scratch, |
@@ -2345,7 +2359,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, |
// Non-instance prototype: Fetch prototype from constructor field |
// in initial map. |
bind(&non_instance); |
- ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); |
+ GetMapConstructor(result, result, scratch, ip); |
} |
// All done. |