Index: src/full-codegen/ppc/full-codegen-ppc.cc |
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc |
index 6778fbd2990e6caf16778c0692dfd5a65e0ba4a5..eaa1f47195d9e18e70d4a2f52e98ff90045af635 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -208,11 +208,17 @@ void FullCodeGenerator::Generate() { |
if (info->scope()->new_target_var() != nullptr) { |
__ push(r6); // Preserve new target. |
} |
- FastNewFunctionContextStub stub(isolate()); |
- __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(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(), |
+ Operand(slots)); |
+ __ CallStub(&stub); |
+ // Result of FastNewFunctionContextStub is always in new space. |
+ need_write_barrier = false; |
+ } else { |
+ __ push(r4); |
+ __ CallRuntime(Runtime::kNewFunctionContext); |
+ } |
if (info->scope()->new_target_var() != nullptr) { |
__ pop(r6); // Preserve new target. |
} |