Index: src/compiler/arm/code-generator-arm.cc |
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc |
index a903552edaec5b52034e1dd1937b18d1c1784ffd..83a72e8c6e0f3ccc53974c6a8c11e682d49826c1 100644 |
--- a/src/compiler/arm/code-generator-arm.cc |
+++ b/src/compiler/arm/code-generator-arm.cc |
@@ -150,8 +150,11 @@ class ArmOperandConverter 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()); |
} |
}; |
@@ -1364,9 +1367,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)) { |
- __ ldr(dst, MemOperand(fp, offset)); |
+ int slot; |
+ if (IsMaterializableFromFrame(src_object, &slot)) { |
+ __ ldr(dst, g.SlotToMemOperand(slot)); |
} else if (IsMaterializableFromRoot(src_object, &index)) { |
__ LoadRoot(dst, index); |
} else { |