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

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

Issue 1909903003: [Interpreter] Use FastNewSloppyArguments when possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports Created 4 years, 8 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/arm64/code-stubs-arm64.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 3a86e03cb13c1441443f37ee8e0eb576a8220707..7ba3d955fda6f00fac141f9aebaa7a19278a278e 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -4973,35 +4973,50 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) {
// -----------------------------------
__ AssertFunction(edi);
+ // 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 ebx point to that
+ // JavaScript frame.
+ {
+ Label loop, loop_entry;
+ __ mov(ecx, ebp);
+ __ jmp(&loop_entry, Label::kNear);
+ __ bind(&loop);
+ __ mov(ecx, Operand(ecx, StandardFrameConstants::kCallerFPOffset));
+ __ bind(&loop_entry);
+ __ cmp(edi, Operand(ecx, StandardFrameConstants::kFunctionOffset));
+ __ j(not_equal, &loop);
+ }
+
// TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub.
- __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
- __ mov(ecx,
- FieldOperand(ecx, SharedFunctionInfo::kFormalParameterCountOffset));
- __ lea(edx, Operand(ebp, ecx, times_half_pointer_size,
+ __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
+ __ mov(ebx,
+ FieldOperand(ebx, SharedFunctionInfo::kFormalParameterCountOffset));
+ __ lea(edx, Operand(ecx, ebx, times_half_pointer_size,
StandardFrameConstants::kCallerSPOffset));
- // ecx : number of parameters (tagged)
+ // ebx : number of parameters (tagged)
// edx : parameters pointer
// edi : function
+ // ecx : JavaScript frame pointer.
// esp[0] : return address
// Check if the calling frame is an arguments adaptor frame.
Label adaptor_frame, try_allocate, runtime;
- __ mov(ebx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
- __ mov(eax, Operand(ebx, CommonFrameConstants::kContextOrFrameTypeOffset));
+ __ mov(eax, Operand(ecx, StandardFrameConstants::kCallerFPOffset));
+ __ mov(eax, Operand(eax, CommonFrameConstants::kContextOrFrameTypeOffset));
__ cmp(eax, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
__ j(equal, &adaptor_frame, Label::kNear);
// No adaptor, parameter count = argument count.
- __ mov(ebx, ecx);
- __ push(ecx);
+ __ mov(ecx, ebx);
+ __ push(ebx);
__ jmp(&try_allocate, Label::kNear);
// We have an adaptor frame. Patch the parameters pointer.
__ bind(&adaptor_frame);
- __ mov(ebx, ecx);
- __ push(ecx);
- __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
+ __ push(ebx);
+ __ mov(edx, Operand(ecx, StandardFrameConstants::kCallerFPOffset));
__ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
__ lea(edx, Operand(edx, ecx, times_2,
StandardFrameConstants::kCallerSPOffset));
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698