Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index 2e3b95898eb1eddeabc49f4e64d3141ab61f4f66..8919b1f22b11ce6017c14d3ba7b2c9d1f28576f0 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -203,11 +203,16 @@ void FullCodeGenerator::Generate() { |
if (info->scope()->new_target_var() != nullptr) { |
__ Push(x3); // Preserve new target. |
} |
- FastNewFunctionContextStub stub(isolate()); |
- __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
- __ CallStub(&stub); |
- // Result of FastNewFunctionContextStub is always in new space. |
- need_write_barrier = false; |
+ if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
+ FastNewFunctionContextStub stub(isolate()); |
+ __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
+ __ CallStub(&stub); |
+ // Result of FastNewFunctionContextStub is always in new space. |
+ need_write_barrier = false; |
+ } else { |
+ __ Push(x1); |
+ __ CallRuntime(Runtime::kNewFunctionContext); |
+ } |
if (info->scope()->new_target_var() != nullptr) { |
__ Pop(x3); // Restore new target. |
} |