| Index: src/full-codegen/x64/full-codegen-x64.cc
|
| diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc
|
| index 4b0e43c9b21afc825338e7f62647b0b3676a5fce..ce94a990d541145653cbc80d699e81edec7dd424 100644
|
| --- a/src/full-codegen/x64/full-codegen-x64.cc
|
| +++ b/src/full-codegen/x64/full-codegen-x64.cc
|
| @@ -175,11 +175,16 @@ void FullCodeGenerator::Generate() {
|
| if (info->scope()->new_target_var() != nullptr) {
|
| __ Push(rdx); // Preserve new target.
|
| }
|
| - FastNewFunctionContextStub stub(isolate());
|
| - __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
|
| - __ CallStub(&stub);
|
| - // Result of FastNewFunctionContextStub is always in new space.
|
| - need_write_barrier = false;
|
| + if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
|
| + FastNewFunctionContextStub stub(isolate());
|
| + __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
|
| + __ CallStub(&stub);
|
| + // Result of FastNewFunctionContextStub is always in new space.
|
| + need_write_barrier = false;
|
| + } else {
|
| + __ Push(rdi);
|
| + __ CallRuntime(Runtime::kNewFunctionContext);
|
| + }
|
| if (info->scope()->new_target_var() != nullptr) {
|
| __ Pop(rdx); // Restore new target.
|
| }
|
|
|