| Index: src/ppc/code-stubs-ppc.cc
|
| diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc
|
| index 171258ce0eaaf3b2a5082d03b34aa865645cb860..729bc61a9758544820232e814554ca5acfd47547 100644
|
| --- a/src/ppc/code-stubs-ppc.cc
|
| +++ b/src/ppc/code-stubs-ppc.cc
|
| @@ -1158,9 +1158,8 @@ void CEntryStub::Generate(MacroAssembler* masm) {
|
| __ mov(fp, Operand(pending_handler_fp_address));
|
| __ LoadP(fp, MemOperand(fp));
|
|
|
| - // If the handler is a JS frame, restore the context to the frame.
|
| - // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp
|
| - // or cp.
|
| + // If the handler is a JS frame, restore the context to the frame. Note that
|
| + // the context will be set to (cp == 0) for non-JS frames.
|
| Label skip;
|
| __ cmpi(cp, Operand::Zero());
|
| __ beq(&skip);
|
| @@ -1250,7 +1249,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| handler_offset_ = handler_entry.pos();
|
| // Caught exception: Store result (exception) in the pending exception
|
| // field in the JSEnv and return a failure sentinel. Coming in here the
|
| - // fp will be invalid because the PushTryHandler below sets it to 0 to
|
| + // fp will be invalid because the PushStackHandler below sets it to 0 to
|
| // signal the existence of the JSEntry frame.
|
| __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress,
|
| isolate())));
|
| @@ -1259,11 +1258,10 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| __ LoadRoot(r3, Heap::kExceptionRootIndex);
|
| __ b(&exit);
|
|
|
| - // Invoke: Link this frame into the handler chain. There's only one
|
| - // handler block in this code object, so its index is 0.
|
| + // Invoke: Link this frame into the handler chain.
|
| __ bind(&invoke);
|
| - // Must preserve r0-r4, r5-r7 are available. (needs update for PPC)
|
| - __ PushTryHandler(StackHandler::JS_ENTRY, 0);
|
| + // Must preserve r3-r7.
|
| + __ PushStackHandler();
|
| // If an exception not caught by another handler occurs, this handler
|
| // returns control to the code after the b(&invoke) above, which
|
| // restores all kCalleeSaved registers (including cp and fp) to their
|
| @@ -1302,7 +1300,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| __ bctrl(); // make the call
|
|
|
| // Unlink this frame from the handler chain.
|
| - __ PopTryHandler();
|
| + __ PopStackHandler();
|
|
|
| __ bind(&exit); // r3 holds result
|
| // Check if the current stack frame is marked as the outermost JS frame.
|
|
|