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/ast.h" | 8 #include "src/ast.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 class ControlScopeForFinally; | 70 class ControlScopeForFinally; |
71 class Environment; | 71 class Environment; |
72 friend class ControlBuilder; | 72 friend class ControlBuilder; |
73 | 73 |
74 Zone* local_zone_; | 74 Zone* local_zone_; |
75 CompilationInfo* info_; | 75 CompilationInfo* info_; |
76 JSGraph* jsgraph_; | 76 JSGraph* jsgraph_; |
77 Environment* environment_; | 77 Environment* environment_; |
78 AstContext* ast_context_; | 78 AstContext* ast_context_; |
79 | 79 |
80 bool CreateGraphBody(); | |
81 | |
82 // List of global declarations for functions and variables. | 80 // List of global declarations for functions and variables. |
83 ZoneVector<Handle<Object>> globals_; | 81 ZoneVector<Handle<Object>> globals_; |
84 | 82 |
85 // Stack of control scopes currently entered by the visitor. | 83 // Stack of control scopes currently entered by the visitor. |
86 ControlScope* execution_control_; | 84 ControlScope* execution_control_; |
87 | 85 |
88 // Stack of context objects pushed onto the chain by the visitor. | 86 // Stack of context objects pushed onto the chain by the visitor. |
89 ContextScope* execution_context_; | 87 ContextScope* execution_context_; |
90 | 88 |
91 // Nodes representing values in the activation record. | 89 // Nodes representing values in the activation record. |
(...skipping 30 matching lines...) Expand all Loading... |
122 Scope* current_scope() const; | 120 Scope* current_scope() const; |
123 Node* current_context() const; | 121 Node* current_context() const; |
124 Node* exit_control() const { return exit_control_; } | 122 Node* exit_control() const { return exit_control_; } |
125 | 123 |
126 void set_environment(Environment* env) { environment_ = env; } | 124 void set_environment(Environment* env) { environment_ = env; } |
127 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } | 125 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } |
128 void set_execution_control(ControlScope* ctrl) { execution_control_ = ctrl; } | 126 void set_execution_control(ControlScope* ctrl) { execution_control_ = ctrl; } |
129 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } | 127 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } |
130 void set_exit_control(Node* exit) { exit_control_ = exit; } | 128 void set_exit_control(Node* exit) { exit_control_ = exit; } |
131 | 129 |
| 130 void CreateGraphBody(); |
| 131 |
132 // Node creation helpers. | 132 // Node creation helpers. |
133 Node* NewNode(const Operator* op, bool incomplete = false) { | 133 Node* NewNode(const Operator* op, bool incomplete = false) { |
134 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete); | 134 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete); |
135 } | 135 } |
136 | 136 |
137 Node* NewNode(const Operator* op, Node* n1) { | 137 Node* NewNode(const Operator* op, Node* n1) { |
138 return MakeNode(op, 1, &n1, false); | 138 return MakeNode(op, 1, &n1, false); |
139 } | 139 } |
140 | 140 |
141 Node* NewNode(const Operator* op, Node* n1, Node* n2) { | 141 Node* NewNode(const Operator* op, Node* n1, Node* n2) { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 466 |
467 // Prepare environment to be used as loop header. | 467 // Prepare environment to be used as loop header. |
468 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 468 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
469 }; | 469 }; |
470 | 470 |
471 } // namespace compiler | 471 } // namespace compiler |
472 } // namespace internal | 472 } // namespace internal |
473 } // namespace v8 | 473 } // namespace v8 |
474 | 474 |
475 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 475 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |