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/ast.h" | 8 #include "src/ast/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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 bool CreateGraph(bool stack_check = true); | 42 bool CreateGraph(bool stack_check = true); |
43 | 43 |
44 // Helpers to create new control nodes. | 44 // Helpers to create new control nodes. |
45 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } | 45 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } |
46 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } | 46 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } |
47 Node* NewMerge() { return NewNode(common()->Merge(1), true); } | 47 Node* NewMerge() { return NewNode(common()->Merge(1), true); } |
48 Node* NewLoop() { return NewNode(common()->Loop(1), true); } | 48 Node* NewLoop() { return NewNode(common()->Loop(1), true); } |
49 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { | 49 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { |
50 return NewNode(common()->Branch(hint), condition); | 50 return NewNode(common()->Branch(hint), condition); |
51 } | 51 } |
52 void BuildLoopExit(Node* loop, BitVector* assigned_variables, | |
53 Node** extra_value_to_rename); | |
52 | 54 |
53 protected: | 55 protected: |
54 #define DECLARE_VISIT(type) void Visit##type(type* node) override; | 56 #define DECLARE_VISIT(type) void Visit##type(type* node) override; |
55 // Visiting functions for AST nodes make this an AstVisitor. | 57 // Visiting functions for AST nodes make this an AstVisitor. |
56 AST_NODE_LIST(DECLARE_VISIT) | 58 AST_NODE_LIST(DECLARE_VISIT) |
57 #undef DECLARE_VISIT | 59 #undef DECLARE_VISIT |
58 | 60 |
59 // Visiting function for declarations list is overridden. | 61 // Visiting function for declarations list is overridden. |
60 void VisitDeclarations(ZoneList<Declaration*>* declarations) override; | 62 void VisitDeclarations(ZoneList<Declaration*>* declarations) override; |
61 | 63 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 int depth = stack_height() - trim_to_height; | 534 int depth = stack_height() - trim_to_height; |
533 DCHECK(depth >= 0 && depth <= stack_height()); | 535 DCHECK(depth >= 0 && depth <= stack_height()); |
534 values()->erase(values()->end() - depth, values()->end()); | 536 values()->erase(values()->end() - depth, values()->end()); |
535 } | 537 } |
536 | 538 |
537 // Preserve a checkpoint of the environment for the IR graph. Any | 539 // Preserve a checkpoint of the environment for the IR graph. Any |
538 // further mutation of the environment will not affect checkpoints. | 540 // further mutation of the environment will not affect checkpoints. |
539 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine = | 541 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine = |
540 OutputFrameStateCombine::Ignore(), | 542 OutputFrameStateCombine::Ignore(), |
541 bool node_has_exception = false); | 543 bool node_has_exception = false); |
544 void RenameForLoopExit(Node* loop, BitVector* assigned_variables); | |
Michael Starzinger
2016/07/14 12:13:36
nit: Needs a short comment explaining purpose of m
Jarin
2016/07/14 12:51:34
Done.
| |
542 | 545 |
543 // Control dependency tracked by this environment. | 546 // Control dependency tracked by this environment. |
544 Node* GetControlDependency() { return control_dependency_; } | 547 Node* GetControlDependency() { return control_dependency_; } |
545 void UpdateControlDependency(Node* dependency) { | 548 void UpdateControlDependency(Node* dependency) { |
546 control_dependency_ = dependency; | 549 control_dependency_ = dependency; |
547 } | 550 } |
548 | 551 |
549 // Effect dependency tracked by this environment. | 552 // Effect dependency tracked by this environment. |
550 Node* GetEffectDependency() { return effect_dependency_; } | 553 Node* GetEffectDependency() { return effect_dependency_; } |
551 void UpdateEffectDependency(Node* dependency) { | 554 void UpdateEffectDependency(Node* dependency) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
603 | 606 |
604 // Prepare environment to be used as loop header. | 607 // Prepare environment to be used as loop header. |
605 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 608 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
606 }; | 609 }; |
607 | 610 |
608 } // namespace compiler | 611 } // namespace compiler |
609 } // namespace internal | 612 } // namespace internal |
610 } // namespace v8 | 613 } // namespace v8 |
611 | 614 |
612 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 615 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |