diff options
Diffstat (limited to 'deps/v8/src/ast.h')
-rw-r--r-- | deps/v8/src/ast.h | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/deps/v8/src/ast.h b/deps/v8/src/ast.h index e72296cff7..d299f19a23 100644 --- a/deps/v8/src/ast.h +++ b/deps/v8/src/ast.h @@ -75,6 +75,7 @@ namespace internal { #define STATEMENT_NODE_LIST(V) \ V(Block) \ + V(ModuleStatement) \ V(ExpressionStatement) \ V(EmptyStatement) \ V(IfStatement) \ @@ -522,7 +523,7 @@ class ModuleDeclaration: public Declaration { ModuleDeclaration(VariableProxy* proxy, Module* module, Scope* scope) - : Declaration(proxy, LET, scope), + : Declaration(proxy, MODULE, scope), module_(module) { } @@ -645,6 +646,25 @@ class ModuleUrl: public Module { }; +class ModuleStatement: public Statement { + public: + DECLARE_NODE_TYPE(ModuleStatement) + + VariableProxy* proxy() const { return proxy_; } + Block* body() const { return body_; } + + protected: + ModuleStatement(VariableProxy* proxy, Block* body) + : proxy_(proxy), + body_(body) { + } + + private: + VariableProxy* proxy_; + Block* body_; +}; + + class IterationStatement: public BreakableStatement { public: // Type testing & conversion. @@ -1417,7 +1437,7 @@ class VariableProxy: public Expression { void MarkAsTrivial() { is_trivial_ = true; } void MarkAsLValue() { is_lvalue_ = true; } - // Bind this proxy to the variable var. + // Bind this proxy to the variable var. Interfaces must match. void BindTo(Variable* var); protected: @@ -1777,9 +1797,6 @@ class CompareOperation: public Expression { // Type feedback information. TypeFeedbackId CompareOperationFeedbackId() const { return reuse(id()); } - void RecordTypeFeedback(TypeFeedbackOracle* oracle); - bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } - bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } // Match special cases. bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check); @@ -1796,8 +1813,7 @@ class CompareOperation: public Expression { op_(op), left_(left), right_(right), - pos_(pos), - compare_type_(NONE) { + pos_(pos) { ASSERT(Token::IsCompareOp(op)); } @@ -1806,9 +1822,6 @@ class CompareOperation: public Expression { Expression* left_; Expression* right_; int pos_; - - enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY }; - CompareTypeFeedback compare_type_; }; @@ -1870,15 +1883,6 @@ class Assignment: public Expression { // This check relies on the definition order of token in token.h. bool is_compound() const { return op() > Token::ASSIGN; } - // An initialization block is a series of statments of the form - // x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and - // ending of these blocks to allow for optimizations of initialization - // blocks. - bool starts_initialization_block() { return block_start_; } - bool ends_initialization_block() { return block_end_; } - void mark_block_start() { block_start_ = true; } - void mark_block_end() { block_end_ = true; } - BailoutId AssignmentId() const { return assignment_id_; } // Type feedback information. @@ -1911,9 +1915,6 @@ class Assignment: public Expression { BinaryOperation* binary_operation_; const BailoutId assignment_id_; - bool block_start_; - bool block_end_; - bool is_monomorphic_; SmallMapList receiver_types_; }; @@ -2659,6 +2660,11 @@ class AstNodeFactory BASE_EMBEDDED { STATEMENT_WITH_LABELS(SwitchStatement) #undef STATEMENT_WITH_LABELS + ModuleStatement* NewModuleStatement(VariableProxy* proxy, Block* body) { + ModuleStatement* stmt = new(zone_) ModuleStatement(proxy, body); + VISIT_AND_RETURN(ModuleStatement, stmt) + } + ExpressionStatement* NewExpressionStatement(Expression* expression) { ExpressionStatement* stmt = new(zone_) ExpressionStatement(expression); VISIT_AND_RETURN(ExpressionStatement, stmt) |