Index: src/crankshaft/x87/lithium-codegen-x87.cc |
diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc |
index cfdb610d5ad09c7c69d498b81703f81b7de8373b..28d0a65165f1a67adfe90ca61be8f60e3921d65d 100644 |
--- a/src/crankshaft/x87/lithium-codegen-x87.cc |
+++ b/src/crankshaft/x87/lithium-codegen-x87.cc |
@@ -146,12 +146,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) { |
__ CallRuntime(Runtime::kNewScriptContext); |
deopt_mode = Safepoint::kLazyDeopt; |
} else { |
- FastNewFunctionContextStub stub(isolate()); |
- __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
- Immediate(slots)); |
- __ CallStub(&stub); |
- // Result of FastNewFunctionContextStub is always in new space. |
- need_write_barrier = false; |
+ if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
+ FastNewFunctionContextStub stub(isolate()); |
+ __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
+ Immediate(slots)); |
+ __ CallStub(&stub); |
+ // Result of FastNewFunctionContextStub is always in new space. |
+ need_write_barrier = false; |
+ } else { |
+ __ push(edi); |
+ __ CallRuntime(Runtime::kNewFunctionContext); |
+ } |
} |
RecordSafepoint(deopt_mode); |