Index: src/full-codegen/ia32/full-codegen-ia32.cc |
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc |
index 5e80dd32807ad947aea50ea20423bbd2e77274e1..2586ade7df83fa7d79e87ee101c8fe0cbdafb8ed 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -190,15 +190,22 @@ void FullCodeGenerator::Generate() { |
__ push(edx); // Preserve new target. |
} |
if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
- FastNewFunctionContextStub stub(isolate()); |
- __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
- Immediate(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(edi); |
- __ CallRuntime(Runtime::kNewFunctionContext); |
+ __ Push(edi); |
+ __ CallRuntime(info->scope()->is_eval_scope() |
+ ? Runtime::kNewEvalContext |
+ : Runtime::kNewFunctionContext); |
} |
if (info->scope()->new_target_var() != nullptr) { |
__ pop(edx); // Restore new target. |