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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // Visit expressions. | 283 // Visit expressions. |
284 void Visit(Expression* expr); | 284 void Visit(Expression* expr); |
285 void VisitForTest(Expression* expr); | 285 void VisitForTest(Expression* expr); |
286 void VisitForEffect(Expression* expr); | 286 void VisitForEffect(Expression* expr); |
287 void VisitForValue(Expression* expr); | 287 void VisitForValue(Expression* expr); |
288 void VisitForValueOrNull(Expression* expr); | 288 void VisitForValueOrNull(Expression* expr); |
289 void VisitForValueOrTheHole(Expression* expr); | 289 void VisitForValueOrTheHole(Expression* expr); |
290 void VisitForValues(ZoneList<Expression*>* exprs); | 290 void VisitForValues(ZoneList<Expression*>* exprs); |
291 | 291 |
292 // Common for all IterationStatement bodies. | 292 // Common for all IterationStatement bodies. |
293 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop, int); | 293 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop); |
294 | 294 |
295 // Dispatched from VisitCallRuntime. | 295 // Dispatched from VisitCallRuntime. |
296 void VisitCallJSRuntime(CallRuntime* expr); | 296 void VisitCallJSRuntime(CallRuntime* expr); |
297 | 297 |
298 // Dispatched from VisitUnaryOperation. | 298 // Dispatched from VisitUnaryOperation. |
299 void VisitDelete(UnaryOperation* expr); | 299 void VisitDelete(UnaryOperation* expr); |
300 void VisitVoid(UnaryOperation* expr); | 300 void VisitVoid(UnaryOperation* expr); |
301 void VisitTypeof(UnaryOperation* expr); | 301 void VisitTypeof(UnaryOperation* expr); |
302 void VisitNot(UnaryOperation* expr); | 302 void VisitNot(UnaryOperation* expr); |
303 | 303 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 } | 393 } |
394 Node* Peek(int depth) { | 394 Node* Peek(int depth) { |
395 DCHECK(depth >= 0 && depth < stack_height()); | 395 DCHECK(depth >= 0 && depth < stack_height()); |
396 int index = static_cast<int>(values()->size()) - depth - 1; | 396 int index = static_cast<int>(values()->size()) - depth - 1; |
397 return values()->at(index); | 397 return values()->at(index); |
398 } | 398 } |
399 void Drop(int depth) { | 399 void Drop(int depth) { |
400 DCHECK(depth >= 0 && depth <= stack_height()); | 400 DCHECK(depth >= 0 && depth <= stack_height()); |
401 values()->erase(values()->end() - depth, values()->end()); | 401 values()->erase(values()->end() - depth, values()->end()); |
402 } | 402 } |
| 403 void Trim(int trim_to_height) { |
| 404 int depth = stack_height() - trim_to_height; |
| 405 DCHECK(depth >= 0 && depth <= stack_height()); |
| 406 values()->erase(values()->end() - depth, values()->end()); |
| 407 } |
403 | 408 |
404 // Preserve a checkpoint of the environment for the IR graph. Any | 409 // Preserve a checkpoint of the environment for the IR graph. Any |
405 // further mutation of the environment will not affect checkpoints. | 410 // further mutation of the environment will not affect checkpoints. |
406 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine); | 411 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine); |
407 | 412 |
408 // Control dependency tracked by this environment. | 413 // Control dependency tracked by this environment. |
409 Node* GetControlDependency() { return control_dependency_; } | 414 Node* GetControlDependency() { return control_dependency_; } |
410 void UpdateControlDependency(Node* dependency) { | 415 void UpdateControlDependency(Node* dependency) { |
411 control_dependency_ = dependency; | 416 control_dependency_ = dependency; |
412 } | 417 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 475 |
471 // Prepare environment to be used as loop header. | 476 // Prepare environment to be used as loop header. |
472 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 477 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
473 }; | 478 }; |
474 | 479 |
475 } // namespace compiler | 480 } // namespace compiler |
476 } // namespace internal | 481 } // namespace internal |
477 } // namespace v8 | 482 } // namespace v8 |
478 | 483 |
479 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 484 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |