OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 | 946 |
947 HArgumentsObject* arguments_object_; | 947 HArgumentsObject* arguments_object_; |
948 HArgumentsElements* arguments_elements_; | 948 HArgumentsElements* arguments_elements_; |
949 | 949 |
950 FunctionState* outer_; | 950 FunctionState* outer_; |
951 }; | 951 }; |
952 | 952 |
953 | 953 |
954 class HIfContinuation V8_FINAL { | 954 class HIfContinuation V8_FINAL { |
955 public: | 955 public: |
956 HIfContinuation() : continuation_captured_(false) {} | 956 HIfContinuation() |
| 957 : continuation_captured_(false), |
| 958 true_branch_(NULL), |
| 959 false_branch_(NULL) {} |
957 HIfContinuation(HBasicBlock* true_branch, | 960 HIfContinuation(HBasicBlock* true_branch, |
958 HBasicBlock* false_branch) | 961 HBasicBlock* false_branch) |
959 : continuation_captured_(true), true_branch_(true_branch), | 962 : continuation_captured_(true), true_branch_(true_branch), |
960 false_branch_(false_branch) {} | 963 false_branch_(false_branch) {} |
961 ~HIfContinuation() { ASSERT(!continuation_captured_); } | 964 ~HIfContinuation() { ASSERT(!continuation_captured_); } |
962 | 965 |
963 void Capture(HBasicBlock* true_branch, | 966 void Capture(HBasicBlock* true_branch, |
964 HBasicBlock* false_branch) { | 967 HBasicBlock* false_branch) { |
965 ASSERT(!continuation_captured_); | 968 ASSERT(!continuation_captured_); |
966 true_branch_ = true_branch; | 969 true_branch_ = true_branch; |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 // // continues after else code of if_whatever or if_something. | 1489 // // continues after else code of if_whatever or if_something. |
1487 // ... | 1490 // ... |
1488 // if_finally.End(); | 1491 // if_finally.End(); |
1489 void JoinContinuation(HIfContinuation* continuation); | 1492 void JoinContinuation(HIfContinuation* continuation); |
1490 | 1493 |
1491 void Then(); | 1494 void Then(); |
1492 void Else(); | 1495 void Else(); |
1493 void End(); | 1496 void End(); |
1494 | 1497 |
1495 void Deopt(const char* reason); | 1498 void Deopt(const char* reason); |
| 1499 void ThenDeopt(const char* reason) { |
| 1500 Then(); |
| 1501 Deopt(reason); |
| 1502 } |
1496 void ElseDeopt(const char* reason) { | 1503 void ElseDeopt(const char* reason) { |
1497 Else(); | 1504 Else(); |
1498 Deopt(reason); | 1505 Deopt(reason); |
1499 } | 1506 } |
1500 | 1507 |
1501 void Return(HValue* value); | 1508 void Return(HValue* value); |
1502 | 1509 |
1503 private: | 1510 private: |
1504 HControlInstruction* AddCompare(HControlInstruction* compare); | 1511 HControlInstruction* AddCompare(HControlInstruction* compare); |
1505 | 1512 |
1506 HGraphBuilder* builder() const { return builder_; } | 1513 HGraphBuilder* builder() const { return builder_; } |
1507 | 1514 |
| 1515 void AddMergeAtJoinBlock(bool deopt); |
| 1516 |
| 1517 void Finish(); |
| 1518 void Finish(HBasicBlock** then_continuation, |
| 1519 HBasicBlock** else_continuation); |
| 1520 |
| 1521 class MergeAtJoinBlock : public ZoneObject { |
| 1522 public: |
| 1523 MergeAtJoinBlock(HBasicBlock* block, |
| 1524 bool deopt, |
| 1525 MergeAtJoinBlock* next) |
| 1526 : block_(block), |
| 1527 deopt_(deopt), |
| 1528 next_(next) {} |
| 1529 HBasicBlock* block_; |
| 1530 bool deopt_; |
| 1531 MergeAtJoinBlock* next_; |
| 1532 }; |
| 1533 |
1508 HGraphBuilder* builder_; | 1534 HGraphBuilder* builder_; |
1509 bool finished_ : 1; | 1535 bool finished_ : 1; |
1510 bool deopt_then_ : 1; | |
1511 bool deopt_else_ : 1; | |
1512 bool did_then_ : 1; | 1536 bool did_then_ : 1; |
1513 bool did_else_ : 1; | 1537 bool did_else_ : 1; |
| 1538 bool did_else_if_ : 1; |
1514 bool did_and_ : 1; | 1539 bool did_and_ : 1; |
1515 bool did_or_ : 1; | 1540 bool did_or_ : 1; |
1516 bool captured_ : 1; | 1541 bool captured_ : 1; |
1517 bool needs_compare_ : 1; | 1542 bool needs_compare_ : 1; |
| 1543 bool pending_merge_block_ : 1; |
1518 HBasicBlock* first_true_block_; | 1544 HBasicBlock* first_true_block_; |
1519 HBasicBlock* last_true_block_; | |
1520 HBasicBlock* first_false_block_; | 1545 HBasicBlock* first_false_block_; |
1521 HBasicBlock* split_edge_merge_block_; | 1546 HBasicBlock* split_edge_merge_block_; |
1522 HBasicBlock* merge_block_; | 1547 MergeAtJoinBlock* merge_at_join_blocks_; |
| 1548 int normal_merge_at_join_block_count_; |
| 1549 int deopt_merge_at_join_block_count_; |
1523 }; | 1550 }; |
1524 | 1551 |
1525 class LoopBuilder V8_FINAL { | 1552 class LoopBuilder V8_FINAL { |
1526 public: | 1553 public: |
1527 enum Direction { | 1554 enum Direction { |
1528 kPreIncrement, | 1555 kPreIncrement, |
1529 kPostIncrement, | 1556 kPostIncrement, |
1530 kPreDecrement, | 1557 kPreDecrement, |
1531 kPostDecrement | 1558 kPostDecrement |
1532 }; | 1559 }; |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2536 } | 2563 } |
2537 | 2564 |
2538 private: | 2565 private: |
2539 HGraphBuilder* builder_; | 2566 HGraphBuilder* builder_; |
2540 }; | 2567 }; |
2541 | 2568 |
2542 | 2569 |
2543 } } // namespace v8::internal | 2570 } } // namespace v8::internal |
2544 | 2571 |
2545 #endif // V8_HYDROGEN_H_ | 2572 #endif // V8_HYDROGEN_H_ |
OLD | NEW |