Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 2460723005: Merged: Don't call FastNewFunctionContextStub if context is bigger than kMaxRegularHeapObjectSize. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index 69526cd7eae8d43227c820e3842c05c01c7377e2..812d3e7bcee0d1d5843f450ea5b8b45f5a3a4b8b 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -444,9 +444,13 @@ void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
int const slot_count = OpParameter<int>(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
- Callable callable = CodeFactory::FastNewFunctionContext(isolate());
- node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
- ReplaceWithStubCall(node, callable, flags);
+ if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) {
+ Callable callable = CodeFactory::FastNewFunctionContext(isolate());
+ node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
+ ReplaceWithStubCall(node, callable, flags);
+ } else {
+ ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext);
+ }
}
« no previous file with comments | « src/code-stubs.h ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698