| 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" |
| 11 #include "src/compiler/graph-builder.h" | 11 #include "src/compiler/graph-builder.h" |
| 12 #include "src/compiler/js-graph.h" | 12 #include "src/compiler/js-graph.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 namespace compiler { | 16 namespace compiler { |
| 17 | 17 |
| 18 class ControlBuilder; | 18 class ControlBuilder; |
| 19 class LoopBuilder; | 19 class LoopBuilder; |
| 20 class Graph; | 20 class Graph; |
| 21 | 21 |
| 22 // The AstGraphBuilder produces a high-level IR graph, based on an | 22 // The AstGraphBuilder produces a high-level IR graph, based on an |
| 23 // underlying AST. The produced graph can either be compiled into a | 23 // underlying AST. The produced graph can either be compiled into a |
| 24 // stand-alone function or be wired into another graph for the purposes | 24 // stand-alone function or be wired into another graph for the purposes |
| 25 // of function inlining. | 25 // of function inlining. |
| 26 class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor { | 26 class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor { |
| 27 public: | 27 public: |
| 28 AstGraphBuilder(CompilationInfo* info, JSGraph* jsgraph); | 28 AstGraphBuilder(Zone* local_zone, CompilationInfo* info, JSGraph* jsgraph); |
| 29 | 29 |
| 30 // Creates a graph by visiting the entire AST. | 30 // Creates a graph by visiting the entire AST. |
| 31 bool CreateGraph(); | 31 bool CreateGraph(); |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 class AstContext; | 34 class AstContext; |
| 35 class AstEffectContext; | 35 class AstEffectContext; |
| 36 class AstValueContext; | 36 class AstValueContext; |
| 37 class AstTestContext; | 37 class AstTestContext; |
| 38 class BreakableScope; | 38 class BreakableScope; |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 }; | 432 }; |
| 433 | 433 |
| 434 Scope* AstGraphBuilder::current_scope() const { | 434 Scope* AstGraphBuilder::current_scope() const { |
| 435 return execution_context_->scope(); | 435 return execution_context_->scope(); |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 } | 438 } |
| 439 } // namespace v8::internal::compiler | 439 } // namespace v8::internal::compiler |
| 440 | 440 |
| 441 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 441 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |