Index: src/ppc/code-stubs-ppc.cc |
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc |
index 2b39234854ecdc84c365aa566fc80f22b2cb6fc0..3ce6d520005ca0a2274f0e532c7efb199cdf4d69 100644 |
--- a/src/ppc/code-stubs-ppc.cc |
+++ b/src/ppc/code-stubs-ppc.cc |
@@ -4778,20 +4778,20 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) { |
// ----------------------------------- |
__ AssertFunction(r4); |
- // For Ignition we need to skip all possible handler/stub frames until |
- // we reach the JavaScript frame for the function (similar to what the |
- // runtime fallback implementation does). So make r5 point to that |
- // JavaScript frame. |
- { |
- Label loop, loop_entry; |
- __ mr(r5, fp); |
- __ b(&loop_entry); |
- __ bind(&loop); |
+ // Make r5 point to the JavaScript frame. |
+ __ mr(r5, fp); |
+ if (skip_stub_frame()) { |
+ // For Ignition we need to skip the handler/stub frame to reach the |
+ // JavaScript frame for the function. |
__ LoadP(r5, MemOperand(r5, StandardFrameConstants::kCallerFPOffset)); |
- __ bind(&loop_entry); |
+ } |
+ if (FLAG_debug_code) { |
+ Label ok; |
__ LoadP(ip, MemOperand(r5, StandardFrameConstants::kFunctionOffset)); |
__ cmp(ip, r4); |
- __ bne(&loop); |
+ __ beq(&ok); |
+ __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
+ __ bind(&ok); |
} |
// Check if we have rest parameters (only possible if we have an |
@@ -4922,20 +4922,20 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
// ----------------------------------- |
__ AssertFunction(r4); |
- // For Ignition we need to skip all possible handler/stub frames until |
- // we reach the JavaScript frame for the function (similar to what the |
- // runtime fallback implementation does). So make r10 point to that |
- // JavaScript frame. |
- { |
- Label loop, loop_entry; |
- __ mr(r10, fp); |
- __ b(&loop_entry); |
- __ bind(&loop); |
+ // Make r10 point to the JavaScript frame. |
+ __ mr(r10, fp); |
+ if (skip_stub_frame()) { |
+ // For Ignition we need to skip the handler/stub frame to reach the |
+ // JavaScript frame for the function. |
__ LoadP(r10, MemOperand(r10, StandardFrameConstants::kCallerFPOffset)); |
- __ bind(&loop_entry); |
+ } |
+ if (FLAG_debug_code) { |
+ Label ok; |
__ LoadP(ip, MemOperand(r10, StandardFrameConstants::kFunctionOffset)); |
__ cmp(ip, r4); |
- __ bne(&loop); |
+ __ beq(&ok); |
+ __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
+ __ bind(&ok); |
} |
@@ -5192,20 +5192,20 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
// ----------------------------------- |
__ AssertFunction(r4); |
- // For Ignition we need to skip all possible handler/stub frames until |
- // we reach the JavaScript frame for the function (similar to what the |
- // runtime fallback implementation does). So make r5 point to that |
- // JavaScript frame. |
- { |
- Label loop, loop_entry; |
- __ mr(r5, fp); |
- __ b(&loop_entry); |
- __ bind(&loop); |
+ // Make r5 point to the JavaScript frame. |
+ __ mr(r5, fp); |
+ if (skip_stub_frame()) { |
+ // For Ignition we need to skip the handler/stub frame to reach the |
+ // JavaScript frame for the function. |
__ LoadP(r5, MemOperand(r5, StandardFrameConstants::kCallerFPOffset)); |
- __ bind(&loop_entry); |
+ } |
+ if (FLAG_debug_code) { |
+ Label ok; |
__ LoadP(ip, MemOperand(r5, StandardFrameConstants::kFunctionOffset)); |
__ cmp(ip, r4); |
- __ bne(&loop); |
+ __ b(&ok); |
+ __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
+ __ bind(&ok); |
} |
// Check if we have an arguments adaptor frame below the function frame. |