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

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

Issue 2100003002: X87: Fix arguments object stubs for large arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index b9221644591a76aa0e65c2cbae8716ca63ed39cc..7b069ac6292c98ee220bf1465f49a676811c98c2 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -4366,8 +4366,11 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
__ mov(eax, edi);
__ Ret();
- // Fall back to %AllocateInNewSpace.
+ // Fall back to %AllocateInNewSpace (if not too big).
+ Label too_big_for_new_space;
__ bind(&allocate);
+ __ cmp(ecx, Immediate(Page::kMaxRegularHeapObjectSize));
+ __ j(greater, &too_big_for_new_space);
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ SmiTag(ecx);
@@ -4380,6 +4383,22 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
__ Pop(eax);
}
__ jmp(&done_allocate);
+
+ // Fall back to %NewRestParameter.
+ __ bind(&too_big_for_new_space);
+ __ PopReturnAddressTo(ecx);
+ // We reload the function from the caller frame due to register pressure
+ // within this stub. This is the slow path, hence reloading is preferable.
+ if (skip_stub_frame()) {
+ // For Ignition we need to skip the handler/stub frame to reach the
+ // JavaScript frame for the function.
+ __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
+ __ Push(Operand(edx, StandardFrameConstants::kFunctionOffset));
+ } else {
+ __ Push(Operand(ebp, StandardFrameConstants::kFunctionOffset));
+ }
+ __ PushReturnAddressFrom(ecx);
+ __ TailCallRuntime(Runtime::kNewRestParameter);
}
}
@@ -4734,8 +4753,11 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) {
__ mov(eax, edi);
__ Ret();
- // Fall back to %AllocateInNewSpace.
+ // Fall back to %AllocateInNewSpace (if not too big).
+ Label too_big_for_new_space;
__ bind(&allocate);
+ __ cmp(ecx, Immediate(Page::kMaxRegularHeapObjectSize));
+ __ j(greater, &too_big_for_new_space);
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ SmiTag(ecx);
@@ -4748,6 +4770,22 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) {
__ Pop(eax);
}
__ jmp(&done_allocate);
+
+ // Fall back to %NewStrictArguments.
+ __ bind(&too_big_for_new_space);
+ __ PopReturnAddressTo(ecx);
+ // We reload the function from the caller frame due to register pressure
+ // within this stub. This is the slow path, hence reloading is preferable.
+ if (skip_stub_frame()) {
+ // For Ignition we need to skip the handler/stub frame to reach the
+ // JavaScript frame for the function.
+ __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
+ __ Push(Operand(edx, StandardFrameConstants::kFunctionOffset));
+ } else {
+ __ Push(Operand(ebp, StandardFrameConstants::kFunctionOffset));
+ }
+ __ PushReturnAddressFrom(ecx);
+ __ TailCallRuntime(Runtime::kNewStrictArguments);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
« 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