| Index: src/full-codegen/x87/full-codegen-x87.cc
|
| diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc
|
| index 0ccf63f9f079b17f0b81a9a42ac162f81676a06c..28c8960c4b7a45007c3bd1397eaaea7a4d0379a2 100644
|
| --- a/src/full-codegen/x87/full-codegen-x87.cc
|
| +++ b/src/full-codegen/x87/full-codegen-x87.cc
|
| @@ -176,12 +176,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.
|
| }
|
|
|