Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 903ed6324371bbbe0ba83b4109fec86aadec10a4..a07ebd5b434ccb5e2809fe3dce7e6d0e48b086da 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -1402,7 +1402,19 @@ |
void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
- li(dst, Operand(value), mode); |
+ AllowDeferredHandleDereference smi_check; |
+ if (value->IsSmi()) { |
+ li(dst, Operand(value), mode); |
+ } else { |
+ DCHECK(value->IsHeapObject()); |
+ 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)); |
+ } |
+ } |
} |