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 9862b805e13bb48f299125dd12d9c223533204ff..67c8ecb908ccd3d4b50c67e9b4581889f4489b00 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -174,15 +174,11 @@ void FullCodeGenerator::Generate() { |
if (info->scope()->new_target_var() != nullptr) { |
__ Push(rdx); // Preserve new target. |
} |
- if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
- FastNewFunctionContextStub stub(isolate(), slots); |
- __ CallStub(&stub); |
- // Result of FastNewFunctionContextStub is always in new space. |
- need_write_barrier = false; |
- } else { |
- __ Push(rdi); |
- __ CallRuntime(Runtime::kNewFunctionContext); |
- } |
+ FastNewFunctionContextStub stub(isolate()); |
+ __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
+ __ CallStub(&stub); |
+ // Result of FastNewFunctionContextStub is always in new space. |
+ need_write_barrier = false; |
if (info->scope()->new_target_var() != nullptr) { |
__ Pop(rdx); // Restore new target. |
} |