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

Unified Diff: src/ast/ast.h

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (Closed)
Patch Set: rebase 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/ast/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index e4a062104ead91b44f04d3b7aee1823874af6354..51da0930c350a15baced104f82111a936105cbef 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -2648,12 +2648,8 @@ class FunctionLiteral final : public Expression {
// function will be called immediately:
// - (function() { ... })();
// - var x = function() { ... }();
- bool should_eager_compile() const {
- return ShouldEagerCompile::decode(bit_field_);
- }
- void set_should_eager_compile() {
- bit_field_ = ShouldEagerCompile::update(bit_field_, true);
- }
+ bool ShouldEagerCompile() const;
+ void SetShouldEagerCompile();
// A hint that we expect this function to be called (exactly) once,
// i.e. we suspect it's an initialization function.
@@ -2734,11 +2730,11 @@ class FunctionLiteral final : public Expression {
HasDuplicateParameters::encode(has_duplicate_parameters ==
kHasDuplicateParameters) |
IsFunction::encode(is_function) |
- ShouldEagerCompile::encode(eager_compile_hint == kShouldEagerCompile) |
RequiresClassFieldInit::encode(false) |
ShouldNotBeUsedOnceHintField::encode(false) |
DontOptimizeReasonField::encode(kNoReason) |
IsClassFieldInitializer::encode(false);
+ if (eager_compile_hint == kShouldEagerCompile) SetShouldEagerCompile();
}
class FunctionTypeBits
@@ -2746,9 +2742,8 @@ class FunctionLiteral final : public Expression {
class Pretenure : public BitField<bool, FunctionTypeBits::kNext, 1> {};
class HasDuplicateParameters : public BitField<bool, Pretenure::kNext, 1> {};
class IsFunction : public BitField<bool, HasDuplicateParameters::kNext, 1> {};
- class ShouldEagerCompile : public BitField<bool, IsFunction::kNext, 1> {};
class ShouldNotBeUsedOnceHintField
- : public BitField<bool, ShouldEagerCompile::kNext, 1> {};
+ : public BitField<bool, IsFunction::kNext, 1> {};
class RequiresClassFieldInit
: public BitField<bool, ShouldNotBeUsedOnceHintField::kNext, 1> {};
class IsClassFieldInitializer
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698