Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index a40ca7476c2cea346fb9d4277fd25ae4ab189806..bc5bc01d90c78f99b99a6d375ddd168514bc19d5 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -1403,11 +1403,18 @@ |
void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
+ AllowDeferredHandleDereference smi_check; |
if (value->IsSmi()) { |
li(dst, Operand(value), mode); |
} else { |
DCHECK(value->IsHeapObject()); |
- li(dst, Operand(value)); |
+ if (isolate()->heap()->InNewSpace(*value)) { |
+ Handle<Cell> cell = isolate()->factory()->NewCell(value); |
+ li(dst, Operand(cell)); |
+ lw(dst, FieldMemOperand(dst, Cell::kValueOffset)); |
+ } else { |
+ li(dst, Operand(value)); |
+ } |
} |
} |