Index: src/mips64/macro-assembler-mips64.cc |
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc |
index f238c52427ee0eb9e8d0869fa1f9ac0419b37085..c5ca43bae5dee8dc08d60e60bc46826487a363d3 100644 |
--- a/src/mips64/macro-assembler-mips64.cc |
+++ b/src/mips64/macro-assembler-mips64.cc |
@@ -1595,7 +1595,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)); |
+ ld(dst, FieldMemOperand(dst, Cell::kValueOffset)); |
+ } else { |
+ li(dst, Operand(value)); |
+ } |
+ } |
} |
static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { |