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

Unified Diff: src/code-stubs.h

Issue 2457783004: 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 | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 0fff222bc55ba1ed6471056475d34e04e88312bc..5c83fdebb0ffa5a268f8fc4f6d750c3e6d1f24c2 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -1100,6 +1100,8 @@ class FastNewClosureStub : public TurboFanCodeStub {
class FastNewFunctionContextStub final : public TurboFanCodeStub {
public:
+ static const int kMaximumSlots = 0x8000;
+
explicit FastNewFunctionContextStub(Isolate* isolate)
: TurboFanCodeStub(isolate) {}
@@ -1109,6 +1111,11 @@ class FastNewFunctionContextStub final : public TurboFanCodeStub {
compiler::Node* context);
private:
+ // FastNewFunctionContextStub can only allocate closures which fit in the
+ // new space.
+ STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize +
+ FixedArray::kHeaderSize) < kMaxRegularHeapObjectSize);
+
DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext);
DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub);
};
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698