| Index: src/compiler/arm64/code-generator-arm64.cc
 | 
| diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
 | 
| index 27d4889c34df5cca59ffeee94723d5116398ff06..58adc2509883c6c5fcd002d1871c680136fae345 100644
 | 
| --- a/src/compiler/arm64/code-generator-arm64.cc
 | 
| +++ b/src/compiler/arm64/code-generator-arm64.cc
 | 
| @@ -184,9 +184,12 @@
 | 
|  
 | 
|    MemOperand ToMemOperand(InstructionOperand* op, MacroAssembler* masm) 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() ? masm->StackPointer() : fp,
 | 
|                        offset.offset());
 | 
|    }
 | 
| @@ -1115,8 +1118,6 @@
 | 
|      __ StubPrologue();
 | 
|      frame()->SetRegisterSaveAreaSize(
 | 
|          StandardFrameConstants::kFixedFrameSizeFromFp);
 | 
| -  } else {
 | 
| -    frame()->SetPCOnStack(false);
 | 
|    }
 | 
|  
 | 
|    if (info()->is_osr()) {
 | 
| @@ -1148,7 +1149,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.
 | 
| @@ -1169,19 +1169,24 @@
 | 
|  
 | 
|      __ Mov(csp, fp);
 | 
|      __ Pop(fp, lr);
 | 
| +    __ Ret();
 | 
|    } else if (descriptor->IsJSFunctionCall() || needs_frame_) {
 | 
|      // Canonicalize JSFunction return sites for now.
 | 
|      if (return_label_.is_bound()) {
 | 
|        __ B(&return_label_);
 | 
| -      return;
 | 
|      } else {
 | 
|        __ Bind(&return_label_);
 | 
|        __ Mov(jssp, fp);
 | 
|        __ Pop(fp, lr);
 | 
| -    }
 | 
| -  }
 | 
| -  __ Drop(pop_count);
 | 
| -  __ Ret();
 | 
| +      int pop_count = static_cast<int>(descriptor->StackParameterCount());
 | 
| +      if (pop_count != 0) {
 | 
| +        __ Drop(pop_count);
 | 
| +      }
 | 
| +      __ Ret();
 | 
| +    }
 | 
| +  } else {
 | 
| +    __ Ret();
 | 
| +  }
 | 
|  }
 | 
|  
 | 
|  
 | 
| 
 |