Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index a1172262b06cc82bd8034f5e909f7158c611abcd..295f89106f1dac07c3a62f585c9c922b0502be0c 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -3565,6 +3565,20 @@ Condition MacroAssembler::IsObjectNameType(Register heap_object, |
} |
+void MacroAssembler::GetMapConstructor(Register result, Register map, |
+ Register temp) { |
+ Label done, loop; |
+ movp(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
+ bind(&loop); |
+ JumpIfSmi(result, &done); |
+ CmpObjectType(result, MAP_TYPE, temp); |
+ j(not_equal, &done); |
+ movp(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); |
+ jmp(&loop); |
+ bind(&done); |
+} |
+ |
+ |
void MacroAssembler::TryGetFunctionPrototype(Register function, |
Register result, |
Label* miss, |
@@ -3618,7 +3632,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, |
// Non-instance prototype: Fetch prototype from constructor field |
// in initial map. |
bind(&non_instance); |
- movp(result, FieldOperand(result, Map::kConstructorOffset)); |
+ GetMapConstructor(result, result, kScratchRegister); |
} |
// All done. |