Index: src/crankshaft/mips64/lithium-codegen-mips64.cc |
diff --git a/src/crankshaft/mips64/lithium-codegen-mips64.cc b/src/crankshaft/mips64/lithium-codegen-mips64.cc |
index 64eeb8ac9da1905774f88d857b6c41c445f1989e..fd979a69b68b6e6b4d67c72ecaea09c6f23429fd 100644 |
--- a/src/crankshaft/mips64/lithium-codegen-mips64.cc |
+++ b/src/crankshaft/mips64/lithium-codegen-mips64.cc |
@@ -159,11 +159,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) { |
__ CallRuntime(Runtime::kNewScriptContext); |
deopt_mode = Safepoint::kLazyDeopt; |
} else { |
- FastNewFunctionContextStub stub(isolate()); |
- __ li(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots)); |
- __ CallStub(&stub); |
- // Result of FastNewFunctionContextStub is always in new space. |
- need_write_barrier = false; |
+ if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
+ FastNewFunctionContextStub stub(isolate()); |
+ __ li(FastNewFunctionContextDescriptor::SlotsRegister(), |
+ Operand(slots)); |
+ __ CallStub(&stub); |
+ // Result of FastNewFunctionContextStub is always in new space. |
+ need_write_barrier = false; |
+ } else { |
+ __ push(a1); |
+ __ CallRuntime(Runtime::kNewFunctionContext); |
+ } |
} |
RecordSafepoint(deopt_mode); |