Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 53ffa39357c97a47aa53df3f934a712fb30e9380..db9ef767743939affc3187f00a19957ea4330dd7 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -1919,6 +1919,20 @@ void MacroAssembler::NegativeZeroTest(Register result, |
} |
+void MacroAssembler::GetMapConstructor(Register result, Register map, |
+ Register temp) { |
+ Label done, loop; |
+ mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
+ bind(&loop); |
+ JumpIfSmi(result, &done); |
+ CmpObjectType(result, MAP_TYPE, temp); |
+ j(not_equal, &done); |
+ mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); |
+ jmp(&loop); |
+ bind(&done); |
+} |
+ |
+ |
void MacroAssembler::TryGetFunctionPrototype(Register function, |
Register result, |
Register scratch, |
@@ -1970,7 +1984,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, |
// Non-instance prototype: Fetch prototype from constructor field |
// in initial map. |
bind(&non_instance); |
- mov(result, FieldOperand(result, Map::kConstructorOffset)); |
+ GetMapConstructor(result, result, scratch); |
} |
// All done. |