Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 972530ee355974af4d593e50d1a26b77dd5d5deb..de3c08afff060855886bbdf8490e51fb1fad6b59 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -4321,6 +4321,20 @@ void MacroAssembler::IsObjectNameType(Register object, |
// Support functions. |
+void MacroAssembler::GetMapConstructor(Register result, Register map, |
+ Register temp, Register temp2) { |
+ Label done, loop; |
+ lw(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
+ bind(&loop); |
+ JumpIfSmi(result, &done); |
+ GetObjectType(result, temp, temp2); |
+ Branch(&done, ne, temp2, Operand(MAP_TYPE)); |
+ lw(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
+ Branch(&loop); |
+ bind(&done); |
+} |
+ |
+ |
void MacroAssembler::TryGetFunctionPrototype(Register function, |
Register result, |
Register scratch, |
@@ -4373,7 +4387,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, |
// Non-instance prototype: Fetch prototype from constructor field |
// in initial map. |
bind(&non_instance); |
- lw(result, FieldMemOperand(result, Map::kConstructorOffset)); |
+ GetMapConstructor(result, result, scratch, at); |
} |
// All done. |