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

Unified Diff: src/code-stubs.h

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes based on review commnets Created 4 years 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
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 41fc8eaf3e38df11d5413ad0c047275a54990d40..ad09dc24a400d8d0367fecbfd76f60dd7f9f9632 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -812,17 +812,27 @@ class FastNewClosureStub : public TurboFanCodeStub {
class FastNewFunctionContextStub final : public TurboFanCodeStub {
public:
- static const int kMaximumSlots = 0x8000;
+ static int MaximumSlots();
- explicit FastNewFunctionContextStub(Isolate* isolate)
- : TurboFanCodeStub(isolate) {}
+ explicit FastNewFunctionContextStub(Isolate* isolate, ScopeType scope_type)
+ : TurboFanCodeStub(isolate) {
+ minor_key_ = ScopeTypeBits::encode(scope_type);
+ }
static compiler::Node* Generate(CodeStubAssembler* assembler,
compiler::Node* function,
compiler::Node* slots,
- compiler::Node* context);
+ compiler::Node* context,
+ ScopeType scope_type);
+
+ ScopeType scope_type() const {
+ return static_cast<ScopeType>(ScopeTypeBits::decode(minor_key_));
+ }
private:
+ static const int kMaximumSlots = 0x8000;
+ static const int kSmallMaximumSlots = 10;
+
// FastNewFunctionContextStub can only allocate closures which fit in the
// new space.
STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize +
@@ -830,8 +840,9 @@ class FastNewFunctionContextStub final : public TurboFanCodeStub {
DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext);
DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub);
-};
+ class ScopeTypeBits : public BitField<bool, 0, 8> {};
Michael Starzinger 2016/12/15 09:42:59 nit: Can we move this up three lines, so that the
Dan Ehrenberg 2016/12/15 23:51:50 Done.
+};
class FastNewObjectStub final : public PlatformCodeStub {
public:
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | src/debug/debug-scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698