Index: src/full-codegen/ia32/full-codegen-ia32.cc |
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc |
index a6ff338ad302ebf8d25ee0673dce0aa5ca11eedb..3a0b409efb9aed84569e61cdc4e04878c970cb2f 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -189,12 +189,17 @@ void FullCodeGenerator::Generate() { |
if (info->scope()->new_target_var() != nullptr) { |
__ push(edx); // Preserve new target. |
} |
- 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); |
+ } |
if (info->scope()->new_target_var() != nullptr) { |
__ pop(edx); // Restore new target. |
} |