Index: src/compiler/s390/code-generator-s390.cc |
diff --git a/src/compiler/s390/code-generator-s390.cc b/src/compiler/s390/code-generator-s390.cc |
index 0b687210707cc3ca68d8d7d74eff6001831059ad..c5b8527b4cc16b2b203848a5f28bacbcf786153c 100644 |
--- a/src/compiler/s390/code-generator-s390.cc |
+++ b/src/compiler/s390/code-generator-s390.cc |
@@ -89,8 +89,11 @@ class S390OperandConverter 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) { |
+ FrameOffset offset = frame_access_state()->GetFrameOffset(slot); |
return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); |
} |
}; |
@@ -1791,9 +1794,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)) { |
- __ LoadP(dst, MemOperand(fp, offset)); |
+ int slot; |
+ if (IsMaterializableFromFrame(src_object, &slot)) { |
+ __ LoadP(dst, g.SlotToMemOperand(slot)); |
} else if (IsMaterializableFromRoot(src_object, &index)) { |
__ LoadRoot(dst, index); |
} else { |