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

Unified Diff: src/ast.h

Issue 1102523003: Implement a 'trial parse' step, that will abort pre-parsing excessively (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use a seperate 'hint' bit for "to be executed once" code aging. Created 5 years, 7 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 0cb506b47f944cb83307c1bb10595bf8f5f88b98..2f31ce052ab9f1add16e9bbfa0840e584c898f48 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -2430,6 +2430,8 @@ class FunctionLiteral final : public Expression {
enum EagerCompileHint { kShouldEagerCompile, kShouldLazyCompile };
+ enum ShouldBeUsedOnceHint { kShouldBeUsedOnce, kDontKnowIfShouldBeUsedOnce };
+
enum ArityRestriction {
NORMAL_ARITY,
GETTER_ARITY,
@@ -2525,6 +2527,15 @@ class FunctionLiteral final : public Expression {
bitfield_ = EagerCompileHintBit::update(bitfield_, kShouldEagerCompile);
}
+ // A hint that we expect this function to be called (exactly) once,
+ // i.e. we suspect it's an initialization function.
+ bool should_be_used_once_hint() const {
+ return ShouldBeUsedOnceHintBit::decode(bitfield_) == kShouldBeUsedOnce;
+ }
+ void set_should_be_used_once_hint() {
+ bitfield_ = ShouldBeUsedOnceHintBit::update(bitfield_, kShouldBeUsedOnce);
+ }
+
FunctionKind kind() { return FunctionKindBits::decode(bitfield_); }
int ast_node_count() { return ast_properties_.node_count(); }
@@ -2569,7 +2580,8 @@ class FunctionLiteral final : public Expression {
HasDuplicateParameters::encode(has_duplicate_parameters) |
IsFunction::encode(is_function) |
EagerCompileHintBit::encode(eager_compile_hint) |
- FunctionKindBits::encode(kind);
+ FunctionKindBits::encode(kind) |
+ ShouldBeUsedOnceHintBit::encode(kDontKnowIfShouldBeUsedOnce);
DCHECK(IsValidFunctionKind(kind));
}
@@ -2598,6 +2610,8 @@ class FunctionLiteral final : public Expression {
class IsFunction : public BitField<IsFunctionFlag, 4, 1> {};
class EagerCompileHintBit : public BitField<EagerCompileHint, 5, 1> {};
class FunctionKindBits : public BitField<FunctionKind, 6, 8> {};
+ class ShouldBeUsedOnceHintBit : public BitField<ShouldBeUsedOnceHint, 15, 1> {
+ };
};
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698