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 #include "src/compiler/liveness-analyzer.h" | 10 #include "src/compiler/liveness-analyzer.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 SetOncePointer<Node> function_closure_; | 89 SetOncePointer<Node> function_closure_; |
90 SetOncePointer<Node> function_context_; | 90 SetOncePointer<Node> function_context_; |
91 | 91 |
92 // Tracks how many try-blocks are currently entered. | 92 // Tracks how many try-blocks are currently entered. |
93 int try_nesting_level_; | 93 int try_nesting_level_; |
94 | 94 |
95 // Temporary storage for building node input lists. | 95 // Temporary storage for building node input lists. |
96 int input_buffer_size_; | 96 int input_buffer_size_; |
97 Node** input_buffer_; | 97 Node** input_buffer_; |
98 | 98 |
99 // Merge of all control nodes that exit the function body. | 99 // Control nodes that exit the function body. |
100 Node* exit_control_; | 100 ZoneVector<Node*> exit_controls_; |
101 | 101 |
102 // Result of loop assignment analysis performed before graph creation. | 102 // Result of loop assignment analysis performed before graph creation. |
103 LoopAssignmentAnalysis* loop_assignment_analysis_; | 103 LoopAssignmentAnalysis* loop_assignment_analysis_; |
104 | 104 |
105 // Cache for StateValues nodes for frame states. | 105 // Cache for StateValues nodes for frame states. |
106 StateValuesCache state_values_cache_; | 106 StateValuesCache state_values_cache_; |
107 | 107 |
108 // Analyzer of local variable liveness. | 108 // Analyzer of local variable liveness. |
109 LivenessAnalyzer liveness_analyzer_; | 109 LivenessAnalyzer liveness_analyzer_; |
110 | 110 |
(...skipping 12 matching lines...) Expand all Loading... |
123 CommonOperatorBuilder* common() const { return jsgraph_->common(); } | 123 CommonOperatorBuilder* common() const { return jsgraph_->common(); } |
124 CompilationInfo* info() const { return info_; } | 124 CompilationInfo* info() const { return info_; } |
125 LanguageMode language_mode() const; | 125 LanguageMode language_mode() const; |
126 JSGraph* jsgraph() { return jsgraph_; } | 126 JSGraph* jsgraph() { return jsgraph_; } |
127 Graph* graph() { return jsgraph_->graph(); } | 127 Graph* graph() { return jsgraph_->graph(); } |
128 Zone* graph_zone() { return graph()->zone(); } | 128 Zone* graph_zone() { return graph()->zone(); } |
129 JSOperatorBuilder* javascript() { return jsgraph_->javascript(); } | 129 JSOperatorBuilder* javascript() { return jsgraph_->javascript(); } |
130 ZoneVector<Handle<Object>>* globals() { return &globals_; } | 130 ZoneVector<Handle<Object>>* globals() { return &globals_; } |
131 Scope* current_scope() const; | 131 Scope* current_scope() const; |
132 Node* current_context() const; | 132 Node* current_context() const; |
133 Node* exit_control() const { return exit_control_; } | |
134 LivenessAnalyzer* liveness_analyzer() { return &liveness_analyzer_; } | 133 LivenessAnalyzer* liveness_analyzer() { return &liveness_analyzer_; } |
135 | 134 |
136 void set_environment(Environment* env) { environment_ = env; } | 135 void set_environment(Environment* env) { environment_ = env; } |
137 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } | 136 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } |
138 void set_execution_control(ControlScope* ctrl) { execution_control_ = ctrl; } | 137 void set_execution_control(ControlScope* ctrl) { execution_control_ = ctrl; } |
139 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } | 138 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } |
140 void set_exit_control(Node* exit) { exit_control_ = exit; } | |
141 | 139 |
142 // Create the main graph body by visiting the AST. | 140 // Create the main graph body by visiting the AST. |
143 void CreateGraphBody(bool stack_check); | 141 void CreateGraphBody(bool stack_check); |
144 | 142 |
145 // Create the node that represents the outer context of the function. | 143 // Create the node that represents the outer context of the function. |
146 void CreateFunctionContext(bool constant_context); | 144 void CreateFunctionContext(bool constant_context); |
147 | 145 |
148 // Get or create the node that represents the outer function closure. | 146 // Get or create the node that represents the outer function closure. |
149 Node* GetFunctionClosure(); | 147 Node* GetFunctionClosure(); |
150 | 148 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 505 |
508 // Prepare environment to be used as loop header. | 506 // Prepare environment to be used as loop header. |
509 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 507 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
510 }; | 508 }; |
511 | 509 |
512 } // namespace compiler | 510 } // namespace compiler |
513 } // namespace internal | 511 } // namespace internal |
514 } // namespace v8 | 512 } // namespace v8 |
515 | 513 |
516 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 514 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |