| 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 264f288f8837f83e2342f6f6151cd33d4ea0afdc..47be8b061627a2ce1181c3c4b10e66c79a1db679 100644
|
| --- a/src/full-codegen/x87/full-codegen-x87.cc
|
| +++ b/src/full-codegen/x87/full-codegen-x87.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.
|
| }
|
|
|