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

Unified Diff: src/code-stubs.h

Issue 2445703002: 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 8a3a2f7c6d6d1cb58d6258b8b31b42df89c4a490..01e2af350c86ce28541f213c244775e2602da086 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -863,6 +863,8 @@ class FastNewClosureStub : public TurboFanCodeStub {
class FastNewFunctionContextStub final : public TurboFanCodeStub {
public:
+ static const int kMaximumSlots = 0x8000;
+
explicit FastNewFunctionContextStub(Isolate* isolate)
: TurboFanCodeStub(isolate) {}
@@ -872,6 +874,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