| Index: src/crankshaft/x64/lithium-codegen-x64.cc
|
| diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc
|
| index 60d00927d093f438b55adb3be48ff60379d8c2ca..0a9e2302c8ae91bbb7143e7bfa98aca76e2f00f7 100644
|
| --- a/src/crankshaft/x64/lithium-codegen-x64.cc
|
| +++ b/src/crankshaft/x64/lithium-codegen-x64.cc
|
| @@ -180,14 +180,22 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
|
| deopt_mode = Safepoint::kLazyDeopt;
|
| } else {
|
| 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);
|
| }
|
| }
|
| RecordSafepoint(deopt_mode);
|
|
|