Index: src/compiler/mips64/code-generator-mips64.cc |
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc |
index 903608ac3a139f67a7574138152ce549062c3249..1c4a789229b4b6b10e1dca922f9d699124b875f5 100644 |
--- a/src/compiler/mips64/code-generator-mips64.cc |
+++ b/src/compiler/mips64/code-generator-mips64.cc |
@@ -106,9 +106,12 @@ |
MemOperand ToMemOperand(InstructionOperand* op) const { |
DCHECK(op != NULL); |
+ DCHECK(!op->IsRegister()); |
+ DCHECK(!op->IsDoubleRegister()); |
DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
- FrameOffset offset = |
- linkage()->GetFrameOffset(AllocatedOperand::cast(op)->index(), frame()); |
+ // The linkage computes where all spill slots are located. |
+ FrameOffset offset = linkage()->GetFrameOffset( |
+ AllocatedOperand::cast(op)->index(), frame(), 0); |
return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); |
} |
}; |
@@ -1173,8 +1176,6 @@ |
__ StubPrologue(); |
frame()->SetRegisterSaveAreaSize( |
StandardFrameConstants::kFixedFrameSizeFromFp); |
- } else { |
- frame()->SetPCOnStack(false); |
} |
if (info()->is_osr()) { |
@@ -1202,7 +1203,6 @@ |
void CodeGenerator::AssembleReturn() { |
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
int stack_slots = frame()->GetSpillSlotCount(); |
- int pop_count = static_cast<int>(descriptor->StackParameterCount()); |
if (descriptor->kind() == CallDescriptor::kCallAddress) { |
if (frame()->GetRegisterSaveAreaSize() > 0) { |
// Remove this frame's spill slots first. |
@@ -1219,19 +1219,22 @@ |
} |
__ mov(sp, fp); |
__ Pop(ra, fp); |
+ __ Ret(); |
} else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
// Canonicalize JSFunction return sites for now. |
if (return_label_.is_bound()) { |
__ Branch(&return_label_); |
- return; |
} else { |
__ bind(&return_label_); |
__ mov(sp, fp); |
__ Pop(ra, fp); |
- } |
- } |
- if (pop_count != 0) { |
- __ DropAndRet(pop_count); |
+ int pop_count = static_cast<int>(descriptor->StackParameterCount()); |
+ if (pop_count != 0) { |
+ __ DropAndRet(pop_count); |
+ } else { |
+ __ Ret(); |
+ } |
+ } |
} else { |
__ Ret(); |
} |