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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 void Drop(int depth) { | 254 void Drop(int depth) { |
255 DCHECK(depth >= 0 && depth <= stack_height()); | 255 DCHECK(depth >= 0 && depth <= stack_height()); |
256 values()->erase(values()->end() - depth, values()->end()); | 256 values()->erase(values()->end() - depth, values()->end()); |
257 } | 257 } |
258 | 258 |
259 // Preserve a checkpoint of the environment for the IR graph. Any | 259 // Preserve a checkpoint of the environment for the IR graph. Any |
260 // further mutation of the environment will not affect checkpoints. | 260 // further mutation of the environment will not affect checkpoints. |
261 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine); | 261 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine); |
262 | 262 |
263 protected: | |
264 AstGraphBuilder* builder() const { | |
265 return reinterpret_cast<AstGraphBuilder*>( | |
266 StructuredGraphBuilder::Environment::builder()); | |
267 } | |
268 | |
269 private: | 263 private: |
270 void UpdateStateValues(Node** state_values, int offset, int count); | 264 void UpdateStateValues(Node** state_values, int offset, int count); |
271 | 265 |
272 int parameters_count_; | 266 int parameters_count_; |
273 int locals_count_; | 267 int locals_count_; |
274 Node* parameters_node_; | 268 Node* parameters_node_; |
275 Node* locals_node_; | 269 Node* locals_node_; |
276 Node* stack_node_; | 270 Node* stack_node_; |
277 }; | 271 }; |
278 | 272 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 }; | 415 }; |
422 | 416 |
423 Scope* AstGraphBuilder::current_scope() const { | 417 Scope* AstGraphBuilder::current_scope() const { |
424 return execution_context_->scope(); | 418 return execution_context_->scope(); |
425 } | 419 } |
426 } | 420 } |
427 } | 421 } |
428 } // namespace v8::internal::compiler | 422 } // namespace v8::internal::compiler |
429 | 423 |
430 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 424 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |