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

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

Issue 1949023003: [Interpreter] Fix incorrect frame walking in arguments create stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports 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 | « src/arm/code-stubs-arm.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/code-stubs-arm64.cc
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc
index 4b58d0cd63f9ef974a666fa48aeb68d55170c8dc..e36e4f9dcca6419a7ca6dab39fbd361bf50d5e77 100644
--- a/src/arm64/code-stubs-arm64.cc
+++ b/src/arm64/code-stubs-arm64.cc
@@ -4911,20 +4911,20 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
// -----------------------------------
__ AssertFunction(x1);
- // 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 x2 point to that
- // JavaScript frame.
- {
- Label loop, loop_entry;
- __ Mov(x2, fp);
- __ B(&loop_entry);
- __ Bind(&loop);
+ // Make x2 point to the JavaScript frame.
+ __ Mov(x2, fp);
+ if (skip_stub_frame()) {
+ // For Ignition we need to skip the handler/stub frame to reach the
+ // JavaScript frame for the function.
__ Ldr(x2, MemOperand(x2, StandardFrameConstants::kCallerFPOffset));
- __ Bind(&loop_entry);
+ }
+ if (FLAG_debug_code) {
+ Label ok;
__ Ldr(x3, MemOperand(x2, StandardFrameConstants::kFunctionOffset));
__ Cmp(x3, x1);
- __ B(ne, &loop);
+ __ B(eq, &ok);
+ __ Abort(kInvalidFrameForFastNewRestArgumentsStub);
+ __ Bind(&ok);
}
// Check if we have rest parameters (only possible if we have an
@@ -5058,20 +5058,20 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) {
// -----------------------------------
__ AssertFunction(x1);
- // 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 x6 point to that
- // JavaScript frame.
- {
- Label loop, loop_entry;
- __ Mov(x6, fp);
- __ B(&loop_entry);
- __ Bind(&loop);
+ // Make x6 point to the JavaScript frame.
+ __ Mov(x6, fp);
+ if (skip_stub_frame()) {
+ // For Ignition we need to skip the handler/stub frame to reach the
+ // JavaScript frame for the function.
__ Ldr(x6, MemOperand(x6, StandardFrameConstants::kCallerFPOffset));
- __ Bind(&loop_entry);
+ }
+ if (FLAG_debug_code) {
+ Label ok;
__ Ldr(x3, MemOperand(x6, StandardFrameConstants::kFunctionOffset));
__ Cmp(x3, x1);
- __ B(ne, &loop);
+ __ B(eq, &ok);
+ __ Abort(kInvalidFrameForFastNewRestArgumentsStub);
+ __ Bind(&ok);
}
// TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub.
@@ -5358,20 +5358,20 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) {
// -----------------------------------
__ AssertFunction(x1);
- // 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 x2 point to that
- // JavaScript frame.
- {
- Label loop, loop_entry;
- __ Mov(x2, fp);
- __ B(&loop_entry);
- __ Bind(&loop);
+ // Make x2 point to the JavaScript frame.
+ __ Mov(x2, fp);
+ if (skip_stub_frame()) {
+ // For Ignition we need to skip the handler/stub frame to reach the
+ // JavaScript frame for the function.
__ Ldr(x2, MemOperand(x2, StandardFrameConstants::kCallerFPOffset));
- __ Bind(&loop_entry);
+ }
+ if (FLAG_debug_code) {
+ Label ok;
__ Ldr(x3, MemOperand(x2, StandardFrameConstants::kFunctionOffset));
__ Cmp(x3, x1);
- __ B(ne, &loop);
+ __ B(eq, &ok);
+ __ Abort(kInvalidFrameForFastNewRestArgumentsStub);
+ __ Bind(&ok);
}
// Check if we have an arguments adaptor frame below the function frame.
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698