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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 572 |
573 // Copies this environment at a control-flow split point. | 573 // Copies this environment at a control-flow split point. |
574 Environment* CopyForConditional(); | 574 Environment* CopyForConditional(); |
575 | 575 |
576 // Copies this environment to a potentially unreachable control-flow point. | 576 // Copies this environment to a potentially unreachable control-flow point. |
577 Environment* CopyAsUnreachable(); | 577 Environment* CopyAsUnreachable(); |
578 | 578 |
579 // Copies this environment at a loop header control-flow point. | 579 // Copies this environment at a loop header control-flow point. |
580 Environment* CopyForLoop(BitVector* assigned, bool is_osr = false); | 580 Environment* CopyForLoop(BitVector* assigned, bool is_osr = false); |
581 | 581 |
| 582 // Copies this environment for Osr entry. This only produces environment |
| 583 // of the right shape, the caller is responsible for filling in the right |
| 584 // values and dependencies. |
| 585 Environment* CopyForOsrEntry(); |
| 586 |
582 private: | 587 private: |
583 AstGraphBuilder* builder_; | 588 AstGraphBuilder* builder_; |
584 int parameters_count_; | 589 int parameters_count_; |
585 int locals_count_; | 590 int locals_count_; |
586 LivenessAnalyzerBlock* liveness_block_; | 591 LivenessAnalyzerBlock* liveness_block_; |
587 NodeVector values_; | 592 NodeVector values_; |
588 NodeVector contexts_; | 593 NodeVector contexts_; |
589 Node* control_dependency_; | 594 Node* control_dependency_; |
590 Node* effect_dependency_; | 595 Node* effect_dependency_; |
591 Node* parameters_node_; | 596 Node* parameters_node_; |
592 Node* locals_node_; | 597 Node* locals_node_; |
593 Node* stack_node_; | 598 Node* stack_node_; |
594 | 599 |
595 explicit Environment(Environment* copy, | 600 explicit Environment(Environment* copy, |
596 LivenessAnalyzerBlock* liveness_block); | 601 LivenessAnalyzerBlock* liveness_block); |
597 Environment* CopyAndShareLiveness(); | 602 Environment* CopyAndShareLiveness(); |
598 void UpdateStateValues(Node** state_values, int offset, int count); | 603 void UpdateStateValues(Node** state_values, int offset, int count); |
599 void UpdateStateValuesWithCache(Node** state_values, int offset, int count); | 604 void UpdateStateValuesWithCache(Node** state_values, int offset, int count); |
600 Zone* zone() const { return builder_->local_zone(); } | 605 Zone* zone() const { return builder_->local_zone(); } |
601 Graph* graph() const { return builder_->graph(); } | 606 Graph* graph() const { return builder_->graph(); } |
602 AstGraphBuilder* builder() const { return builder_; } | 607 AstGraphBuilder* builder() const { return builder_; } |
603 CommonOperatorBuilder* common() { return builder_->common(); } | 608 CommonOperatorBuilder* common() { return builder_->common(); } |
604 NodeVector* values() { return &values_; } | 609 NodeVector* values() { return &values_; } |
605 NodeVector* contexts() { return &contexts_; } | 610 NodeVector* contexts() { return &contexts_; } |
606 LivenessAnalyzerBlock* liveness_block() { return liveness_block_; } | 611 LivenessAnalyzerBlock* liveness_block() { return liveness_block_; } |
607 bool IsLivenessAnalysisEnabled(); | 612 bool IsLivenessAnalysisEnabled(); |
608 bool IsLivenessBlockConsistent(); | 613 bool IsLivenessBlockConsistent(); |
609 | 614 |
610 // Prepare environment to be used as loop header. | 615 // Prepare environment to be used as loop header. |
611 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 616 void PrepareForLoop(BitVector* assigned); |
| 617 void PrepareForOsrEntry(); |
612 }; | 618 }; |
613 | 619 |
614 } // namespace compiler | 620 } // namespace compiler |
615 } // namespace internal | 621 } // namespace internal |
616 } // namespace v8 | 622 } // namespace v8 |
617 | 623 |
618 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 624 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |