| Index: src/compiler/ppc/code-generator-ppc.cc
 | 
| diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
 | 
| index 0cdbd5f6d0c4438791c2042361b4d7e5f8ea6c76..4e9f99fb9c3f5a51299c9a21a3f64abdfaa732ea 100644
 | 
| --- a/src/compiler/ppc/code-generator-ppc.cc
 | 
| +++ b/src/compiler/ppc/code-generator-ppc.cc
 | 
| @@ -99,9 +99,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());
 | 
|    }
 | 
|  };
 | 
| @@ -1357,7 +1360,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.
 | 
| @@ -1376,17 +1378,21 @@
 | 
|        const RegList saves = descriptor->CalleeSavedRegisters() & ~frame_saves;
 | 
|        __ MultiPop(saves);
 | 
|      }
 | 
| +    __ LeaveFrame(StackFrame::MANUAL);
 | 
| +    __ 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_);
 | 
| -    }
 | 
| -  }
 | 
| -  __ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
 | 
| -  __ Ret();
 | 
| +      int pop_count = static_cast<int>(descriptor->StackParameterCount());
 | 
| +      __ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
 | 
| +      __ Ret();
 | 
| +    }
 | 
| +  } else {
 | 
| +    __ Ret();
 | 
| +  }
 | 
|  }
 | 
|  
 | 
|  
 | 
| 
 |