Chromium Code Reviews| Index: src/ast.h |
| diff --git a/src/ast.h b/src/ast.h |
| index f1adf528a20ea5a6c9d61408f4ef289a2765b11d..6d421f23a08b703b388e215876819c4aab55a704 100644 |
| --- a/src/ast.h |
| +++ b/src/ast.h |
| @@ -90,7 +90,8 @@ namespace internal { |
| V(SuperPropertyReference) \ |
| V(SuperCallReference) \ |
| V(CaseClause) \ |
| - V(EmptyParentheses) |
| + V(EmptyParentheses) \ |
| + V(DoExpression) |
| #define AST_NODE_LIST(V) \ |
| DECLARATION_NODE_LIST(V) \ |
| @@ -490,6 +491,29 @@ class Block final : public BreakableStatement { |
| }; |
| +class DoExpression final : public Expression { |
| + public: |
| + DECLARE_NODE_TYPE(DoExpression) |
| + |
| + Block* block() { return block_; } |
| + VariableProxy* result() { return result_; } |
| + |
| + protected: |
| + DoExpression(Zone* zone, Block* block, VariableProxy* result, int pos) |
| + : Expression(zone, pos), block_(block), result_(result) { |
| + DCHECK_NOT_NULL(block_); |
| + DCHECK_NOT_NULL(result_); |
| + } |
| + static int parent_num_ids() { return Expression::num_ids(); } |
| + |
| + private: |
| + int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| + |
| + Block* block_; |
| + VariableProxy* result_; |
| +}; |
| + |
| + |
| class Declaration : public AstNode { |
| public: |
| VariableProxy* proxy() const { return proxy_; } |
| @@ -3195,6 +3219,11 @@ class AstVisitor BASE_EMBEDDED { |
| stack_overflow_ = false; \ |
| } \ |
| \ |
| + void InitializeAstVisitor(uintptr_t stack_limit) { \ |
| + stack_limit_ = stack_limit; \ |
| + stack_overflow_ = false; \ |
| + } \ |
| + \ |
| uintptr_t stack_limit_; \ |
| bool stack_overflow_ |
| @@ -3581,6 +3610,11 @@ class AstNodeFactory final BASE_EMBEDDED { |
| NativeFunctionLiteral(parser_zone_, name, extension, pos); |
| } |
| + DoExpression* NewDoExpression(Block* block, Variable* result_var, int pos) { |
| + VariableProxy* result = NewVariableProxy(result_var, pos); |
| + return new (parser_zone_) DoExpression(parser_zone_, block, result, pos); |
|
marja
2016/07/13 12:08:04
Question: why is DoExpression in parser_zone_ and
|
| + } |
| + |
| ThisFunction* NewThisFunction(int pos) { |
| return new (local_zone_) ThisFunction(local_zone_, pos); |
| } |