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

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

Issue 2054853002: Fix arguments object stubs for large arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Port to most architectures. 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 | « src/compiler/js-create-lowering.cc ('k') | src/mips/code-stubs-mips.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 e2273f56c232b6f57f8365d411c9b0db365851ad..c432a03d14caa89d834d831aa9edb344dbcd48e4 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -4784,8 +4784,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);
@@ -4798,6 +4801,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);
}
}
@@ -5154,8 +5173,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);
@@ -5168,6 +5190,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);
}
« no previous file with comments | « src/compiler/js-create-lowering.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698