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

Unified Diff: src/ast.h

Issue 636403003: Assign bailout and type feedback IDs in a post-pass (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « BUILD.gn ('k') | src/ast.cc » ('j') | src/ast-numbering.cc » ('J')
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 6cb866925968ee34f2b08ccc88a23e34eebe31d6..d11125a4101209203cbb46898030fd92e7b70abc 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -385,25 +385,39 @@ class Expression : public AstNode {
BailoutId id() const { return BailoutId(base_id() + 0); }
TypeFeedbackId test_id() const { return TypeFeedbackId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- Expression(Zone* zone, int pos, int num_ids_needed_by_subclass, IdGen* id_gen)
+ Expression(Zone* zone, int pos)
: AstNode(pos),
is_parenthesized_(false),
is_multi_parenthesized_(false),
bounds_(Bounds::Unbounded(zone)),
- base_id_(
- id_gen->ReserveIdRange(num_ids_needed_by_subclass + num_ids())) {}
+ base_id_(BailoutId::None().ToInt()) {}
void set_to_boolean_types(byte types) { to_boolean_types_ = types; }
- static int num_ids() { return 2; }
- int base_id() const { return base_id_; }
+ void InitializeBaseBailoutId(int count, IdGen* id_gen) {
+ DCHECK(BailoutId(base_id_).IsNone());
+ base_id_ = id_gen->ReserveIdRange(count);
+ }
+
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
+
+ int leaf_base_id() const { return base_id() + 2; }
Sven Panne 2014/10/14 06:56:26 I don't understand what leaf_base_id() should do.
+
+ static const int kBailoutIdCount = 2;
private:
byte to_boolean_types_;
bool is_parenthesized_ : 1;
bool is_multi_parenthesized_ : 1;
Bounds bounds_;
- const int base_id_;
+ int base_id_;
};
@@ -434,26 +448,39 @@ class BreakableStatement : public Statement {
BailoutId EntryId() const { return BailoutId(base_id() + 0); }
BailoutId ExitId() const { return BailoutId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
BreakableStatement(Zone* zone, ZoneList<const AstRawString*>* labels,
- BreakableType breakable_type, int position,
- int num_ids_needed_by_subclass, IdGen* id_gen)
+ BreakableType breakable_type, int position)
: Statement(zone, position),
labels_(labels),
breakable_type_(breakable_type),
- base_id_(
- id_gen->ReserveIdRange(num_ids_needed_by_subclass + num_ids())) {
+ base_id_(BailoutId::None().ToInt()) {
DCHECK(labels == NULL || labels->length() > 0);
}
- static int num_ids() { return 2; }
- int base_id() const { return base_id_; }
+ void InitializeBaseBailoutId(int count, IdGen* id_gen) {
+ DCHECK(BailoutId(base_id_).IsNone());
+ base_id_ = id_gen->ReserveIdRange(count);
+ }
+
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
+
+ int leaf_base_id() const { return base_id() + 2; }
+
+ static const int kBailoutIdCount = 2;
private:
ZoneList<const AstRawString*>* labels_;
BreakableType breakable_type_;
Label break_target_;
- const int base_id_;
+ int base_id_;
};
@@ -478,19 +505,20 @@ class Block FINAL : public BreakableStatement {
Scope* scope() const { return scope_; }
void set_scope(Scope* scope) { scope_ = scope; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
Block(Zone* zone, ZoneList<const AstRawString*>* labels, int capacity,
- bool is_initializer_block, int pos, IdGen* id_gen)
- : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos, num_ids(),
- id_gen),
+ bool is_initializer_block, int pos)
+ : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos),
statements_(capacity, zone),
is_initializer_block_(is_initializer_block),
scope_(NULL) {}
- static int num_ids() { return 1; }
- int base_id() const {
- return BreakableStatement::base_id() + BreakableStatement::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = BreakableStatement::kBailoutIdCount + 1;
private:
ZoneList<Statement*> statements_;
@@ -506,6 +534,7 @@ class Declaration : public AstNode {
Scope* scope() const { return scope_; }
virtual InitializationFlag initialization() const = 0;
virtual bool IsInlineable() const;
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
protected:
Declaration(Zone* zone,
@@ -644,6 +673,8 @@ class Module : public AstNode {
Interface* interface() const { return interface_; }
Block* body() const { return body_; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
Module(Zone* zone, int pos)
: AstNode(pos),
@@ -724,6 +755,8 @@ class ModuleStatement FINAL : public Statement {
VariableProxy* proxy() const { return proxy_; }
Block* body() const { return body_; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
ModuleStatement(Zone* zone, VariableProxy* proxy, Block* body, int pos)
: Statement(zone, pos),
@@ -753,21 +786,22 @@ class IterationStatement : public BreakableStatement {
// Code generation
Label* continue_target() { return &continue_target_; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- int num_ids_needed_by_subclass, IdGen* id_gen)
- : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos,
- num_ids_needed_by_subclass + num_ids(), id_gen),
+ IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
body_(NULL) {}
void Initialize(Statement* body) {
body_ = body;
}
- static int num_ids() { return 1; }
- int base_id() const {
- return BreakableStatement::base_id() + BreakableStatement::num_ids();
- }
+ int base_id() const { return BreakableStatement::leaf_base_id(); }
+ int leaf_base_id() const { return base_id() + 1; }
+ static const int kBailoutIdCount = BreakableStatement::kBailoutIdCount + 1;
private:
Statement* body_;
@@ -792,15 +826,16 @@ class DoWhileStatement FINAL : public IterationStatement {
virtual BailoutId StackCheckId() const OVERRIDE { return BackEdgeId(); }
BailoutId BackEdgeId() const { return BailoutId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- DoWhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids(), id_gen), cond_(NULL) {}
+ DoWhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : IterationStatement(zone, labels, pos), cond_(NULL) {}
- static int num_ids() { return 2; }
- int base_id() const {
- return IterationStatement::base_id() + IterationStatement::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = IterationStatement::kBailoutIdCount + 2;
private:
Expression* cond_;
@@ -828,17 +863,18 @@ class WhileStatement FINAL : public IterationStatement {
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
BailoutId BodyId() const { return BailoutId(base_id() + 0); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids(), id_gen),
+ WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : IterationStatement(zone, labels, pos),
cond_(NULL),
may_have_function_literal_(true) {}
- static int num_ids() { return 1; }
- int base_id() const {
- return IterationStatement::base_id() + IterationStatement::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = IterationStatement::kBailoutIdCount + 1;
private:
Expression* cond_;
@@ -879,24 +915,25 @@ class ForStatement FINAL : public IterationStatement {
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
BailoutId BodyId() const { return BailoutId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
bool is_fast_smi_loop() { return loop_variable_ != NULL; }
Variable* loop_variable() { return loop_variable_; }
void set_loop_variable(Variable* var) { loop_variable_ = var; }
protected:
- ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids(), id_gen),
+ ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : IterationStatement(zone, labels, pos),
init_(NULL),
cond_(NULL),
next_(NULL),
may_have_function_literal_(true),
loop_variable_(NULL) {}
- static int num_ids() { return 2; }
- int base_id() const {
- return IterationStatement::base_id() + IterationStatement::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = IterationStatement::kBailoutIdCount + 2;
private:
Statement* init_;
@@ -926,12 +963,8 @@ class ForEachStatement : public IterationStatement {
Expression* subject() const { return subject_; }
protected:
- ForEachStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- int num_ids_needed_by_subclass, IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids_needed_by_subclass,
- id_gen),
- each_(NULL),
- subject_(NULL) {}
+ ForEachStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : IterationStatement(zone, labels, pos), each_(NULL), subject_(NULL) {}
private:
Expression* each_;
@@ -965,17 +998,18 @@ class ForInStatement FINAL : public ForEachStatement {
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : ForEachStatement(zone, labels, pos, num_ids(), id_gen),
+ ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : ForEachStatement(zone, labels, pos),
for_in_type_(SLOW_FOR_IN),
for_in_feedback_slot_(kInvalidFeedbackSlot) {}
- static int num_ids() { return 2; }
- int base_id() const {
- return ForEachStatement::base_id() + ForEachStatement::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = ForEachStatement::kBailoutIdCount + 2;
private:
ForInType for_in_type_;
@@ -1030,19 +1064,20 @@ class ForOfStatement FINAL : public ForEachStatement {
BailoutId BackEdgeId() const { return BailoutId(base_id() + 0); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : ForEachStatement(zone, labels, pos, num_ids(), id_gen),
+ ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : ForEachStatement(zone, labels, pos),
assign_iterator_(NULL),
next_result_(NULL),
result_done_(NULL),
assign_each_(NULL) {}
- static int num_ids() { return 1; }
- int base_id() const {
- return ForEachStatement::base_id() + ForEachStatement::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = ForEachStatement::kBailoutIdCount + 1;
private:
Expression* assign_iterator_;
@@ -1060,6 +1095,8 @@ class ExpressionStatement FINAL : public Statement {
Expression* expression() const { return expression_; }
virtual bool IsJump() const OVERRIDE { return expression_->IsThrow(); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
ExpressionStatement(Zone* zone, Expression* expression, int pos)
: Statement(zone, pos), expression_(expression) { }
@@ -1073,6 +1110,8 @@ class JumpStatement : public Statement {
public:
virtual bool IsJump() const FINAL OVERRIDE { return true; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
explicit JumpStatement(Zone* zone, int pos) : Statement(zone, pos) {}
};
@@ -1131,6 +1170,8 @@ class WithStatement FINAL : public Statement {
Expression* expression() const { return expression_; }
Statement* statement() const { return statement_; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
WithStatement(
Zone* zone, Scope* scope,
@@ -1162,15 +1203,19 @@ class CaseClause FINAL : public Expression {
BailoutId EntryId() const { return BailoutId(base_id() + 0); }
TypeFeedbackId CompareId() { return TypeFeedbackId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
Type* compare_type() { return compare_type_; }
void set_compare_type(Type* type) { compare_type_ = type; }
private:
CaseClause(Zone* zone, Expression* label, ZoneList<Statement*>* statements,
- int pos, IdGen* id_gen);
+ int pos);
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
Expression* label_;
Label body_target_;
@@ -1192,9 +1237,8 @@ class SwitchStatement FINAL : public BreakableStatement {
ZoneList<CaseClause*>* cases() const { return cases_; }
protected:
- SwitchStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos, 0, id_gen),
+ SwitchStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
tag_(NULL),
cases_(NULL) {}
@@ -1229,23 +1273,32 @@ class IfStatement FINAL : public Statement {
BailoutId ThenId() const { return BailoutId(base_id() + 1); }
BailoutId ElseId() const { return BailoutId(base_id() + 2); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ DCHECK(BailoutId(base_id_).IsNone());
+ base_id_ = id_gen->ReserveIdRange(kBailoutIdCount);
+ }
+
protected:
IfStatement(Zone* zone, Expression* condition, Statement* then_statement,
- Statement* else_statement, int pos, IdGen* id_gen)
+ Statement* else_statement, int pos)
: Statement(zone, pos),
condition_(condition),
then_statement_(then_statement),
else_statement_(else_statement),
- base_id_(id_gen->ReserveIdRange(num_ids())) {}
+ base_id_(BailoutId::None().ToInt()) {}
- static int num_ids() { return 3; }
- int base_id() const { return base_id_; }
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
+
+ static const int kBailoutIdCount = 3;
private:
Expression* condition_;
Statement* then_statement_;
Statement* else_statement_;
- const int base_id_;
+ int base_id_;
};
@@ -1283,6 +1336,8 @@ class TryStatement : public Statement {
Block* try_block() const { return try_block_; }
ZoneList<Label*>* escaping_targets() const { return escaping_targets_; }
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
TryStatement(Zone* zone, int index, Block* try_block, int pos)
: Statement(zone, pos),
@@ -1351,15 +1406,23 @@ class DebuggerStatement FINAL : public Statement {
BailoutId DebugBreakId() const { return BailoutId(base_id() + 0); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ DCHECK(BailoutId(base_id_).IsNone());
+ base_id_ = id_gen->ReserveIdRange(kBailoutIdCount);
+ }
+
protected:
- explicit DebuggerStatement(Zone* zone, int pos, IdGen* id_gen)
- : Statement(zone, pos), base_id_(id_gen->ReserveIdRange(num_ids())) {}
+ explicit DebuggerStatement(Zone* zone, int pos)
+ : Statement(zone, pos), base_id_(BailoutId::None().ToInt()) {}
- static int num_ids() { return 1; }
- int base_id() const { return base_id_; }
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
+ static const int kBailoutIdCount = 1;
private:
- const int base_id_;
+ int base_id_;
};
@@ -1367,6 +1430,8 @@ class EmptyStatement FINAL : public Statement {
public:
DECLARE_NODE_TYPE(EmptyStatement)
+ void AllocateBailoutIdRange(IdGen* id_gen) {}
+
protected:
explicit EmptyStatement(Zone* zone, int pos): Statement(zone, pos) {}
};
@@ -1409,12 +1474,16 @@ class Literal FINAL : public Expression {
return TypeFeedbackId(base_id() + 0);
}
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
- Literal(Zone* zone, const AstValue* value, int position, IdGen* id_gen)
- : Expression(zone, position, num_ids(), id_gen), value_(value) {}
+ Literal(Zone* zone, const AstValue* value, int position)
+ : Expression(zone, position), value_(value) {}
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 1;
private:
const AstValue* value_;
@@ -1435,9 +1504,8 @@ class MaterializedLiteral : public Expression {
}
protected:
- MaterializedLiteral(Zone* zone, int literal_index, int pos,
- int num_ids_needed_by_subclass, IdGen* id_gen)
- : Expression(zone, pos, num_ids_needed_by_subclass, id_gen),
+ MaterializedLiteral(Zone* zone, int literal_index, int pos)
+ : Expression(zone, pos),
literal_index_(literal_index),
is_simple_(false),
depth_(0) {}
@@ -1567,9 +1635,8 @@ class ObjectLiteral FINAL : public MaterializedLiteral {
protected:
ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index,
- int boilerplate_properties, bool has_function, int pos,
- IdGen* id_gen)
- : MaterializedLiteral(zone, literal_index, pos, 0, id_gen),
+ int boilerplate_properties, bool has_function, int pos)
+ : MaterializedLiteral(zone, literal_index, pos),
properties_(properties),
boilerplate_properties_(boilerplate_properties),
fast_elements_(false),
@@ -1596,9 +1663,8 @@ class RegExpLiteral FINAL : public MaterializedLiteral {
protected:
RegExpLiteral(Zone* zone, const AstRawString* pattern,
- const AstRawString* flags, int literal_index, int pos,
- IdGen* id_gen)
- : MaterializedLiteral(zone, literal_index, pos, 0, id_gen),
+ const AstRawString* flags, int literal_index, int pos)
+ : MaterializedLiteral(zone, literal_index, pos),
pattern_(pattern),
flags_(flags) {
set_depth(1);
@@ -1638,16 +1704,18 @@ class ArrayLiteral FINAL : public MaterializedLiteral {
kDisableMementos = 1 << 1
};
+
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ int count = MaterializedLiteral::kBailoutIdCount + values()->length();
+ InitializeBaseBailoutId(count, id_gen);
+ }
+
protected:
ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, int literal_index,
- int pos, IdGen* id_gen)
- : MaterializedLiteral(zone, literal_index, pos, num_ids(values), id_gen),
- values_(values) {}
+ int pos)
+ : MaterializedLiteral(zone, literal_index, pos), values_(values) {}
- static int num_ids(ZoneList<Expression*>* values) { return values->length(); }
- int base_id() const {
- return MaterializedLiteral::base_id() + MaterializedLiteral::num_ids();
- }
+ int base_id() const { return leaf_base_id(); }
private:
Handle<FixedArray> constant_elements_;
@@ -1701,10 +1769,10 @@ class VariableProxy FINAL : public Expression {
int VariableFeedbackSlot() { return variable_feedback_slot_; }
protected:
- VariableProxy(Zone* zone, Variable* var, int position, IdGen* id_gen);
+ VariableProxy(Zone* zone, Variable* var, int position);
VariableProxy(Zone* zone, const AstRawString* name, bool is_this,
- Interface* interface, int position, IdGen* id_gen);
+ Interface* interface, int position);
union {
const AstRawString* raw_name_; // if !is_resolved_
@@ -1730,6 +1798,9 @@ class Property FINAL : public Expression {
BailoutId LoadId() const { return BailoutId(base_id() + 0); }
TypeFeedbackId PropertyFeedbackId() { return TypeFeedbackId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
bool IsStringAccess() const { return is_string_access_; }
@@ -1764,8 +1835,8 @@ class Property FINAL : public Expression {
int PropertyFeedbackSlot() const { return property_feedback_slot_; }
protected:
- Property(Zone* zone, Expression* obj, Expression* key, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ Property(Zone* zone, Expression* obj, Expression* key, int pos)
+ : Expression(zone, pos),
obj_(obj),
key_(key),
property_feedback_slot_(kInvalidFeedbackSlot),
@@ -1773,8 +1844,8 @@ class Property FINAL : public Expression {
is_uninitialized_(false),
is_string_access_(false) {}
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
private:
Expression* obj_;
@@ -1844,6 +1915,10 @@ class Call FINAL : public Expression {
BailoutId ReturnId() const { return BailoutId(base_id() + 0); }
BailoutId EvalOrLookupId() const { return BailoutId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
enum CallType {
POSSIBLY_EVAL_CALL,
GLOBAL_CALL,
@@ -1863,8 +1938,8 @@ class Call FINAL : public Expression {
protected:
Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
- int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ int pos)
+ : Expression(zone, pos),
expression_(expression),
arguments_(arguments),
call_feedback_slot_(kInvalidFeedbackSlot) {
@@ -1873,8 +1948,8 @@ class Call FINAL : public Expression {
}
}
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
private:
Expression* expression_;
@@ -1922,17 +1997,21 @@ class CallNew FINAL : public Expression {
BailoutId ReturnId() const { return BailoutId(base_id() + 0); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
- int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ int pos)
+ : Expression(zone, pos),
expression_(expression),
arguments_(arguments),
is_monomorphic_(false),
callnew_feedback_slot_(kInvalidFeedbackSlot) {}
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 1;
private:
Expression* expression_;
@@ -1976,17 +2055,21 @@ class CallRuntime FINAL : public Expression {
return TypeFeedbackId(base_id() + 0);
}
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
CallRuntime(Zone* zone, const AstRawString* name,
const Runtime::Function* function,
- ZoneList<Expression*>* arguments, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ ZoneList<Expression*>* arguments, int pos)
+ : Expression(zone, pos),
raw_name_(name),
function_(function),
arguments_(arguments) {}
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 1;
private:
const AstRawString* raw_name_;
@@ -2008,20 +2091,21 @@ class UnaryOperation FINAL : public Expression {
BailoutId MaterializeTrueId() const { return BailoutId(base_id() + 0); }
BailoutId MaterializeFalseId() const { return BailoutId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
virtual void RecordToBooleanTypeFeedback(
TypeFeedbackOracle* oracle) OVERRIDE;
protected:
- UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int pos,
- IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
- op_(op),
- expression_(expression) {
+ UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int pos)
+ : Expression(zone, pos), op_(op), expression_(expression) {
DCHECK(Token::IsUnaryOp(op));
}
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
private:
Token::Value op_;
@@ -2050,6 +2134,10 @@ class BinaryOperation FINAL : public Expression {
TypeFeedbackId BinaryOperationFeedbackId() const {
return TypeFeedbackId(base_id() + 1);
}
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
Maybe<int> fixed_right_arg() const { return fixed_right_arg_; }
void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; }
@@ -2058,16 +2146,13 @@ class BinaryOperation FINAL : public Expression {
protected:
BinaryOperation(Zone* zone, Token::Value op, Expression* left,
- Expression* right, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
- op_(op),
- left_(left),
- right_(right) {
+ Expression* right, int pos)
+ : Expression(zone, pos), op_(op), left_(left), right_(right) {
DCHECK(Token::IsBinaryOp(op));
}
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
private:
Token::Value op_;
@@ -2116,17 +2201,21 @@ class CountOperation FINAL : public Expression {
return TypeFeedbackId(base_id() + 2);
}
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
CountOperation(Zone* zone, Token::Value op, bool is_prefix, Expression* expr,
- int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ int pos)
+ : Expression(zone, pos),
op_(op),
is_prefix_(is_prefix),
store_mode_(STANDARD_STORE),
expression_(expr) {}
- static int num_ids() { return 3; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 3;
private:
Token::Value op_;
@@ -2151,6 +2240,9 @@ class CompareOperation FINAL : public Expression {
TypeFeedbackId CompareOperationFeedbackId() const {
return TypeFeedbackId(base_id() + 0);
}
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
Type* combined_type() const { return combined_type_; }
void set_combined_type(Type* type) { combined_type_ = type; }
@@ -2161,8 +2253,8 @@ class CompareOperation FINAL : public Expression {
protected:
CompareOperation(Zone* zone, Token::Value op, Expression* left,
- Expression* right, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ Expression* right, int pos)
+ : Expression(zone, pos),
op_(op),
left_(left),
right_(right),
@@ -2170,8 +2262,8 @@ class CompareOperation FINAL : public Expression {
DCHECK(Token::IsCompareOp(op));
}
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 1;
private:
Token::Value op_;
@@ -2193,16 +2285,20 @@ class Conditional FINAL : public Expression {
BailoutId ThenId() const { return BailoutId(base_id() + 0); }
BailoutId ElseId() const { return BailoutId(base_id() + 1); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
protected:
Conditional(Zone* zone, Expression* condition, Expression* then_expression,
- Expression* else_expression, int position, IdGen* id_gen)
- : Expression(zone, position, num_ids(), id_gen),
+ Expression* else_expression, int position)
+ : Expression(zone, position),
condition_(condition),
then_expression_(then_expression),
else_expression_(else_expression) {}
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
private:
Expression* condition_;
@@ -2229,6 +2325,10 @@ class Assignment FINAL : public Expression {
BailoutId AssignmentId() const { return BailoutId(base_id() + 0); }
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
// Type feedback information.
TypeFeedbackId AssignmentFeedbackId() {
return TypeFeedbackId(base_id() + 1);
@@ -2251,10 +2351,10 @@ class Assignment FINAL : public Expression {
protected:
Assignment(Zone* zone, Token::Value op, Expression* target, Expression* value,
- int pos, IdGen* id_gen);
+ int pos);
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 2;
template<class Visitor>
void Init(Zone* zone, AstNodeFactory<Visitor>* factory) {
@@ -2329,8 +2429,8 @@ class Yield FINAL : public Expression {
protected:
Yield(Zone* zone, Expression* generator_object, Expression* expression,
- Kind yield_kind, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen),
+ Kind yield_kind, int pos)
+ : Expression(zone, pos),
generator_object_(generator_object),
expression_(expression),
yield_kind_(yield_kind),
@@ -2353,8 +2453,8 @@ class Throw FINAL : public Expression {
Expression* exception() const { return exception_; }
protected:
- Throw(Zone* zone, Expression* exception, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen), exception_(exception) {}
+ Throw(Zone* zone, Expression* exception, int pos)
+ : Expression(zone, pos), exception_(exception) {}
private:
Expression* exception_;
@@ -2507,8 +2607,8 @@ class FunctionLiteral FINAL : public Expression {
ParameterFlag has_duplicate_parameters,
IsFunctionFlag is_function,
IsParenthesizedFlag is_parenthesized, FunctionKind kind,
- int position, IdGen* id_gen)
- : Expression(zone, position, 0, id_gen),
+ int position)
+ : Expression(zone, position),
raw_name_(name),
scope_(scope),
body_(body),
@@ -2574,8 +2674,8 @@ class ClassLiteral FINAL : public Expression {
protected:
ClassLiteral(Zone* zone, const AstRawString* name, Expression* extends,
Expression* constructor, ZoneList<Property*>* properties,
- int start_position, int end_position, IdGen* id_gen)
- : Expression(zone, start_position, 0, id_gen),
+ int start_position, int end_position)
+ : Expression(zone, start_position),
raw_name_(name),
extends_(extends),
constructor_(constructor),
@@ -2600,8 +2700,8 @@ class NativeFunctionLiteral FINAL : public Expression {
protected:
NativeFunctionLiteral(Zone* zone, const AstRawString* name,
- v8::Extension* extension, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen), name_(name), extension_(extension) {}
+ v8::Extension* extension, int pos)
+ : Expression(zone, pos), name_(name), extension_(extension) {}
private:
const AstRawString* name_;
@@ -2614,8 +2714,7 @@ class ThisFunction FINAL : public Expression {
DECLARE_NODE_TYPE(ThisFunction)
protected:
- ThisFunction(Zone* zone, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen) {}
+ ThisFunction(Zone* zone, int pos) : Expression(zone, pos) {}
};
@@ -2629,6 +2728,10 @@ class SuperReference FINAL : public Expression {
return TypeFeedbackId(base_id() + 0);
}
+ void AllocateBailoutIdRange(IdGen* id_gen) {
+ InitializeBaseBailoutId(kBailoutIdCount, id_gen);
+ }
+
// Type feedback information.
virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; }
virtual void SetFirstFeedbackSlot(int slot) {
@@ -2642,15 +2745,15 @@ class SuperReference FINAL : public Expression {
}
protected:
- SuperReference(Zone* zone, VariableProxy* this_var, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ SuperReference(Zone* zone, VariableProxy* this_var, int pos)
+ : Expression(zone, pos),
this_var_(this_var),
homeobject_feedback_slot_(kInvalidFeedbackSlot) {
DCHECK(this_var->is_this());
}
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ int base_id() const { return leaf_base_id(); }
+ static const int kBailoutIdCount = Expression::kBailoutIdCount + 1;
private:
VariableProxy* this_var_;
@@ -3148,9 +3251,8 @@ class AstNullVisitor BASE_EMBEDDED {
template<class Visitor>
class AstNodeFactory FINAL BASE_EMBEDDED {
public:
- AstNodeFactory(Zone* zone, AstValueFactory* ast_value_factory,
- AstNode::IdGen* id_gen)
- : zone_(zone), ast_value_factory_(ast_value_factory), id_gen_(id_gen) {}
+ AstNodeFactory(Zone* zone, AstValueFactory* ast_value_factory)
+ : zone_(zone), ast_value_factory_(ast_value_factory) {}
Visitor* visitor() { return &visitor_; }
@@ -3228,14 +3330,14 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
int capacity,
bool is_initializer_block,
int pos) {
- Block* block = new (zone_)
- Block(zone_, labels, capacity, is_initializer_block, pos, id_gen_);
+ Block* block =
+ new (zone_) Block(zone_, labels, capacity, is_initializer_block, pos);
VISIT_AND_RETURN(Block, block)
}
#define STATEMENT_WITH_LABELS(NodeType) \
NodeType* New##NodeType(ZoneList<const AstRawString*>* labels, int pos) { \
- NodeType* stmt = new (zone_) NodeType(zone_, labels, pos, id_gen_); \
+ NodeType* stmt = new (zone_) NodeType(zone_, labels, pos); \
VISIT_AND_RETURN(NodeType, stmt); \
}
STATEMENT_WITH_LABELS(DoWhileStatement)
@@ -3249,13 +3351,11 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
int pos) {
switch (visit_mode) {
case ForEachStatement::ENUMERATE: {
- ForInStatement* stmt =
- new (zone_) ForInStatement(zone_, labels, pos, id_gen_);
+ ForInStatement* stmt = new (zone_) ForInStatement(zone_, labels, pos);
VISIT_AND_RETURN(ForInStatement, stmt);
}
case ForEachStatement::ITERATE: {
- ForOfStatement* stmt =
- new (zone_) ForOfStatement(zone_, labels, pos, id_gen_);
+ ForOfStatement* stmt = new (zone_) ForOfStatement(zone_, labels, pos);
VISIT_AND_RETURN(ForOfStatement, stmt);
}
}
@@ -3303,8 +3403,8 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Statement* then_statement,
Statement* else_statement,
int pos) {
- IfStatement* stmt = new (zone_) IfStatement(
- zone_, condition, then_statement, else_statement, pos, id_gen_);
+ IfStatement* stmt = new (zone_)
+ IfStatement(zone_, condition, then_statement, else_statement, pos);
VISIT_AND_RETURN(IfStatement, stmt)
}
@@ -3329,8 +3429,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
}
DebuggerStatement* NewDebuggerStatement(int pos) {
- DebuggerStatement* stmt =
- new (zone_) DebuggerStatement(zone_, pos, id_gen_);
+ DebuggerStatement* stmt = new (zone_) DebuggerStatement(zone_, pos);
VISIT_AND_RETURN(DebuggerStatement, stmt)
}
@@ -3340,64 +3439,63 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
CaseClause* NewCaseClause(
Expression* label, ZoneList<Statement*>* statements, int pos) {
- CaseClause* clause =
- new (zone_) CaseClause(zone_, label, statements, pos, id_gen_);
+ CaseClause* clause = new (zone_) CaseClause(zone_, label, statements, pos);
VISIT_AND_RETURN(CaseClause, clause)
}
Literal* NewStringLiteral(const AstRawString* string, int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewString(string), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewString(string), pos);
VISIT_AND_RETURN(Literal, lit)
}
// A JavaScript symbol (ECMA-262 edition 6).
Literal* NewSymbolLiteral(const char* name, int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewSymbol(name), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewSymbol(name), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewNumberLiteral(double number, int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewNumber(number), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewNumber(number), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewSmiLiteral(int number, int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewSmi(number), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewSmi(number), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewBooleanLiteral(bool b, int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewBoolean(b), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewBoolean(b), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewStringListLiteral(ZoneList<const AstRawString*>* strings,
int pos) {
- Literal* lit = new (zone_) Literal(
- zone_, ast_value_factory_->NewStringList(strings), pos, id_gen_);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewStringList(strings), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewNullLiteral(int pos) {
Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewNull(), pos, id_gen_);
+ new (zone_) Literal(zone_, ast_value_factory_->NewNull(), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewUndefinedLiteral(int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewUndefined(), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewUndefined(), pos);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewTheHoleLiteral(int pos) {
- Literal* lit = new (zone_)
- Literal(zone_, ast_value_factory_->NewTheHole(), pos, id_gen_);
+ Literal* lit =
+ new (zone_) Literal(zone_, ast_value_factory_->NewTheHole(), pos);
VISIT_AND_RETURN(Literal, lit)
}
@@ -3407,9 +3505,9 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
int boilerplate_properties,
bool has_function,
int pos) {
- ObjectLiteral* lit = new (zone_)
- ObjectLiteral(zone_, properties, literal_index, boilerplate_properties,
- has_function, pos, id_gen_);
+ ObjectLiteral* lit =
+ new (zone_) ObjectLiteral(zone_, properties, literal_index,
+ boilerplate_properties, has_function, pos);
VISIT_AND_RETURN(ObjectLiteral, lit)
}
@@ -3433,8 +3531,8 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
const AstRawString* flags,
int literal_index,
int pos) {
- RegExpLiteral* lit = new (zone_)
- RegExpLiteral(zone_, pattern, flags, literal_index, pos, id_gen_);
+ RegExpLiteral* lit =
+ new (zone_) RegExpLiteral(zone_, pattern, flags, literal_index, pos);
VISIT_AND_RETURN(RegExpLiteral, lit);
}
@@ -3442,13 +3540,13 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
int literal_index,
int pos) {
ArrayLiteral* lit =
- new (zone_) ArrayLiteral(zone_, values, literal_index, pos, id_gen_);
+ new (zone_) ArrayLiteral(zone_, values, literal_index, pos);
VISIT_AND_RETURN(ArrayLiteral, lit)
}
VariableProxy* NewVariableProxy(Variable* var,
int pos = RelocInfo::kNoPosition) {
- VariableProxy* proxy = new (zone_) VariableProxy(zone_, var, pos, id_gen_);
+ VariableProxy* proxy = new (zone_) VariableProxy(zone_, var, pos);
VISIT_AND_RETURN(VariableProxy, proxy)
}
@@ -3456,13 +3554,13 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
bool is_this,
Interface* interface = Interface::NewValue(),
int position = RelocInfo::kNoPosition) {
- VariableProxy* proxy = new (zone_)
- VariableProxy(zone_, name, is_this, interface, position, id_gen_);
+ VariableProxy* proxy =
+ new (zone_) VariableProxy(zone_, name, is_this, interface, position);
VISIT_AND_RETURN(VariableProxy, proxy)
}
Property* NewProperty(Expression* obj, Expression* key, int pos) {
- Property* prop = new (zone_) Property(zone_, obj, key, pos, id_gen_);
+ Property* prop = new (zone_) Property(zone_, obj, key, pos);
VISIT_AND_RETURN(Property, prop)
}
@@ -3475,9 +3573,9 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Literal* constructor =
NewStringLiteral(ast_value_factory_->constructor_string(), pos);
Property* superConstructor = NewProperty(super_ref, constructor, pos);
- call = new (zone_) Call(zone_, superConstructor, arguments, pos, id_gen_);
+ call = new (zone_) Call(zone_, superConstructor, arguments, pos);
} else {
- call = new (zone_) Call(zone_, expression, arguments, pos, id_gen_);
+ call = new (zone_) Call(zone_, expression, arguments, pos);
}
VISIT_AND_RETURN(Call, call)
}
@@ -3485,8 +3583,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
CallNew* NewCallNew(Expression* expression,
ZoneList<Expression*>* arguments,
int pos) {
- CallNew* call =
- new (zone_) CallNew(zone_, expression, arguments, pos, id_gen_);
+ CallNew* call = new (zone_) CallNew(zone_, expression, arguments, pos);
VISIT_AND_RETURN(CallNew, call)
}
@@ -3495,7 +3592,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
ZoneList<Expression*>* arguments,
int pos) {
CallRuntime* call =
- new (zone_) CallRuntime(zone_, name, function, arguments, pos, id_gen_);
+ new (zone_) CallRuntime(zone_, name, function, arguments, pos);
VISIT_AND_RETURN(CallRuntime, call)
}
@@ -3503,7 +3600,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Expression* expression,
int pos) {
UnaryOperation* node =
- new (zone_) UnaryOperation(zone_, op, expression, pos, id_gen_);
+ new (zone_) UnaryOperation(zone_, op, expression, pos);
VISIT_AND_RETURN(UnaryOperation, node)
}
@@ -3512,7 +3609,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Expression* right,
int pos) {
BinaryOperation* node =
- new (zone_) BinaryOperation(zone_, op, left, right, pos, id_gen_);
+ new (zone_) BinaryOperation(zone_, op, left, right, pos);
VISIT_AND_RETURN(BinaryOperation, node)
}
@@ -3521,7 +3618,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Expression* expr,
int pos) {
CountOperation* node =
- new (zone_) CountOperation(zone_, op, is_prefix, expr, pos, id_gen_);
+ new (zone_) CountOperation(zone_, op, is_prefix, expr, pos);
VISIT_AND_RETURN(CountOperation, node)
}
@@ -3530,7 +3627,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Expression* right,
int pos) {
CompareOperation* node =
- new (zone_) CompareOperation(zone_, op, left, right, pos, id_gen_);
+ new (zone_) CompareOperation(zone_, op, left, right, pos);
VISIT_AND_RETURN(CompareOperation, node)
}
@@ -3539,7 +3636,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Expression* else_expression,
int position) {
Conditional* cond = new (zone_) Conditional(
- zone_, condition, then_expression, else_expression, position, id_gen_);
+ zone_, condition, then_expression, else_expression, position);
VISIT_AND_RETURN(Conditional, cond)
}
@@ -3547,8 +3644,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Expression* target,
Expression* value,
int pos) {
- Assignment* assign =
- new (zone_) Assignment(zone_, op, target, value, pos, id_gen_);
+ Assignment* assign = new (zone_) Assignment(zone_, op, target, value, pos);
assign->Init(zone_, this);
VISIT_AND_RETURN(Assignment, assign)
}
@@ -3558,13 +3654,13 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Yield::Kind yield_kind,
int pos) {
if (!expression) expression = NewUndefinedLiteral(pos);
- Yield* yield = new (zone_)
- Yield(zone_, generator_object, expression, yield_kind, pos, id_gen_);
+ Yield* yield =
+ new (zone_) Yield(zone_, generator_object, expression, yield_kind, pos);
VISIT_AND_RETURN(Yield, yield)
}
Throw* NewThrow(Expression* exception, int pos) {
- Throw* t = new (zone_) Throw(zone_, exception, pos, id_gen_);
+ Throw* t = new (zone_) Throw(zone_, exception, pos);
VISIT_AND_RETURN(Throw, t)
}
@@ -3580,8 +3676,8 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
FunctionLiteral* lit = new (zone_) FunctionLiteral(
zone_, name, ast_value_factory, scope, body, materialized_literal_count,
expected_property_count, handler_count, parameter_count, function_type,
- has_duplicate_parameters, is_function, is_parenthesized, kind, position,
- id_gen_);
+ has_duplicate_parameters, is_function, is_parenthesized, kind,
+ position);
// Top-level literal doesn't count for the AST's properties.
if (is_function == FunctionLiteral::kIsFunction) {
visitor_.VisitFunctionLiteral(lit);
@@ -3595,7 +3691,7 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
int start_position, int end_position) {
ClassLiteral* lit =
new (zone_) ClassLiteral(zone_, name, extends, constructor, properties,
- start_position, end_position, id_gen_);
+ start_position, end_position);
VISIT_AND_RETURN(ClassLiteral, lit)
}
@@ -3603,18 +3699,17 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
v8::Extension* extension,
int pos) {
NativeFunctionLiteral* lit =
- new (zone_) NativeFunctionLiteral(zone_, name, extension, pos, id_gen_);
+ new (zone_) NativeFunctionLiteral(zone_, name, extension, pos);
VISIT_AND_RETURN(NativeFunctionLiteral, lit)
}
ThisFunction* NewThisFunction(int pos) {
- ThisFunction* fun = new (zone_) ThisFunction(zone_, pos, id_gen_);
+ ThisFunction* fun = new (zone_) ThisFunction(zone_, pos);
VISIT_AND_RETURN(ThisFunction, fun)
}
SuperReference* NewSuperReference(VariableProxy* this_var, int pos) {
- SuperReference* super =
- new (zone_) SuperReference(zone_, this_var, pos, id_gen_);
+ SuperReference* super = new (zone_) SuperReference(zone_, this_var, pos);
VISIT_AND_RETURN(SuperReference, super);
}
@@ -3624,7 +3719,6 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
Zone* zone_;
Visitor visitor_;
AstValueFactory* ast_value_factory_;
- AstNode::IdGen* id_gen_;
};
« no previous file with comments | « BUILD.gn ('k') | src/ast.cc » ('j') | src/ast-numbering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698