class AstNode: public ZoneObject {
public:
+ // For generating IDs for AstNodes.
+ class IdGen {
+ public:
+ IdGen() : id_(BailoutId::FirstUsable().ToInt()) {}
+
+ int ReserveIdRange(int n) {
+ int tmp = id_;
+ id_ += n;
+ return tmp;
+ }
+
+ private:
+ int id_;
+
+ DISALLOW_COPY_AND_ASSIGN(IdGen);
+ };
+
#define DECLARE_TYPE_ENUM(type) k##type,
enum NodeType {
AST_NODE_LIST(DECLARE_TYPE_ENUM)
virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
byte to_boolean_types() const { return to_boolean_types_; }
- void set_base_id(int id) { base_id_ = id; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId id() const { return BailoutId(local_id(0)); }
- TypeFeedbackId test_id() const { return TypeFeedbackId(local_id(1)); }
+ BailoutId id() const { return BailoutId(base_id() + 0); }
+ TypeFeedbackId test_id() const { return TypeFeedbackId(base_id() + 1); }
protected:
- Expression(Zone* zone, int pos)
+ Expression(Zone* zone, int pos, int num_ids_needed_by_subclass, IdGen* id_gen)
: AstNode(pos),
- base_id_(BailoutId::None().ToInt()),
+ base_id_(
+ id_gen->ReserveIdRange(num_ids_needed_by_subclass + num_ids())),
bounds_(Bounds::Unbounded(zone)),
is_parenthesized_(false),
is_multi_parenthesized_(false) {}
- static int parent_num_ids() { return 0; }
void set_to_boolean_types(byte types) { to_boolean_types_ = types; }
- int base_id() const {
- DCHECK(!BailoutId(base_id_).IsNone());
- return base_id_;
- }
+ static int num_ids() { return 2; }
+ int base_id() const { return base_id_; }
private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
-
- int base_id_;
+ const int base_id_;
Bounds bounds_;
byte to_boolean_types_;
bool is_parenthesized_ : 1;
return breakable_type_ == TARGET_FOR_ANONYMOUS;
}
- void set_base_id(int id) { base_id_ = id; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId EntryId() const { return BailoutId(local_id(0)); }
- BailoutId ExitId() const { return BailoutId(local_id(1)); }
+ BailoutId EntryId() const { return BailoutId(base_id() + 0); }
+ BailoutId ExitId() const { return BailoutId(base_id() + 1); }
protected:
BreakableStatement(Zone* zone, ZoneList<const AstRawString*>* labels,
- BreakableType breakable_type, int position)
+ BreakableType breakable_type, int position,
+ int num_ids_needed_by_subclass, IdGen* id_gen)
: Statement(zone, position),
labels_(labels),
breakable_type_(breakable_type),
- base_id_(BailoutId::None().ToInt()) {
+ base_id_(
+ id_gen->ReserveIdRange(num_ids_needed_by_subclass + num_ids())) {
DCHECK(labels == NULL || labels->length() > 0);
}
- static int parent_num_ids() { return 0; }
- int base_id() const {
- DCHECK(!BailoutId(base_id_).IsNone());
- return base_id_;
- }
+ static int num_ids() { return 2; }
+ int base_id() const { return base_id_; }
private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
-
ZoneList<const AstRawString*>* labels_;
BreakableType breakable_type_;
Label break_target_;
- int base_id_;
+ const int base_id_;
};
ZoneList<Statement*>* statements() { return &statements_; }
bool is_initializer_block() const { return is_initializer_block_; }
- static int num_ids() { return parent_num_ids() + 1; }
- BailoutId DeclsId() const { return BailoutId(local_id(0)); }
+ BailoutId DeclsId() const { return BailoutId(base_id() + 0); }
virtual bool IsJump() const OVERRIDE {
return !statements_.is_empty() && statements_.last()->IsJump()
protected:
Block(Zone* zone, ZoneList<const AstRawString*>* labels, int capacity,
- bool is_initializer_block, int pos)
- : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos),
+ bool is_initializer_block, int pos, IdGen* id_gen)
+ : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos, num_ids(),
+ id_gen),
statements_(capacity, zone),
is_initializer_block_(is_initializer_block),
scope_(NULL) {}
- static int parent_num_ids() { return BreakableStatement::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const {
+ return BreakableStatement::base_id() + BreakableStatement::num_ids();
+ }
+ private:
ZoneList<Statement*> statements_;
bool is_initializer_block_;
Scope* scope_;
Statement* body() const { return body_; }
- static int num_ids() { return parent_num_ids() + 1; }
- BailoutId OsrEntryId() const { return BailoutId(local_id(0)); }
+ BailoutId OsrEntryId() const { return BailoutId(base_id() + 0); }
virtual BailoutId ContinueId() const = 0;
virtual BailoutId StackCheckId() const = 0;
Label* continue_target() { return &continue_target_; }
protected:
- IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
+ 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),
body_(NULL) {}
- static int parent_num_ids() { return BreakableStatement::num_ids(); }
- void Initialize(Statement* body) { body_ = body; }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ void Initialize(Statement* body) {
+ body_ = body;
+ }
+
+ static int num_ids() { return 1; }
+ int base_id() const {
+ return BreakableStatement::base_id() + BreakableStatement::num_ids();
+ }
+ private:
Statement* body_;
Label continue_target_;
};
Expression* cond() const { return cond_; }
- static int num_ids() { return parent_num_ids() + 2; }
virtual BailoutId ContinueId() const OVERRIDE {
- return BailoutId(local_id(0));
+ return BailoutId(base_id() + 0);
}
virtual BailoutId StackCheckId() const OVERRIDE { return BackEdgeId(); }
- BailoutId BackEdgeId() const { return BailoutId(local_id(1)); }
+ BailoutId BackEdgeId() const { return BailoutId(base_id() + 1); }
protected:
- DoWhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : IterationStatement(zone, labels, pos), cond_(NULL) {}
- static int parent_num_ids() { return IterationStatement::num_ids(); }
+ DoWhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
+ IdGen* id_gen)
+ : IterationStatement(zone, labels, pos, num_ids(), id_gen), cond_(NULL) {}
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const {
+ return IterationStatement::base_id() + IterationStatement::num_ids();
+ }
+ private:
Expression* cond_;
};
may_have_function_literal_ = value;
}
- static int num_ids() { return parent_num_ids() + 1; }
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
- BailoutId BodyId() const { return BailoutId(local_id(0)); }
+ BailoutId BodyId() const { return BailoutId(base_id() + 0); }
protected:
- WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : IterationStatement(zone, labels, pos),
+ WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
+ IdGen* id_gen)
+ : IterationStatement(zone, labels, pos, num_ids(), id_gen),
cond_(NULL),
may_have_function_literal_(true) {}
- static int parent_num_ids() { return IterationStatement::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const {
+ return IterationStatement::base_id() + IterationStatement::num_ids();
+ }
+ private:
Expression* cond_;
// True if there is a function literal subexpression in the condition.
may_have_function_literal_ = value;
}
- static int num_ids() { return parent_num_ids() + 2; }
virtual BailoutId ContinueId() const OVERRIDE {
- return BailoutId(local_id(0));
+ return BailoutId(base_id() + 0);
}
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
- BailoutId BodyId() const { return BailoutId(local_id(1)); }
+ BailoutId BodyId() const { return BailoutId(base_id() + 1); }
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)
- : IterationStatement(zone, labels, pos),
+ ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
+ IdGen* id_gen)
+ : IterationStatement(zone, labels, pos, num_ids(), id_gen),
init_(NULL),
cond_(NULL),
next_(NULL),
may_have_function_literal_(true),
loop_variable_(NULL) {}
- static int parent_num_ids() { return IterationStatement::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const {
+ return IterationStatement::base_id() + IterationStatement::num_ids();
+ }
+ private:
Statement* init_;
Expression* cond_;
Statement* next_;
Expression* subject() const { return subject_; }
protected:
- ForEachStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : IterationStatement(zone, labels, pos), each_(NULL), subject_(NULL) {}
+ 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) {}
private:
Expression* each_;
ForInType for_in_type() const { return for_in_type_; }
void set_for_in_type(ForInType type) { for_in_type_ = type; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId BodyId() const { return BailoutId(local_id(0)); }
- BailoutId PrepareId() const { return BailoutId(local_id(1)); }
+ BailoutId BodyId() const { return BailoutId(base_id() + 0); }
+ BailoutId PrepareId() const { return BailoutId(base_id() + 1); }
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
protected:
- ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : ForEachStatement(zone, labels, pos),
+ ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
+ IdGen* id_gen)
+ : ForEachStatement(zone, labels, pos, num_ids(), id_gen),
for_in_type_(SLOW_FOR_IN),
for_in_feedback_slot_(FeedbackVectorSlot::Invalid()) {}
- static int parent_num_ids() { return ForEachStatement::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const {
+ return ForEachStatement::base_id() + ForEachStatement::num_ids();
+ }
+ private:
ForInType for_in_type_;
FeedbackVectorSlot for_in_feedback_slot_;
};
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BackEdgeId(); }
- static int num_ids() { return parent_num_ids() + 1; }
- BailoutId BackEdgeId() const { return BailoutId(local_id(0)); }
+ BailoutId BackEdgeId() const { return BailoutId(base_id() + 0); }
protected:
- ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : ForEachStatement(zone, labels, pos),
+ ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
+ IdGen* id_gen)
+ : ForEachStatement(zone, labels, pos, num_ids(), id_gen),
assign_iterator_(NULL),
next_result_(NULL),
result_done_(NULL),
assign_each_(NULL) {}
- static int parent_num_ids() { return ForEachStatement::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const {
+ return ForEachStatement::base_id() + ForEachStatement::num_ids();
+ }
+ private:
Expression* assign_iterator_;
Expression* next_result_;
Expression* result_done_;
Label* body_target() { return &body_target_; }
ZoneList<Statement*>* statements() const { return statements_; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId EntryId() const { return BailoutId(local_id(0)); }
- TypeFeedbackId CompareId() { return TypeFeedbackId(local_id(1)); }
+ BailoutId EntryId() const { return BailoutId(base_id() + 0); }
+ TypeFeedbackId CompareId() { return TypeFeedbackId(base_id() + 1); }
Type* compare_type() { return compare_type_; }
void set_compare_type(Type* type) { compare_type_ = type; }
- protected:
- static int parent_num_ids() { return Expression::num_ids(); }
-
private:
CaseClause(Zone* zone, Expression* label, ZoneList<Statement*>* statements,
- int pos);
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ int pos, IdGen* id_gen);
+
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
Expression* label_;
Label body_target_;
ZoneList<CaseClause*>* cases() const { return cases_; }
protected:
- SwitchStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
- : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
+ SwitchStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
+ IdGen* id_gen)
+ : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos, 0, id_gen),
tag_(NULL),
cases_(NULL) {}
&& HasElseStatement() && else_statement()->IsJump();
}
- void set_base_id(int id) { base_id_ = id; }
- static int num_ids() { return parent_num_ids() + 3; }
- BailoutId IfId() const { return BailoutId(local_id(0)); }
- BailoutId ThenId() const { return BailoutId(local_id(1)); }
- BailoutId ElseId() const { return BailoutId(local_id(2)); }
+ BailoutId IfId() const { return BailoutId(base_id() + 0); }
+ BailoutId ThenId() const { return BailoutId(base_id() + 1); }
+ BailoutId ElseId() const { return BailoutId(base_id() + 2); }
protected:
IfStatement(Zone* zone, Expression* condition, Statement* then_statement,
- Statement* else_statement, int pos)
+ Statement* else_statement, int pos, IdGen* id_gen)
: Statement(zone, pos),
condition_(condition),
then_statement_(then_statement),
else_statement_(else_statement),
- base_id_(BailoutId::None().ToInt()) {}
- static int parent_num_ids() { return 0; }
+ base_id_(id_gen->ReserveIdRange(num_ids())) {}
- int base_id() const {
- DCHECK(!BailoutId(base_id_).IsNone());
- return base_id_;
- }
+ static int num_ids() { return 3; }
+ int base_id() const { return base_id_; }
private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
-
Expression* condition_;
Statement* then_statement_;
Statement* else_statement_;
- int base_id_;
+ const int base_id_;
};
public:
DECLARE_NODE_TYPE(DebuggerStatement)
- void set_base_id(int id) { base_id_ = id; }
- static int num_ids() { return parent_num_ids() + 1; }
- BailoutId DebugBreakId() const { return BailoutId(local_id(0)); }
+ BailoutId DebugBreakId() const { return BailoutId(base_id() + 0); }
protected:
- explicit DebuggerStatement(Zone* zone, int pos)
- : Statement(zone, pos), base_id_(BailoutId::None().ToInt()) {}
- static int parent_num_ids() { return 0; }
+ explicit DebuggerStatement(Zone* zone, int pos, IdGen* id_gen)
+ : Statement(zone, pos), base_id_(id_gen->ReserveIdRange(num_ids())) {}
- int base_id() const {
- DCHECK(!BailoutId(base_id_).IsNone());
- return base_id_;
- }
+ static int num_ids() { return 1; }
+ int base_id() const { return base_id_; }
private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
-
- int base_id_;
+ const int base_id_;
};
uint32_t Hash();
static bool Match(void* literal1, void* literal2);
- static int num_ids() { return parent_num_ids() + 1; }
TypeFeedbackId LiteralFeedbackId() const {
- return TypeFeedbackId(local_id(0));
+ return TypeFeedbackId(base_id() + 0);
}
protected:
- Literal(Zone* zone, const AstValue* value, int position)
- : Expression(zone, position), value_(value) {}
- static int parent_num_ids() { return Expression::num_ids(); }
+ Literal(Zone* zone, const AstValue* value, int position, IdGen* id_gen)
+ : Expression(zone, position, num_ids(), id_gen), value_(value) {}
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
const AstValue* value_;
};
}
protected:
- MaterializedLiteral(Zone* zone, int literal_index, int pos)
- : Expression(zone, pos),
+ 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),
literal_index_(literal_index),
is_simple_(false),
depth_(0) {}
protected:
ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index,
- int boilerplate_properties, bool has_function, int pos)
- : MaterializedLiteral(zone, literal_index, pos),
+ int boilerplate_properties, bool has_function, int pos,
+ IdGen* id_gen)
+ : MaterializedLiteral(zone, literal_index, pos, 0, id_gen),
properties_(properties),
boilerplate_properties_(boilerplate_properties),
fast_elements_(false),
protected:
RegExpLiteral(Zone* zone, const AstRawString* pattern,
- const AstRawString* flags, int literal_index, int pos)
- : MaterializedLiteral(zone, literal_index, pos),
+ const AstRawString* flags, int literal_index, int pos,
+ IdGen* id_gen)
+ : MaterializedLiteral(zone, literal_index, pos, 0, id_gen),
pattern_(pattern),
flags_(flags) {
set_depth(1);
Handle<FixedArray> constant_elements() const { return constant_elements_; }
ZoneList<Expression*>* values() const { return values_; }
- // Unlike other AST nodes, this number of bailout IDs allocated for an
- // ArrayLiteral can vary, so num_ids() is not a static method.
- int num_ids() const { return parent_num_ids() + values()->length(); }
-
// Return an AST id for an element that is used in simulate instructions.
- BailoutId GetIdForElement(int i) { return BailoutId(local_id(i)); }
+ BailoutId GetIdForElement(int i) { return BailoutId(base_id() + i); }
// Populate the constant elements fixed array.
void BuildConstantElements(Isolate* isolate);
protected:
ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, int literal_index,
- int pos)
- : MaterializedLiteral(zone, literal_index, pos), values_(values) {}
- static int parent_num_ids() { return MaterializedLiteral::num_ids(); }
+ int pos, IdGen* id_gen)
+ : MaterializedLiteral(zone, literal_index, pos, num_ids(values), id_gen),
+ values_(values) {}
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids(ZoneList<Expression*>* values) { return values->length(); }
+ int base_id() const {
+ return MaterializedLiteral::base_id() + MaterializedLiteral::num_ids();
+ }
+ private:
Handle<FixedArray> constant_elements_;
ZoneList<Expression*>* values_;
};
}
protected:
- VariableProxy(Zone* zone, Variable* var, int position);
+ VariableProxy(Zone* zone, Variable* var, int position, IdGen* id_gen);
VariableProxy(Zone* zone, const AstRawString* name, bool is_this,
- Interface* interface, int position);
+ Interface* interface, int position, IdGen* id_gen);
bool is_this_ : 1;
bool is_assigned_ : 1;
Expression* obj() const { return obj_; }
Expression* key() const { return key_; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId LoadId() const { return BailoutId(local_id(0)); }
- TypeFeedbackId PropertyFeedbackId() { return TypeFeedbackId(local_id(1)); }
+ BailoutId LoadId() const { return BailoutId(base_id() + 0); }
+ TypeFeedbackId PropertyFeedbackId() { return TypeFeedbackId(base_id() + 1); }
+
bool IsStringAccess() const { return is_string_access_; }
}
protected:
- Property(Zone* zone, Expression* obj, Expression* key, int pos)
- : Expression(zone, pos),
+ Property(Zone* zone, Expression* obj, Expression* key, int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
is_for_call_(false),
is_uninitialized_(false),
is_string_access_(false),
property_feedback_slot_(FeedbackVectorICSlot::Invalid()),
obj_(obj),
key_(key) {}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
bool is_for_call_ : 1;
bool is_uninitialized_ : 1;
bool is_string_access_ : 1;
}
bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupIterator* it);
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId ReturnId() const { return BailoutId(local_id(0)); }
- BailoutId EvalOrLookupId() const { return BailoutId(local_id(1)); }
+ BailoutId ReturnId() const { return BailoutId(base_id() + 0); }
+ BailoutId EvalOrLookupId() const { return BailoutId(base_id() + 1); }
enum CallType {
POSSIBLY_EVAL_CALL,
protected:
Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
- int pos)
- : Expression(zone, pos),
+ int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
call_feedback_slot_(FeedbackVectorICSlot::Invalid()),
expression_(expression),
arguments_(arguments) {
expression->AsProperty()->mark_for_call();
}
}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
FeedbackVectorICSlot call_feedback_slot_;
Expression* expression_;
ZoneList<Expression*>* arguments_;
return allocation_site_;
}
- static int num_ids() { return parent_num_ids() + 1; }
static int feedback_slots() { return 1; }
- BailoutId ReturnId() const { return BailoutId(local_id(0)); }
+
+ BailoutId ReturnId() const { return BailoutId(base_id() + 0); }
protected:
CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
- int pos)
- : Expression(zone, pos),
+ int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
expression_(expression),
arguments_(arguments),
is_monomorphic_(false),
callnew_feedback_slot_(FeedbackVectorSlot::Invalid()) {}
- static int parent_num_ids() { return Expression::num_ids(); }
+ static int num_ids() { return 1; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
-
Expression* expression_;
ZoneList<Expression*>* arguments_;
bool is_monomorphic_;
return callruntime_feedback_slot_;
}
- static int num_ids() { return parent_num_ids() + 1; }
TypeFeedbackId CallRuntimeFeedbackId() const {
- return TypeFeedbackId(local_id(0));
+ return TypeFeedbackId(base_id() + 0);
}
protected:
CallRuntime(Zone* zone, const AstRawString* name,
const Runtime::Function* function,
- ZoneList<Expression*>* arguments, int pos)
- : Expression(zone, pos),
+ ZoneList<Expression*>* arguments, int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
raw_name_(name),
function_(function),
arguments_(arguments),
callruntime_feedback_slot_(FeedbackVectorICSlot::Invalid()) {}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
const AstRawString* raw_name_;
const Runtime::Function* function_;
ZoneList<Expression*>* arguments_;
// For unary not (Token::NOT), the AST ids where true and false will
// actually be materialized, respectively.
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId MaterializeTrueId() const { return BailoutId(local_id(0)); }
- BailoutId MaterializeFalseId() const { return BailoutId(local_id(1)); }
+ BailoutId MaterializeTrueId() const { return BailoutId(base_id() + 0); }
+ BailoutId MaterializeFalseId() const { return BailoutId(base_id() + 1); }
virtual void RecordToBooleanTypeFeedback(
TypeFeedbackOracle* oracle) OVERRIDE;
protected:
- UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int pos)
- : Expression(zone, pos), op_(op), expression_(expression) {
+ UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int pos,
+ IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
+ op_(op),
+ expression_(expression) {
DCHECK(Token::IsUnaryOp(op));
}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
Token::Value op_;
Expression* expression_;
};
// The short-circuit logical operations need an AST ID for their
// right-hand subexpression.
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId RightId() const { return BailoutId(local_id(0)); }
+ BailoutId RightId() const { return BailoutId(base_id() + 0); }
TypeFeedbackId BinaryOperationFeedbackId() const {
- return TypeFeedbackId(local_id(1));
+ return TypeFeedbackId(base_id() + 1);
}
Maybe<int> fixed_right_arg() const {
return has_fixed_right_arg_ ? Maybe<int>(fixed_right_arg_value_)
protected:
BinaryOperation(Zone* zone, Token::Value op, Expression* left,
- Expression* right, int pos)
- : Expression(zone, pos),
+ Expression* right, int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
op_(static_cast<byte>(op)),
left_(left),
right_(right) {
DCHECK(Token::IsBinaryOp(op));
}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
const byte op_; // actually Token::Value
// TODO(rossberg): the fixed arg should probably be represented as a Constant
// type for the RHS. Currenty it's actually a Maybe<int>
void set_store_mode(KeyedAccessStoreMode mode) { store_mode_ = mode; }
void set_type(Type* type) { type_ = type; }
- static int num_ids() { return parent_num_ids() + 3; }
- BailoutId AssignmentId() const { return BailoutId(local_id(0)); }
+ BailoutId AssignmentId() const { return BailoutId(base_id() + 0); }
TypeFeedbackId CountBinOpFeedbackId() const {
- return TypeFeedbackId(local_id(1));
+ return TypeFeedbackId(base_id() + 1);
}
TypeFeedbackId CountStoreFeedbackId() const {
- return TypeFeedbackId(local_id(2));
+ return TypeFeedbackId(base_id() + 2);
}
protected:
CountOperation(Zone* zone, Token::Value op, bool is_prefix, Expression* expr,
- int pos)
- : Expression(zone, pos),
+ int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
op_(op),
is_prefix_(is_prefix),
key_type_(ELEMENT),
store_mode_(STANDARD_STORE),
expression_(expr) {}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 3; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
Token::Value op_;
bool is_prefix_ : 1;
IcCheckType key_type_ : 1;
Expression* right() const { return right_; }
// Type feedback information.
- static int num_ids() { return parent_num_ids() + 1; }
TypeFeedbackId CompareOperationFeedbackId() const {
- return TypeFeedbackId(local_id(0));
+ return TypeFeedbackId(base_id() + 0);
}
Type* combined_type() const { return combined_type_; }
void set_combined_type(Type* type) { combined_type_ = type; }
protected:
CompareOperation(Zone* zone, Token::Value op, Expression* left,
- Expression* right, int pos)
- : Expression(zone, pos),
+ Expression* right, int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
op_(op),
left_(left),
right_(right),
combined_type_(Type::None(zone)) {
DCHECK(Token::IsCompareOp(op));
}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
Token::Value op_;
Expression* left_;
Expression* right_;
Expression* then_expression() const { return then_expression_; }
Expression* else_expression() const { return else_expression_; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId ThenId() const { return BailoutId(local_id(0)); }
- BailoutId ElseId() const { return BailoutId(local_id(1)); }
+ BailoutId ThenId() const { return BailoutId(base_id() + 0); }
+ BailoutId ElseId() const { return BailoutId(base_id() + 1); }
protected:
Conditional(Zone* zone, Expression* condition, Expression* then_expression,
- Expression* else_expression, int position)
- : Expression(zone, position),
+ Expression* else_expression, int position, IdGen* id_gen)
+ : Expression(zone, position, num_ids(), id_gen),
condition_(condition),
then_expression_(then_expression),
else_expression_(else_expression) {}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
Expression* condition_;
Expression* then_expression_;
Expression* else_expression_;
// This check relies on the definition order of token in token.h.
bool is_compound() const { return op() > Token::ASSIGN; }
- static int num_ids() { return parent_num_ids() + 2; }
- BailoutId AssignmentId() const { return BailoutId(local_id(0)); }
+ BailoutId AssignmentId() const { return BailoutId(base_id() + 0); }
// Type feedback information.
- TypeFeedbackId AssignmentFeedbackId() { return TypeFeedbackId(local_id(1)); }
+ TypeFeedbackId AssignmentFeedbackId() {
+ return TypeFeedbackId(base_id() + 1);
+ }
virtual bool IsMonomorphic() OVERRIDE {
return receiver_types_.length() == 1;
}
protected:
Assignment(Zone* zone, Token::Value op, Expression* target, Expression* value,
- int pos);
- static int parent_num_ids() { return Expression::num_ids(); }
+ int pos, IdGen* id_gen);
+
+ static int num_ids() { return 2; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
- template <class Visitor>
- void Init(AstNodeFactory<Visitor>* factory) {
+ template<class Visitor>
+ void Init(Zone* zone, AstNodeFactory<Visitor>* factory) {
DCHECK(Token::IsAssignmentOp(op_));
if (is_compound()) {
binary_operation_ = factory->NewBinaryOperation(
}
private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
-
bool is_uninitialized_ : 1;
IcCheckType key_type_ : 1;
KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed,
protected:
Yield(Zone* zone, Expression* generator_object, Expression* expression,
- Kind yield_kind, int pos)
- : Expression(zone, pos),
+ Kind yield_kind, int pos, IdGen* id_gen)
+ : Expression(zone, pos, 0, id_gen),
generator_object_(generator_object),
expression_(expression),
yield_kind_(yield_kind),
Expression* exception() const { return exception_; }
protected:
- Throw(Zone* zone, Expression* exception, int pos)
- : Expression(zone, pos), exception_(exception) {}
+ Throw(Zone* zone, Expression* exception, int pos, IdGen* id_gen)
+ : Expression(zone, pos, 0, id_gen), exception_(exception) {}
private:
Expression* exception_;
ParameterFlag has_duplicate_parameters,
IsFunctionFlag is_function,
IsParenthesizedFlag is_parenthesized, FunctionKind kind,
- int position)
- : Expression(zone, position),
+ int position, IdGen* id_gen)
+ : Expression(zone, position, 0, id_gen),
raw_name_(name),
scope_(scope),
body_(body),
protected:
ClassLiteral(Zone* zone, const AstRawString* name, Expression* extends,
Expression* constructor, ZoneList<Property*>* properties,
- int start_position, int end_position)
- : Expression(zone, start_position),
+ int start_position, int end_position, IdGen* id_gen)
+ : Expression(zone, start_position, 0, id_gen),
raw_name_(name),
extends_(extends),
constructor_(constructor),
protected:
NativeFunctionLiteral(Zone* zone, const AstRawString* name,
- v8::Extension* extension, int pos)
- : Expression(zone, pos), name_(name), extension_(extension) {}
+ v8::Extension* extension, int pos, IdGen* id_gen)
+ : Expression(zone, pos, 0, id_gen), name_(name), extension_(extension) {}
private:
const AstRawString* name_;
DECLARE_NODE_TYPE(ThisFunction)
protected:
- ThisFunction(Zone* zone, int pos) : Expression(zone, pos) {}
+ ThisFunction(Zone* zone, int pos, IdGen* id_gen)
+ : Expression(zone, pos, 0, id_gen) {}
};
VariableProxy* this_var() const { return this_var_; }
- static int num_ids() { return parent_num_ids() + 1; }
- TypeFeedbackId HomeObjectFeedbackId() { return TypeFeedbackId(local_id(0)); }
+ TypeFeedbackId HomeObjectFeedbackId() {
+ return TypeFeedbackId(base_id() + 0);
+ }
// Type feedback information.
virtual FeedbackVectorRequirements ComputeFeedbackRequirements() {
}
protected:
- SuperReference(Zone* zone, VariableProxy* this_var, int pos)
- : Expression(zone, pos),
+ SuperReference(Zone* zone, VariableProxy* this_var, int pos, IdGen* id_gen)
+ : Expression(zone, pos, num_ids(), id_gen),
this_var_(this_var),
homeobject_feedback_slot_(FeedbackVectorICSlot::Invalid()) {
DCHECK(this_var->is_this());
}
- static int parent_num_ids() { return Expression::num_ids(); }
- private:
- int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ static int num_ids() { return 1; }
+ int base_id() const { return Expression::base_id() + Expression::num_ids(); }
+ private:
VariableProxy* this_var_;
FeedbackVectorICSlot homeobject_feedback_slot_;
};
template<class Visitor>
class AstNodeFactory FINAL BASE_EMBEDDED {
public:
- explicit AstNodeFactory(AstValueFactory* ast_value_factory)
- : zone_(ast_value_factory->zone()),
- ast_value_factory_(ast_value_factory) {}
+ AstNodeFactory(Zone* zone, AstValueFactory* ast_value_factory,
+ AstNode::IdGen* id_gen)
+ : zone_(zone), ast_value_factory_(ast_value_factory), id_gen_(id_gen) {}
Visitor* visitor() { return &visitor_; }
int capacity,
bool is_initializer_block,
int pos) {
- Block* block =
- new (zone_) Block(zone_, labels, capacity, is_initializer_block, pos);
+ Block* block = new (zone_)
+ Block(zone_, labels, capacity, is_initializer_block, pos, id_gen_);
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); \
+ NodeType* stmt = new (zone_) NodeType(zone_, labels, pos, id_gen_); \
VISIT_AND_RETURN(NodeType, stmt); \
}
STATEMENT_WITH_LABELS(DoWhileStatement)
int pos) {
switch (visit_mode) {
case ForEachStatement::ENUMERATE: {
- ForInStatement* stmt = new (zone_) ForInStatement(zone_, labels, pos);
+ ForInStatement* stmt =
+ new (zone_) ForInStatement(zone_, labels, pos, id_gen_);
VISIT_AND_RETURN(ForInStatement, stmt);
}
case ForEachStatement::ITERATE: {
- ForOfStatement* stmt = new (zone_) ForOfStatement(zone_, labels, pos);
+ ForOfStatement* stmt =
+ new (zone_) ForOfStatement(zone_, labels, pos, id_gen_);
VISIT_AND_RETURN(ForOfStatement, stmt);
}
}
Statement* then_statement,
Statement* else_statement,
int pos) {
- IfStatement* stmt = new (zone_)
- IfStatement(zone_, condition, then_statement, else_statement, pos);
+ IfStatement* stmt = new (zone_) IfStatement(
+ zone_, condition, then_statement, else_statement, pos, id_gen_);
VISIT_AND_RETURN(IfStatement, stmt)
}
}
DebuggerStatement* NewDebuggerStatement(int pos) {
- DebuggerStatement* stmt = new (zone_) DebuggerStatement(zone_, pos);
+ DebuggerStatement* stmt =
+ new (zone_) DebuggerStatement(zone_, pos, id_gen_);
VISIT_AND_RETURN(DebuggerStatement, stmt)
}
CaseClause* NewCaseClause(
Expression* label, ZoneList<Statement*>* statements, int pos) {
- CaseClause* clause = new (zone_) CaseClause(zone_, label, statements, pos);
+ CaseClause* clause =
+ new (zone_) CaseClause(zone_, label, statements, pos, id_gen_);
VISIT_AND_RETURN(CaseClause, clause)
}
Literal* NewStringLiteral(const AstRawString* string, int pos) {
- Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewString(string), pos);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewString(string), pos, id_gen_);
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);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewSymbol(name), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewNumberLiteral(double number, int pos) {
- Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewNumber(number), pos);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewNumber(number), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewSmiLiteral(int number, int pos) {
- Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewSmi(number), pos);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewSmi(number), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewBooleanLiteral(bool b, int pos) {
- Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewBoolean(b), pos);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewBoolean(b), pos, id_gen_);
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);
+ Literal* lit = new (zone_) Literal(
+ zone_, ast_value_factory_->NewStringList(strings), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewNullLiteral(int pos) {
Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewNull(), pos);
+ new (zone_) Literal(zone_, ast_value_factory_->NewNull(), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewUndefinedLiteral(int pos) {
- Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewUndefined(), pos);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewUndefined(), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewTheHoleLiteral(int pos) {
- Literal* lit =
- new (zone_) Literal(zone_, ast_value_factory_->NewTheHole(), pos);
+ Literal* lit = new (zone_)
+ Literal(zone_, ast_value_factory_->NewTheHole(), pos, id_gen_);
VISIT_AND_RETURN(Literal, lit)
}
int boilerplate_properties,
bool has_function,
int pos) {
- ObjectLiteral* lit =
- new (zone_) ObjectLiteral(zone_, properties, literal_index,
- boilerplate_properties, has_function, pos);
+ ObjectLiteral* lit = new (zone_)
+ ObjectLiteral(zone_, properties, literal_index, boilerplate_properties,
+ has_function, pos, id_gen_);
VISIT_AND_RETURN(ObjectLiteral, lit)
}
const AstRawString* flags,
int literal_index,
int pos) {
- RegExpLiteral* lit =
- new (zone_) RegExpLiteral(zone_, pattern, flags, literal_index, pos);
+ RegExpLiteral* lit = new (zone_)
+ RegExpLiteral(zone_, pattern, flags, literal_index, pos, id_gen_);
VISIT_AND_RETURN(RegExpLiteral, lit);
}
int literal_index,
int pos) {
ArrayLiteral* lit =
- new (zone_) ArrayLiteral(zone_, values, literal_index, pos);
+ new (zone_) ArrayLiteral(zone_, values, literal_index, pos, id_gen_);
VISIT_AND_RETURN(ArrayLiteral, lit)
}
VariableProxy* NewVariableProxy(Variable* var,
int pos = RelocInfo::kNoPosition) {
- VariableProxy* proxy = new (zone_) VariableProxy(zone_, var, pos);
+ VariableProxy* proxy = new (zone_) VariableProxy(zone_, var, pos, id_gen_);
VISIT_AND_RETURN(VariableProxy, proxy)
}
bool is_this,
Interface* interface = Interface::NewValue(),
int position = RelocInfo::kNoPosition) {
- VariableProxy* proxy =
- new (zone_) VariableProxy(zone_, name, is_this, interface, position);
+ VariableProxy* proxy = new (zone_)
+ VariableProxy(zone_, name, is_this, interface, position, id_gen_);
VISIT_AND_RETURN(VariableProxy, proxy)
}
Property* NewProperty(Expression* obj, Expression* key, int pos) {
- Property* prop = new (zone_) Property(zone_, obj, key, pos);
+ Property* prop = new (zone_) Property(zone_, obj, key, pos, id_gen_);
VISIT_AND_RETURN(Property, prop)
}
Call* NewCall(Expression* expression,
ZoneList<Expression*>* arguments,
int pos) {
- Call* call = new (zone_) Call(zone_, expression, arguments, pos);
+ Call* call = new (zone_) Call(zone_, expression, arguments, pos, id_gen_);
VISIT_AND_RETURN(Call, call)
}
CallNew* NewCallNew(Expression* expression,
ZoneList<Expression*>* arguments,
int pos) {
- CallNew* call = new (zone_) CallNew(zone_, expression, arguments, pos);
+ CallNew* call =
+ new (zone_) CallNew(zone_, expression, arguments, pos, id_gen_);
VISIT_AND_RETURN(CallNew, call)
}
ZoneList<Expression*>* arguments,
int pos) {
CallRuntime* call =
- new (zone_) CallRuntime(zone_, name, function, arguments, pos);
+ new (zone_) CallRuntime(zone_, name, function, arguments, pos, id_gen_);
VISIT_AND_RETURN(CallRuntime, call)
}
Expression* expression,
int pos) {
UnaryOperation* node =
- new (zone_) UnaryOperation(zone_, op, expression, pos);
+ new (zone_) UnaryOperation(zone_, op, expression, pos, id_gen_);
VISIT_AND_RETURN(UnaryOperation, node)
}
Expression* right,
int pos) {
BinaryOperation* node =
- new (zone_) BinaryOperation(zone_, op, left, right, pos);
+ new (zone_) BinaryOperation(zone_, op, left, right, pos, id_gen_);
VISIT_AND_RETURN(BinaryOperation, node)
}
Expression* expr,
int pos) {
CountOperation* node =
- new (zone_) CountOperation(zone_, op, is_prefix, expr, pos);
+ new (zone_) CountOperation(zone_, op, is_prefix, expr, pos, id_gen_);
VISIT_AND_RETURN(CountOperation, node)
}
Expression* right,
int pos) {
CompareOperation* node =
- new (zone_) CompareOperation(zone_, op, left, right, pos);
+ new (zone_) CompareOperation(zone_, op, left, right, pos, id_gen_);
VISIT_AND_RETURN(CompareOperation, node)
}
Expression* else_expression,
int position) {
Conditional* cond = new (zone_) Conditional(
- zone_, condition, then_expression, else_expression, position);
+ zone_, condition, then_expression, else_expression, position, id_gen_);
VISIT_AND_RETURN(Conditional, cond)
}
Expression* target,
Expression* value,
int pos) {
- Assignment* assign = new (zone_) Assignment(zone_, op, target, value, pos);
- assign->Init(this);
+ Assignment* assign =
+ new (zone_) Assignment(zone_, op, target, value, pos, id_gen_);
+ assign->Init(zone_, this);
VISIT_AND_RETURN(Assignment, assign)
}
Yield::Kind yield_kind,
int pos) {
if (!expression) expression = NewUndefinedLiteral(pos);
- Yield* yield =
- new (zone_) Yield(zone_, generator_object, expression, yield_kind, pos);
+ Yield* yield = new (zone_)
+ Yield(zone_, generator_object, expression, yield_kind, pos, id_gen_);
VISIT_AND_RETURN(Yield, yield)
}
Throw* NewThrow(Expression* exception, int pos) {
- Throw* t = new (zone_) Throw(zone_, exception, pos);
+ Throw* t = new (zone_) Throw(zone_, exception, pos, id_gen_);
VISIT_AND_RETURN(Throw, t)
}
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);
+ has_duplicate_parameters, is_function, is_parenthesized, kind, position,
+ id_gen_);
// Top-level literal doesn't count for the AST's properties.
if (is_function == FunctionLiteral::kIsFunction) {
visitor_.VisitFunctionLiteral(lit);
int start_position, int end_position) {
ClassLiteral* lit =
new (zone_) ClassLiteral(zone_, name, extends, constructor, properties,
- start_position, end_position);
+ start_position, end_position, id_gen_);
VISIT_AND_RETURN(ClassLiteral, lit)
}
v8::Extension* extension,
int pos) {
NativeFunctionLiteral* lit =
- new (zone_) NativeFunctionLiteral(zone_, name, extension, pos);
+ new (zone_) NativeFunctionLiteral(zone_, name, extension, pos, id_gen_);
VISIT_AND_RETURN(NativeFunctionLiteral, lit)
}
ThisFunction* NewThisFunction(int pos) {
- ThisFunction* fun = new (zone_) ThisFunction(zone_, pos);
+ ThisFunction* fun = new (zone_) ThisFunction(zone_, pos, id_gen_);
VISIT_AND_RETURN(ThisFunction, fun)
}
SuperReference* NewSuperReference(VariableProxy* this_var, int pos) {
- SuperReference* super = new (zone_) SuperReference(zone_, this_var, pos);
+ SuperReference* super =
+ new (zone_) SuperReference(zone_, this_var, pos, id_gen_);
VISIT_AND_RETURN(SuperReference, super);
}
Zone* zone_;
Visitor visitor_;
AstValueFactory* ast_value_factory_;
+ AstNode::IdGen* id_gen_;
};