Index: src/mips64/macro-assembler-mips64.cc |
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc |
index 4abc16c1e740e21dd26901aceef2910cf9c6d24a..c69d2ae7f8580aac7212adfd70f2626b1781df55 100644 |
--- a/src/mips64/macro-assembler-mips64.cc |
+++ b/src/mips64/macro-assembler-mips64.cc |
@@ -1597,11 +1597,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)); |
+ ld(dst, FieldMemOperand(dst, Cell::kValueOffset)); |
+ } else { |
+ li(dst, Operand(value)); |
+ } |
} |
} |