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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Stack of control scopes currently entered by the visitor. | 81 // Stack of control scopes currently entered by the visitor. |
82 ControlScope* execution_control_; | 82 ControlScope* execution_control_; |
83 | 83 |
84 // Stack of context objects pushed onto the chain by the visitor. | 84 // Stack of context objects pushed onto the chain by the visitor. |
85 ContextScope* execution_context_; | 85 ContextScope* execution_context_; |
86 | 86 |
87 // Nodes representing values in the activation record. | 87 // Nodes representing values in the activation record. |
88 SetOncePointer<Node> function_closure_; | 88 SetOncePointer<Node> function_closure_; |
89 SetOncePointer<Node> function_context_; | 89 SetOncePointer<Node> function_context_; |
| 90 SetOncePointer<Node> new_target_; |
90 | 91 |
91 // Tracks how many try-blocks are currently entered. | 92 // Tracks how many try-blocks are currently entered. |
92 int try_catch_nesting_level_; | 93 int try_catch_nesting_level_; |
93 int try_nesting_level_; | 94 int try_nesting_level_; |
94 | 95 |
95 // Temporary storage for building node input lists. | 96 // Temporary storage for building node input lists. |
96 int input_buffer_size_; | 97 int input_buffer_size_; |
97 Node** input_buffer_; | 98 Node** input_buffer_; |
98 | 99 |
99 // Optimization to cache loaded feedback vector. | 100 // Optimization to cache loaded feedback vector. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 141 } |
141 | 142 |
142 void set_environment(Environment* env) { environment_ = env; } | 143 void set_environment(Environment* env) { environment_ = env; } |
143 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } | 144 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } |
144 void set_execution_control(ControlScope* ctrl) { execution_control_ = ctrl; } | 145 void set_execution_control(ControlScope* ctrl) { execution_control_ = ctrl; } |
145 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } | 146 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } |
146 | 147 |
147 // Create the main graph body by visiting the AST. | 148 // Create the main graph body by visiting the AST. |
148 void CreateGraphBody(bool stack_check); | 149 void CreateGraphBody(bool stack_check); |
149 | 150 |
150 // Get or create the node that represents the outer function closure. | 151 // Get or create the node that represents the incoming function closure. |
151 Node* GetFunctionClosureForContext(); | 152 Node* GetFunctionClosureForContext(); |
152 Node* GetFunctionClosure(); | 153 Node* GetFunctionClosure(); |
153 | 154 |
154 // Get or create the node that represents the outer function context. | 155 // Get or create the node that represents the incoming function context. |
155 Node* GetFunctionContext(); | 156 Node* GetFunctionContext(); |
156 | 157 |
| 158 // Get or create the node that represents the incoming new target value. |
| 159 Node* GetNewTarget(); |
| 160 |
157 // Node creation helpers. | 161 // Node creation helpers. |
158 Node* NewNode(const Operator* op, bool incomplete = false) { | 162 Node* NewNode(const Operator* op, bool incomplete = false) { |
159 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete); | 163 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete); |
160 } | 164 } |
161 | 165 |
162 Node* NewNode(const Operator* op, Node* n1) { | 166 Node* NewNode(const Operator* op, Node* n1) { |
163 return MakeNode(op, 1, &n1, false); | 167 return MakeNode(op, 1, &n1, false); |
164 } | 168 } |
165 | 169 |
166 Node* NewNode(const Operator* op, Node* n1, Node* n2) { | 170 Node* NewNode(const Operator* op, Node* n1, Node* n2) { |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 571 |
568 // Prepare environment to be used as loop header. | 572 // Prepare environment to be used as loop header. |
569 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 573 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
570 }; | 574 }; |
571 | 575 |
572 } // namespace compiler | 576 } // namespace compiler |
573 } // namespace internal | 577 } // namespace internal |
574 } // namespace v8 | 578 } // namespace v8 |
575 | 579 |
576 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 580 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |