| Index: src/ast/ast.h
|
| diff --git a/src/ast/ast.h b/src/ast/ast.h
|
| index e1adae9f249ce7af7da9142e7761dd141229acc7..189428e41a061b86be829a28635273e5970a1020 100644
|
| --- a/src/ast/ast.h
|
| +++ b/src/ast/ast.h
|
| @@ -93,9 +93,9 @@ namespace internal {
|
| V(EmptyParentheses) \
|
| V(DoExpression)
|
|
|
| -#define AST_NODE_LIST(V) \
|
| - DECLARATION_NODE_LIST(V) \
|
| - STATEMENT_NODE_LIST(V) \
|
| +#define AST_NODE_LIST(V) \
|
| + DECLARATION_NODE_LIST(V) \
|
| + STATEMENT_NODE_LIST(V) \
|
| EXPRESSION_NODE_LIST(V)
|
|
|
| // Forward declarations
|
| @@ -191,31 +191,28 @@ class AstProperties final BASE_EMBEDDED {
|
| DEFINE_OPERATORS_FOR_FLAGS(AstProperties::Flags)
|
|
|
|
|
| -class AstNode: public ZoneObject {
|
| +class AstNode : public ZoneObject {
|
| public:
|
| #define DECLARE_TYPE_ENUM(type) k##type,
|
| - enum NodeType {
|
| - AST_NODE_LIST(DECLARE_TYPE_ENUM)
|
| - kInvalid = -1
|
| - };
|
| + enum NodeType { AST_NODE_LIST(DECLARE_TYPE_ENUM) kInvalid = -1 };
|
| #undef DECLARE_TYPE_ENUM
|
|
|
| void* operator new(size_t size, Zone* zone) { return zone->New(size); }
|
|
|
| - explicit AstNode(int position): position_(position) {}
|
| + explicit AstNode(int position) : position_(position) {}
|
| virtual ~AstNode() {}
|
|
|
| virtual void Accept(AstVisitor* v) = 0;
|
| virtual NodeType node_type() const = 0;
|
| int position() const { return position_; }
|
|
|
| - // Type testing & conversion functions overridden by concrete subclasses.
|
| -#define DECLARE_NODE_FUNCTIONS(type) \
|
| +// Type testing & conversion functions overridden by concrete subclasses.
|
| +#define DECLARE_NODE_FUNCTIONS(type) \
|
| bool Is##type() const { return node_type() == AstNode::k##type; } \
|
| - type* As##type() { \
|
| - return Is##type() ? reinterpret_cast<type*>(this) : NULL; \
|
| - } \
|
| - const type* As##type() const { \
|
| + type* As##type() { \
|
| + return Is##type() ? reinterpret_cast<type*>(this) : NULL; \
|
| + } \
|
| + const type* As##type() const { \
|
| return Is##type() ? reinterpret_cast<const type*>(this) : NULL; \
|
| }
|
| AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
|
| @@ -285,9 +282,7 @@ class SmallMapList final {
|
| list_.Add(handle.location(), zone);
|
| }
|
|
|
| - Handle<Map> at(int i) const {
|
| - return Handle<Map>(list_.at(i));
|
| - }
|
| + Handle<Map> at(int i) const { return Handle<Map>(list_.at(i)); }
|
|
|
| Handle<Map> first() const { return at(0); }
|
| Handle<Map> last() const { return at(length() - 1); }
|
| @@ -404,10 +399,7 @@ class Expression : public AstNode {
|
|
|
| class BreakableStatement : public Statement {
|
| public:
|
| - enum BreakableType {
|
| - TARGET_FOR_ANONYMOUS,
|
| - TARGET_FOR_NAMED_ONLY
|
| - };
|
| + enum BreakableType { TARGET_FOR_ANONYMOUS, TARGET_FOR_NAMED_ONLY };
|
|
|
| // The labels associated with this statement. May be NULL;
|
| // if it is != NULL, guaranteed to contain at least one entry.
|
| @@ -466,8 +458,8 @@ class Block final : public BreakableStatement {
|
| BailoutId DeclsId() const { return BailoutId(local_id(0)); }
|
|
|
| bool IsJump() const override {
|
| - return !statements_.is_empty() && statements_.last()->IsJump()
|
| - && labels() == NULL; // Good enough as an approximation...
|
| + return !statements_.is_empty() && statements_.last()->IsJump() &&
|
| + labels() == NULL; // Good enough as an approximation...
|
| }
|
|
|
| Scope* scope() const { return scope_; }
|
| @@ -578,14 +570,9 @@ class FunctionDeclaration final : public Declaration {
|
| bool IsInlineable() const override;
|
|
|
| protected:
|
| - FunctionDeclaration(Zone* zone,
|
| - VariableProxy* proxy,
|
| - VariableMode mode,
|
| - FunctionLiteral* fun,
|
| - Scope* scope,
|
| - int pos)
|
| - : Declaration(zone, proxy, mode, scope, pos),
|
| - fun_(fun) {
|
| + FunctionDeclaration(Zone* zone, VariableProxy* proxy, VariableMode mode,
|
| + FunctionLiteral* fun, Scope* scope, int pos)
|
| + : Declaration(zone, proxy, mode, scope, pos), fun_(fun) {
|
| DCHECK(mode == VAR || mode == LET || mode == CONST);
|
| DCHECK(fun != NULL);
|
| }
|
| @@ -668,7 +655,7 @@ class IterationStatement : public BreakableStatement {
|
| virtual BailoutId StackCheckId() const = 0;
|
|
|
| // Code generation
|
| - Label* continue_target() { return &continue_target_; }
|
| + Label* continue_target() { return &continue_target_; }
|
|
|
| protected:
|
| IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
|
| @@ -745,9 +732,7 @@ class ForStatement final : public IterationStatement {
|
| public:
|
| DECLARE_NODE_TYPE(ForStatement)
|
|
|
| - void Initialize(Statement* init,
|
| - Expression* cond,
|
| - Statement* next,
|
| + void Initialize(Statement* init, Expression* cond, Statement* next,
|
| Statement* body) {
|
| IterationStatement::Initialize(body);
|
| init_ = init;
|
| @@ -784,8 +769,8 @@ class ForStatement final : public IterationStatement {
|
| class ForEachStatement : public IterationStatement {
|
| public:
|
| enum VisitMode {
|
| - ENUMERATE, // for (each in subject) body;
|
| - ITERATE // for (each of subject) body;
|
| + ENUMERATE, // for (each in subject) body;
|
| + ITERATE // for (each of subject) body;
|
| };
|
|
|
| void Initialize(Expression* each, Expression* subject, Statement* body) {
|
| @@ -816,9 +801,7 @@ class ForInStatement final : public ForEachStatement {
|
| public:
|
| DECLARE_NODE_TYPE(ForInStatement)
|
|
|
| - Expression* enumerable() const {
|
| - return subject();
|
| - }
|
| + Expression* enumerable() const { return subject(); }
|
|
|
| // Type feedback information.
|
| void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
|
| @@ -863,13 +846,9 @@ class ForOfStatement final : public ForEachStatement {
|
| public:
|
| DECLARE_NODE_TYPE(ForOfStatement)
|
|
|
| - void Initialize(Expression* each,
|
| - Expression* subject,
|
| - Statement* body,
|
| - Expression* assign_iterator,
|
| - Expression* next_result,
|
| - Expression* result_done,
|
| - Expression* assign_each) {
|
| + void Initialize(Expression* each, Expression* subject, Statement* body,
|
| + Expression* assign_iterator, Expression* next_result,
|
| + Expression* result_done, Expression* assign_each) {
|
| ForEachStatement::Initialize(each, subject, body);
|
| assign_iterator_ = assign_iterator;
|
| next_result_ = next_result;
|
| @@ -877,29 +856,19 @@ class ForOfStatement final : public ForEachStatement {
|
| assign_each_ = assign_each;
|
| }
|
|
|
| - Expression* iterable() const {
|
| - return subject();
|
| - }
|
| + Expression* iterable() const { return subject(); }
|
|
|
| // iterator = subject[Symbol.iterator]()
|
| - Expression* assign_iterator() const {
|
| - return assign_iterator_;
|
| - }
|
| + Expression* assign_iterator() const { return assign_iterator_; }
|
|
|
| // result = iterator.next() // with type check
|
| - Expression* next_result() const {
|
| - return next_result_;
|
| - }
|
| + Expression* next_result() const { return next_result_; }
|
|
|
| // result.done
|
| - Expression* result_done() const {
|
| - return result_done_;
|
| - }
|
| + Expression* result_done() const { return result_done_; }
|
|
|
| // each = result.value
|
| - Expression* assign_each() const {
|
| - return assign_each_;
|
| - }
|
| + Expression* assign_each() const { return assign_each_; }
|
|
|
| BailoutId ContinueId() const override { return EntryId(); }
|
| BailoutId StackCheckId() const override { return BackEdgeId(); }
|
| @@ -936,7 +905,7 @@ class ExpressionStatement final : public Statement {
|
|
|
| protected:
|
| ExpressionStatement(Zone* zone, Expression* expression, int pos)
|
| - : Statement(zone, pos), expression_(expression) { }
|
| + : Statement(zone, pos), expression_(expression) {}
|
|
|
| private:
|
| Expression* expression_;
|
| @@ -960,7 +929,7 @@ class ContinueStatement final : public JumpStatement {
|
|
|
| protected:
|
| explicit ContinueStatement(Zone* zone, IterationStatement* target, int pos)
|
| - : JumpStatement(zone, pos), target_(target) { }
|
| + : JumpStatement(zone, pos), target_(target) {}
|
|
|
| private:
|
| IterationStatement* target_;
|
| @@ -975,7 +944,7 @@ class BreakStatement final : public JumpStatement {
|
|
|
| protected:
|
| explicit BreakStatement(Zone* zone, BreakableStatement* target, int pos)
|
| - : JumpStatement(zone, pos), target_(target) { }
|
| + : JumpStatement(zone, pos), target_(target) {}
|
|
|
| private:
|
| BreakableStatement* target_;
|
| @@ -990,7 +959,7 @@ class ReturnStatement final : public JumpStatement {
|
|
|
| protected:
|
| explicit ReturnStatement(Zone* zone, Expression* expression, int pos)
|
| - : JumpStatement(zone, pos), expression_(expression) { }
|
| + : JumpStatement(zone, pos), expression_(expression) {}
|
|
|
| private:
|
| Expression* expression_;
|
| @@ -1114,8 +1083,8 @@ class IfStatement final : public Statement {
|
| void set_else_statement(Statement* s) { else_statement_ = s; }
|
|
|
| bool IsJump() const override {
|
| - return HasThenStatement() && then_statement()->IsJump()
|
| - && HasElseStatement() && else_statement()->IsJump();
|
| + return HasThenStatement() && then_statement()->IsJump() &&
|
| + HasElseStatement() && else_statement()->IsJump();
|
| }
|
|
|
| void set_base_id(int id) { base_id_ = id; }
|
| @@ -1249,7 +1218,7 @@ class EmptyStatement final : public Statement {
|
| DECLARE_NODE_TYPE(EmptyStatement)
|
|
|
| protected:
|
| - explicit EmptyStatement(Zone* zone, int pos): Statement(zone, pos) {}
|
| + explicit EmptyStatement(Zone* zone, int pos) : Statement(zone, pos) {}
|
| };
|
|
|
|
|
| @@ -1387,8 +1356,9 @@ class ObjectLiteralProperty final : public ZoneObject {
|
| CONSTANT, // Property with constant value (compile time).
|
| COMPUTED, // Property with computed value (execution time).
|
| MATERIALIZED_LITERAL, // Property value is a materialized literal.
|
| - GETTER, SETTER, // Property is an accessor function.
|
| - PROTOTYPE // Property is __proto__.
|
| + GETTER,
|
| + SETTER, // Property is an accessor function.
|
| + PROTOTYPE // Property is __proto__.
|
| };
|
|
|
| Expression* key() { return key_; }
|
| @@ -1493,7 +1463,7 @@ class ObjectLiteral final : public MaterializedLiteral {
|
| kIsStrong = 1 << 4
|
| };
|
|
|
| - struct Accessors: public ZoneObject {
|
| + struct Accessors : public ZoneObject {
|
| Accessors() : getter(NULL), setter(NULL) {}
|
| ObjectLiteralProperty* getter;
|
| ObjectLiteralProperty* setter;
|
| @@ -1978,9 +1948,7 @@ class CallNew final : public Expression {
|
|
|
| bool IsMonomorphic() override { return is_monomorphic_; }
|
| Handle<JSFunction> target() const { return target_; }
|
| - Handle<AllocationSite> allocation_site() const {
|
| - return allocation_site_;
|
| - }
|
| + Handle<AllocationSite> allocation_site() const { return allocation_site_; }
|
|
|
| static int num_ids() { return parent_num_ids() + 1; }
|
| static int feedback_slots() { return 1; }
|
| @@ -2466,31 +2434,20 @@ class Throw final : public Expression {
|
|
|
| class FunctionLiteral final : public Expression {
|
| public:
|
| - enum FunctionType {
|
| - ANONYMOUS_EXPRESSION,
|
| - NAMED_EXPRESSION,
|
| - DECLARATION
|
| - };
|
| + enum FunctionType { ANONYMOUS_EXPRESSION, NAMED_EXPRESSION, DECLARATION };
|
|
|
| enum ParameterFlag {
|
| kNoDuplicateParameters = 0,
|
| kHasDuplicateParameters = 1
|
| };
|
|
|
| - enum IsFunctionFlag {
|
| - kGlobalOrEval,
|
| - kIsFunction
|
| - };
|
| + enum IsFunctionFlag { kGlobalOrEval, kIsFunction };
|
|
|
| enum EagerCompileHint { kShouldEagerCompile, kShouldLazyCompile };
|
|
|
| enum ShouldBeUsedOnceHint { kShouldBeUsedOnce, kDontKnowIfShouldBeUsedOnce };
|
|
|
| - enum ArityRestriction {
|
| - NORMAL_ARITY,
|
| - GETTER_ARITY,
|
| - SETTER_ARITY
|
| - };
|
| + enum ArityRestriction { NORMAL_ARITY, GETTER_ARITY, SETTER_ARITY };
|
|
|
| DECLARE_NODE_TYPE(FunctionLiteral)
|
|
|
| @@ -2539,7 +2496,7 @@ class FunctionLiteral final : public Expression {
|
| void set_inferred_name(Handle<String> inferred_name) {
|
| DCHECK(!inferred_name.is_null());
|
| inferred_name_ = inferred_name;
|
| - DCHECK(raw_inferred_name_== NULL || raw_inferred_name_->IsEmpty());
|
| + DCHECK(raw_inferred_name_ == NULL || raw_inferred_name_->IsEmpty());
|
| raw_inferred_name_ = NULL;
|
| }
|
|
|
| @@ -2822,8 +2779,8 @@ class EmptyParentheses final : public Expression {
|
|
|
| class RegExpVisitor BASE_EMBEDDED {
|
| public:
|
| - virtual ~RegExpVisitor() { }
|
| -#define MAKE_CASE(Name) \
|
| + virtual ~RegExpVisitor() {}
|
| +#define MAKE_CASE(Name) \
|
| virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
|
| FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
|
| #undef MAKE_CASE
|
| @@ -2847,8 +2804,8 @@ class RegExpTree : public ZoneObject {
|
| virtual Interval CaptureRegisters() { return Interval::Empty(); }
|
| virtual void AppendToText(RegExpText* text, Zone* zone);
|
| std::ostream& Print(std::ostream& os, Zone* zone); // NOLINT
|
| -#define MAKE_ASTYPE(Name) \
|
| - virtual RegExp##Name* As##Name(); \
|
| +#define MAKE_ASTYPE(Name) \
|
| + virtual RegExp##Name* As##Name(); \
|
| virtual bool Is##Name();
|
| FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ASTYPE)
|
| #undef MAKE_ASTYPE
|
| @@ -2868,6 +2825,7 @@ class RegExpDisjunction final : public RegExpTree {
|
| int min_match() override { return min_match_; }
|
| int max_match() override { return max_match_; }
|
| ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
|
| +
|
| private:
|
| bool SortConsecutiveAtoms(RegExpCompiler* compiler);
|
| void RationalizeConsecutiveAtoms(RegExpCompiler* compiler);
|
| @@ -2891,6 +2849,7 @@ class RegExpAlternative final : public RegExpTree {
|
| int min_match() override { return min_match_; }
|
| int max_match() override { return max_match_; }
|
| ZoneList<RegExpTree*>* nodes() { return nodes_; }
|
| +
|
| private:
|
| ZoneList<RegExpTree*>* nodes_;
|
| int min_match_;
|
| @@ -2908,7 +2867,7 @@ class RegExpAssertion final : public RegExpTree {
|
| BOUNDARY,
|
| NON_BOUNDARY
|
| };
|
| - explicit RegExpAssertion(AssertionType type) : assertion_type_(type) { }
|
| + explicit RegExpAssertion(AssertionType type) : assertion_type_(type) {}
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| RegExpAssertion* AsAssertion() override;
|
| @@ -2918,6 +2877,7 @@ class RegExpAssertion final : public RegExpTree {
|
| int min_match() override { return 0; }
|
| int max_match() override { return 0; }
|
| AssertionType assertion_type() { return assertion_type_; }
|
| +
|
| private:
|
| AssertionType assertion_type_;
|
| };
|
| @@ -2926,11 +2886,9 @@ class RegExpAssertion final : public RegExpTree {
|
| class CharacterSet final BASE_EMBEDDED {
|
| public:
|
| explicit CharacterSet(uc16 standard_set_type)
|
| - : ranges_(NULL),
|
| - standard_set_type_(standard_set_type) {}
|
| + : ranges_(NULL), standard_set_type_(standard_set_type) {}
|
| explicit CharacterSet(ZoneList<CharacterRange>* ranges)
|
| - : ranges_(ranges),
|
| - standard_set_type_(0) {}
|
| + : ranges_(ranges), standard_set_type_(0) {}
|
| ZoneList<CharacterRange>* ranges(Zone* zone);
|
| uc16 standard_set_type() { return standard_set_type_; }
|
| void set_standard_set_type(uc16 special_set_type) {
|
| @@ -2938,6 +2896,7 @@ class CharacterSet final BASE_EMBEDDED {
|
| }
|
| bool is_standard() { return standard_set_type_ != 0; }
|
| void Canonicalize();
|
| +
|
| private:
|
| ZoneList<CharacterRange>* ranges_;
|
| // If non-zero, the value represents a standard set (e.g., all whitespace
|
| @@ -2949,11 +2908,8 @@ class CharacterSet final BASE_EMBEDDED {
|
| class RegExpCharacterClass final : public RegExpTree {
|
| public:
|
| RegExpCharacterClass(ZoneList<CharacterRange>* ranges, bool is_negated)
|
| - : set_(ranges),
|
| - is_negated_(is_negated) { }
|
| - explicit RegExpCharacterClass(uc16 type)
|
| - : set_(type),
|
| - is_negated_(false) { }
|
| + : set_(ranges), is_negated_(is_negated) {}
|
| + explicit RegExpCharacterClass(uc16 type) : set_(type), is_negated_(false) {}
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| RegExpCharacterClass* AsCharacterClass() override;
|
| @@ -2989,7 +2945,7 @@ class RegExpCharacterClass final : public RegExpTree {
|
|
|
| class RegExpAtom final : public RegExpTree {
|
| public:
|
| - explicit RegExpAtom(Vector<const uc16> data) : data_(data) { }
|
| + explicit RegExpAtom(Vector<const uc16> data) : data_(data) {}
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| RegExpAtom* AsAtom() override;
|
| @@ -3000,6 +2956,7 @@ class RegExpAtom final : public RegExpTree {
|
| void AppendToText(RegExpText* text, Zone* zone) override;
|
| Vector<const uc16> data() { return data_; }
|
| int length() { return data_.length(); }
|
| +
|
| private:
|
| Vector<const uc16> data_;
|
| };
|
| @@ -3016,11 +2973,12 @@ class RegExpText final : public RegExpTree {
|
| int min_match() override { return length_; }
|
| int max_match() override { return length_; }
|
| void AppendToText(RegExpText* text, Zone* zone) override;
|
| - void AddElement(TextElement elm, Zone* zone) {
|
| + void AddElement(TextElement elm, Zone* zone) {
|
| elements_.Add(elm, zone);
|
| length_ += elm.length();
|
| }
|
| ZoneList<TextElement>* elements() { return &elements_; }
|
| +
|
| private:
|
| ZoneList<TextElement> elements_;
|
| int length_;
|
| @@ -3044,12 +3002,8 @@ class RegExpQuantifier final : public RegExpTree {
|
| }
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| - static RegExpNode* ToNode(int min,
|
| - int max,
|
| - bool is_greedy,
|
| - RegExpTree* body,
|
| - RegExpCompiler* compiler,
|
| - RegExpNode* on_success,
|
| + static RegExpNode* ToNode(int min, int max, bool is_greedy, RegExpTree* body,
|
| + RegExpCompiler* compiler, RegExpNode* on_success,
|
| bool not_at_start = false);
|
| RegExpQuantifier* AsQuantifier() override;
|
| Interval CaptureRegisters() override;
|
| @@ -3078,10 +3032,8 @@ class RegExpCapture final : public RegExpTree {
|
| explicit RegExpCapture(int index) : body_(NULL), index_(index) {}
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| - static RegExpNode* ToNode(RegExpTree* body,
|
| - int index,
|
| - RegExpCompiler* compiler,
|
| - RegExpNode* on_success);
|
| + static RegExpNode* ToNode(RegExpTree* body, int index,
|
| + RegExpCompiler* compiler, RegExpNode* on_success);
|
| RegExpCapture* AsCapture() override;
|
| bool IsAnchoredAtStart() override;
|
| bool IsAnchoredAtEnd() override;
|
| @@ -3138,8 +3090,7 @@ class RegExpLookaround final : public RegExpTree {
|
|
|
| class RegExpBackReference final : public RegExpTree {
|
| public:
|
| - explicit RegExpBackReference(RegExpCapture* capture)
|
| - : capture_(capture) { }
|
| + explicit RegExpBackReference(RegExpCapture* capture) : capture_(capture) {}
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| RegExpBackReference* AsBackReference() override;
|
| @@ -3155,6 +3106,7 @@ class RegExpBackReference final : public RegExpTree {
|
| }
|
| int index() { return capture_->index(); }
|
| RegExpCapture* capture() { return capture_; }
|
| +
|
| private:
|
| RegExpCapture* capture_;
|
| };
|
| @@ -3162,7 +3114,7 @@ class RegExpBackReference final : public RegExpTree {
|
|
|
| class RegExpEmpty final : public RegExpTree {
|
| public:
|
| - RegExpEmpty() { }
|
| + RegExpEmpty() {}
|
| void* Accept(RegExpVisitor* visitor, void* data) override;
|
| RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
|
| RegExpEmpty* AsEmpty() override;
|
| @@ -3189,9 +3141,8 @@ class AstVisitor BASE_EMBEDDED {
|
| virtual void VisitStatements(ZoneList<Statement*>* statements);
|
| virtual void VisitExpressions(ZoneList<Expression*>* expressions);
|
|
|
| - // Individual AST nodes.
|
| -#define DEF_VISIT(type) \
|
| - virtual void Visit##type(type* node) = 0;
|
| +// Individual AST nodes.
|
| +#define DEF_VISIT(type) virtual void Visit##type(type* node) = 0;
|
| AST_NODE_LIST(DEF_VISIT)
|
| #undef DEF_VISIT
|
| };
|
| @@ -3254,8 +3205,7 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
|
| VariableMode mode,
|
| FunctionLiteral* fun,
|
| - Scope* scope,
|
| - int pos) {
|
| + Scope* scope, int pos) {
|
| return new (parser_zone_)
|
| FunctionDeclaration(parser_zone_, proxy, mode, fun, scope, pos);
|
| }
|
| @@ -3268,8 +3218,7 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| parser_zone_, proxy, import_name, module_specifier, scope, pos);
|
| }
|
|
|
| - ExportDeclaration* NewExportDeclaration(VariableProxy* proxy,
|
| - Scope* scope,
|
| + ExportDeclaration* NewExportDeclaration(VariableProxy* proxy, Scope* scope,
|
| int pos) {
|
| return new (parser_zone_)
|
| ExportDeclaration(parser_zone_, proxy, scope, pos);
|
| @@ -3322,18 +3271,14 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return new (local_zone_) ReturnStatement(local_zone_, expression, pos);
|
| }
|
|
|
| - WithStatement* NewWithStatement(Scope* scope,
|
| - Expression* expression,
|
| - Statement* statement,
|
| - int pos) {
|
| + WithStatement* NewWithStatement(Scope* scope, Expression* expression,
|
| + Statement* statement, int pos) {
|
| return new (local_zone_)
|
| WithStatement(local_zone_, scope, expression, statement, pos);
|
| }
|
|
|
| - IfStatement* NewIfStatement(Expression* condition,
|
| - Statement* then_statement,
|
| - Statement* else_statement,
|
| - int pos) {
|
| + IfStatement* NewIfStatement(Expression* condition, Statement* then_statement,
|
| + Statement* else_statement, int pos) {
|
| return new (local_zone_) IfStatement(local_zone_, condition, then_statement,
|
| else_statement, pos);
|
| }
|
| @@ -3365,8 +3310,8 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| SloppyBlockFunctionStatement(local_zone_, statement, scope);
|
| }
|
|
|
| - CaseClause* NewCaseClause(
|
| - Expression* label, ZoneList<Statement*>* statements, int pos) {
|
| + CaseClause* NewCaseClause(Expression* label, ZoneList<Statement*>* statements,
|
| + int pos) {
|
| return new (local_zone_) CaseClause(local_zone_, label, statements, pos);
|
| }
|
|
|
| @@ -3412,12 +3357,8 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| }
|
|
|
| ObjectLiteral* NewObjectLiteral(
|
| - ZoneList<ObjectLiteral::Property*>* properties,
|
| - int literal_index,
|
| - int boilerplate_properties,
|
| - bool has_function,
|
| - bool is_strong,
|
| - int pos) {
|
| + ZoneList<ObjectLiteral::Property*>* properties, int literal_index,
|
| + int boilerplate_properties, bool has_function, bool is_strong, int pos) {
|
| return new (local_zone_)
|
| ObjectLiteral(local_zone_, properties, literal_index,
|
| boilerplate_properties, has_function, is_strong, pos);
|
| @@ -3445,9 +3386,7 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| }
|
|
|
| ArrayLiteral* NewArrayLiteral(ZoneList<Expression*>* values,
|
| - int literal_index,
|
| - bool is_strong,
|
| - int pos) {
|
| + int literal_index, bool is_strong, int pos) {
|
| return new (local_zone_)
|
| ArrayLiteral(local_zone_, values, -1, literal_index, is_strong, pos);
|
| }
|
| @@ -3479,14 +3418,12 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return new (local_zone_) Property(local_zone_, obj, key, pos);
|
| }
|
|
|
| - Call* NewCall(Expression* expression,
|
| - ZoneList<Expression*>* arguments,
|
| + Call* NewCall(Expression* expression, ZoneList<Expression*>* arguments,
|
| int pos) {
|
| return new (local_zone_) Call(local_zone_, expression, arguments, pos);
|
| }
|
|
|
| - CallNew* NewCallNew(Expression* expression,
|
| - ZoneList<Expression*>* arguments,
|
| + CallNew* NewCallNew(Expression* expression, ZoneList<Expression*>* arguments,
|
| int pos) {
|
| return new (local_zone_) CallNew(local_zone_, expression, arguments, pos);
|
| }
|
| @@ -3508,31 +3445,24 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| CallRuntime(local_zone_, context_index, arguments, pos);
|
| }
|
|
|
| - UnaryOperation* NewUnaryOperation(Token::Value op,
|
| - Expression* expression,
|
| + UnaryOperation* NewUnaryOperation(Token::Value op, Expression* expression,
|
| int pos) {
|
| return new (local_zone_) UnaryOperation(local_zone_, op, expression, pos);
|
| }
|
|
|
| - BinaryOperation* NewBinaryOperation(Token::Value op,
|
| - Expression* left,
|
| - Expression* right,
|
| - int pos) {
|
| + BinaryOperation* NewBinaryOperation(Token::Value op, Expression* left,
|
| + Expression* right, int pos) {
|
| return new (local_zone_) BinaryOperation(local_zone_, op, left, right, pos);
|
| }
|
|
|
| - CountOperation* NewCountOperation(Token::Value op,
|
| - bool is_prefix,
|
| - Expression* expr,
|
| - int pos) {
|
| + CountOperation* NewCountOperation(Token::Value op, bool is_prefix,
|
| + Expression* expr, int pos) {
|
| return new (local_zone_)
|
| CountOperation(local_zone_, op, is_prefix, expr, pos);
|
| }
|
|
|
| - CompareOperation* NewCompareOperation(Token::Value op,
|
| - Expression* left,
|
| - Expression* right,
|
| - int pos) {
|
| + CompareOperation* NewCompareOperation(Token::Value op, Expression* left,
|
| + Expression* right, int pos) {
|
| return new (local_zone_)
|
| CompareOperation(local_zone_, op, left, right, pos);
|
| }
|
| @@ -3543,16 +3473,13 @@ class AstNodeFactory final BASE_EMBEDDED {
|
|
|
| Conditional* NewConditional(Expression* condition,
|
| Expression* then_expression,
|
| - Expression* else_expression,
|
| - int position) {
|
| + Expression* else_expression, int position) {
|
| return new (local_zone_) Conditional(
|
| local_zone_, condition, then_expression, else_expression, position);
|
| }
|
|
|
| - Assignment* NewAssignment(Token::Value op,
|
| - Expression* target,
|
| - Expression* value,
|
| - int pos) {
|
| + Assignment* NewAssignment(Token::Value op, Expression* target,
|
| + Expression* value, int pos) {
|
| DCHECK(Token::IsAssignmentOp(op));
|
| Assignment* assign =
|
| new (local_zone_) Assignment(local_zone_, op, target, value, pos);
|
| @@ -3564,10 +3491,8 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return assign;
|
| }
|
|
|
| - Yield* NewYield(Expression *generator_object,
|
| - Expression* expression,
|
| - Yield::Kind yield_kind,
|
| - int pos) {
|
| + Yield* NewYield(Expression* generator_object, Expression* expression,
|
| + Yield::Kind yield_kind, int pos) {
|
| if (!expression) expression = NewUndefinedLiteral(pos);
|
| return new (local_zone_)
|
| Yield(local_zone_, generator_object, expression, yield_kind, pos);
|
|
|