OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 int normal_merge_at_join_block_count_; | 1662 int normal_merge_at_join_block_count_; |
1663 int deopt_merge_at_join_block_count_; | 1663 int deopt_merge_at_join_block_count_; |
1664 }; | 1664 }; |
1665 | 1665 |
1666 class LoopBuilder V8_FINAL { | 1666 class LoopBuilder V8_FINAL { |
1667 public: | 1667 public: |
1668 enum Direction { | 1668 enum Direction { |
1669 kPreIncrement, | 1669 kPreIncrement, |
1670 kPostIncrement, | 1670 kPostIncrement, |
1671 kPreDecrement, | 1671 kPreDecrement, |
1672 kPostDecrement | 1672 kPostDecrement, |
| 1673 kWhileTrue |
1673 }; | 1674 }; |
1674 | 1675 |
| 1676 explicit LoopBuilder(HGraphBuilder* builder); // while (true) {...} |
1675 LoopBuilder(HGraphBuilder* builder, | 1677 LoopBuilder(HGraphBuilder* builder, |
1676 HValue* context, | 1678 HValue* context, |
1677 Direction direction); | 1679 Direction direction); |
1678 LoopBuilder(HGraphBuilder* builder, | 1680 LoopBuilder(HGraphBuilder* builder, |
1679 HValue* context, | 1681 HValue* context, |
1680 Direction direction, | 1682 Direction direction, |
1681 HValue* increment_amount); | 1683 HValue* increment_amount); |
1682 | 1684 |
1683 ~LoopBuilder() { | 1685 ~LoopBuilder() { |
1684 ASSERT(finished_); | 1686 ASSERT(finished_); |
1685 } | 1687 } |
1686 | 1688 |
1687 HValue* BeginBody( | 1689 HValue* BeginBody( |
1688 HValue* initial, | 1690 HValue* initial, |
1689 HValue* terminating, | 1691 HValue* terminating, |
1690 Token::Value token); | 1692 Token::Value token); |
1691 | 1693 |
| 1694 void BeginBody(int drop_count); |
| 1695 |
1692 void Break(); | 1696 void Break(); |
1693 | 1697 |
1694 void EndBody(); | 1698 void EndBody(); |
1695 | 1699 |
1696 private: | 1700 private: |
| 1701 void Initialize(HGraphBuilder* builder, HValue* context, |
| 1702 Direction direction, HValue* increment_amount); |
1697 Zone* zone() { return builder_->zone(); } | 1703 Zone* zone() { return builder_->zone(); } |
1698 | 1704 |
1699 HGraphBuilder* builder_; | 1705 HGraphBuilder* builder_; |
1700 HValue* context_; | 1706 HValue* context_; |
1701 HValue* increment_amount_; | 1707 HValue* increment_amount_; |
1702 HInstruction* increment_; | 1708 HInstruction* increment_; |
1703 HPhi* phi_; | 1709 HPhi* phi_; |
1704 HBasicBlock* header_block_; | 1710 HBasicBlock* header_block_; |
1705 HBasicBlock* body_block_; | 1711 HBasicBlock* body_block_; |
1706 HBasicBlock* exit_block_; | 1712 HBasicBlock* exit_block_; |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2895 } | 2901 } |
2896 | 2902 |
2897 private: | 2903 private: |
2898 HGraphBuilder* builder_; | 2904 HGraphBuilder* builder_; |
2899 }; | 2905 }; |
2900 | 2906 |
2901 | 2907 |
2902 } } // namespace v8::internal | 2908 } } // namespace v8::internal |
2903 | 2909 |
2904 #endif // V8_HYDROGEN_H_ | 2910 #endif // V8_HYDROGEN_H_ |
OLD | NEW |