Index: src/compiler/mips/code-generator-mips.cc |
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc |
index 2c5264e498ee2c33dec148e6125c0b44d37a0165..26074af6275f76c43b0b8924235e6075f07776d6 100644 |
--- a/src/compiler/mips/code-generator-mips.cc |
+++ b/src/compiler/mips/code-generator-mips.cc |
@@ -120,8 +120,11 @@ class MipsOperandConverter final : public InstructionOperandConverter { |
MemOperand ToMemOperand(InstructionOperand* op) const { |
DCHECK_NOT_NULL(op); |
DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
- FrameOffset offset = frame_access_state()->GetFrameOffset( |
- AllocatedOperand::cast(op)->index()); |
+ return SlotToMemOperand(AllocatedOperand::cast(op)->index()); |
+ } |
+ |
+ MemOperand SlotToMemOperand(int slot) const { |
+ FrameOffset offset = frame_access_state()->GetFrameOffset(slot); |
return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); |
} |
}; |
@@ -1703,9 +1706,9 @@ void CodeGenerator::AssembleMove(InstructionOperand* source, |
case Constant::kHeapObject: { |
Handle<HeapObject> src_object = src.ToHeapObject(); |
Heap::RootListIndex index; |
- int offset; |
- if (IsMaterializableFromFrame(src_object, &offset)) { |
- __ lw(dst, MemOperand(fp, offset)); |
+ int slot; |
+ if (IsMaterializableFromFrame(src_object, &slot)) { |
+ __ lw(dst, g.SlotToMemOperand(slot)); |
} else if (IsMaterializableFromRoot(src_object, &index)) { |
__ LoadRoot(dst, index); |
} else { |