| 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 0720c3d083543b0dfa83930f8a0981a567546156..f6d5d9e88d6c76cd28d61f95a02cb9de4f96e527 100644
|
| --- a/src/full-codegen/x64/full-codegen-x64.cc
|
| +++ b/src/full-codegen/x64/full-codegen-x64.cc
|
| @@ -190,14 +190,22 @@ void FullCodeGenerator::Generate() {
|
| __ Push(rdx); // Preserve new target.
|
| }
|
| if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
|
| - FastNewFunctionContextStub stub(isolate());
|
| - __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
|
| - __ CallStub(&stub);
|
| + if (info->scope()->is_eval_scope()) {
|
| + FastNewEvalContextStub stub(isolate());
|
| + __ Set(FastNewEvalContextDescriptor::SlotsRegister(), slots);
|
| + __ CallStub(&stub);
|
| + } else {
|
| + 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);
|
| + __ CallRuntime(info->scope()->is_eval_scope()
|
| + ? Runtime::kNewEvalContext
|
| + : Runtime::kNewFunctionContext);
|
| }
|
| if (info->scope()->new_target_var() != nullptr) {
|
| __ Pop(rdx); // Restore new target.
|
|
|