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