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); |
} |