| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/ast.h" | 10 #include "src/ast.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 LoopAssignmentAnalysis* loop_assignment = NULL); | 30 LoopAssignmentAnalysis* loop_assignment = NULL); |
| 31 | 31 |
| 32 // Creates a graph by visiting the entire AST. | 32 // Creates a graph by visiting the entire AST. |
| 33 bool CreateGraph(); | 33 bool CreateGraph(); |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 class AstContext; | 36 class AstContext; |
| 37 class AstEffectContext; | 37 class AstEffectContext; |
| 38 class AstValueContext; | 38 class AstValueContext; |
| 39 class AstTestContext; | 39 class AstTestContext; |
| 40 class BlockContextScope; |
| 40 class BreakableScope; | 41 class BreakableScope; |
| 41 class ContextScope; | 42 class ContextScope; |
| 42 class Environment; | 43 class Environment; |
| 43 | 44 |
| 44 Environment* environment() { | 45 Environment* environment() { |
| 45 return reinterpret_cast<Environment*>( | 46 return reinterpret_cast<Environment*>( |
| 46 StructuredGraphBuilder::environment()); | 47 StructuredGraphBuilder::environment()); |
| 47 } | 48 } |
| 48 | 49 |
| 49 AstContext* ast_context() const { return ast_context_; } | 50 AstContext* ast_context() const { return ast_context_; } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 // Visit statements. | 169 // Visit statements. |
| 169 void VisitIfNotNull(Statement* stmt); | 170 void VisitIfNotNull(Statement* stmt); |
| 170 | 171 |
| 171 // Visit expressions. | 172 // Visit expressions. |
| 172 void Visit(Expression* expr); | 173 void Visit(Expression* expr); |
| 173 void VisitForTest(Expression* expr); | 174 void VisitForTest(Expression* expr); |
| 174 void VisitForEffect(Expression* expr); | 175 void VisitForEffect(Expression* expr); |
| 175 void VisitForValue(Expression* expr); | 176 void VisitForValue(Expression* expr); |
| 176 void VisitForValueOrNull(Expression* expr); | 177 void VisitForValueOrNull(Expression* expr); |
| 178 void VisitForValueOrTheHole(Expression* expr); |
| 177 void VisitForValues(ZoneList<Expression*>* exprs); | 179 void VisitForValues(ZoneList<Expression*>* exprs); |
| 178 | 180 |
| 179 // Common for all IterationStatement bodies. | 181 // Common for all IterationStatement bodies. |
| 180 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop, int); | 182 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop, int); |
| 181 | 183 |
| 182 // Dispatched from VisitCallRuntime. | 184 // Dispatched from VisitCallRuntime. |
| 183 void VisitCallJSRuntime(CallRuntime* expr); | 185 void VisitCallJSRuntime(CallRuntime* expr); |
| 184 | 186 |
| 185 // Dispatched from VisitUnaryOperation. | 187 // Dispatched from VisitUnaryOperation. |
| 186 void VisitDelete(UnaryOperation* expr); | 188 void VisitDelete(UnaryOperation* expr); |
| 187 void VisitVoid(UnaryOperation* expr); | 189 void VisitVoid(UnaryOperation* expr); |
| 188 void VisitTypeof(UnaryOperation* expr); | 190 void VisitTypeof(UnaryOperation* expr); |
| 189 void VisitNot(UnaryOperation* expr); | 191 void VisitNot(UnaryOperation* expr); |
| 190 | 192 |
| 191 // Dispatched from VisitBinaryOperation. | 193 // Dispatched from VisitBinaryOperation. |
| 192 void VisitComma(BinaryOperation* expr); | 194 void VisitComma(BinaryOperation* expr); |
| 193 void VisitLogicalExpression(BinaryOperation* expr); | 195 void VisitLogicalExpression(BinaryOperation* expr); |
| 194 void VisitArithmeticExpression(BinaryOperation* expr); | 196 void VisitArithmeticExpression(BinaryOperation* expr); |
| 195 | 197 |
| 196 // Dispatched from VisitForInStatement. | 198 // Dispatched from VisitForInStatement. |
| 197 void VisitForInAssignment(Expression* expr, Node* value); | 199 void VisitForInAssignment(Expression* expr, Node* value); |
| 198 | 200 |
| 201 // Dispatched from VisitClassLiteral. |
| 202 void VisitClassLiteralContents(ClassLiteral* expr); |
| 203 |
| 199 // Builds deoptimization for a given node. | 204 // Builds deoptimization for a given node. |
| 200 void PrepareFrameState( | 205 void PrepareFrameState( |
| 201 Node* node, BailoutId ast_id, | 206 Node* node, BailoutId ast_id, |
| 202 OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore()); | 207 OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore()); |
| 203 | 208 |
| 204 BitVector* GetVariablesAssignedInLoop(IterationStatement* stmt); | 209 BitVector* GetVariablesAssignedInLoop(IterationStatement* stmt); |
| 205 | 210 |
| 206 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 211 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
| 207 DISALLOW_COPY_AND_ASSIGN(AstGraphBuilder); | 212 DISALLOW_COPY_AND_ASSIGN(AstGraphBuilder); |
| 208 }; | 213 }; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 453 |
| 449 Scope* AstGraphBuilder::current_scope() const { | 454 Scope* AstGraphBuilder::current_scope() const { |
| 450 return execution_context_->scope(); | 455 return execution_context_->scope(); |
| 451 } | 456 } |
| 452 | 457 |
| 453 } // namespace compiler | 458 } // namespace compiler |
| 454 } // namespace internal | 459 } // namespace internal |
| 455 } // namespace v8 | 460 } // namespace v8 |
| 456 | 461 |
| 457 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 462 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |