Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: src/ppc/code-stubs-ppc.cc

Issue 1966263002: PPC: [Interpreter] Fix incorrect frame walking in arguments create stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698