| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 | 611 |
| 612 private: | 612 private: |
| 613 DISALLOW_COPY_AND_ASSIGN(StrictCompareComp); | 613 DISALLOW_COPY_AND_ASSIGN(StrictCompareComp); |
| 614 }; | 614 }; |
| 615 | 615 |
| 616 | 616 |
| 617 class EqualityCompareComp : public ComparisonComp { | 617 class EqualityCompareComp : public ComparisonComp { |
| 618 public: | 618 public: |
| 619 EqualityCompareComp(intptr_t token_pos, | 619 EqualityCompareComp(intptr_t token_pos, |
| 620 intptr_t try_index, | 620 intptr_t try_index, |
| 621 Token::Kind kind, |
| 621 Value* left, | 622 Value* left, |
| 622 Value* right) | 623 Value* right) |
| 623 : ComparisonComp(Token::kEQ, left, right), | 624 : ComparisonComp(kind, left, right), |
| 624 token_pos_(token_pos), | 625 token_pos_(token_pos), |
| 625 try_index_(try_index), | 626 try_index_(try_index), |
| 626 receiver_class_id_(kObject) {} | 627 receiver_class_id_(kObject) { |
| 628 ASSERT((kind == Token::kEQ) || (kind == Token::kNE)); |
| 629 } |
| 627 | 630 |
| 628 DECLARE_COMPUTATION(EqualityCompare) | 631 DECLARE_COMPUTATION(EqualityCompare) |
| 629 | 632 |
| 630 intptr_t token_pos() const { return token_pos_; } | 633 intptr_t token_pos() const { return token_pos_; } |
| 631 intptr_t try_index() const { return try_index_; } | 634 intptr_t try_index() const { return try_index_; } |
| 632 | 635 |
| 633 void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; } | 636 void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; } |
| 634 intptr_t receiver_class_id() const { return receiver_class_id_; } | 637 intptr_t receiver_class_id() const { return receiver_class_id_; } |
| 635 virtual void PrintOperandsTo(BufferFormatter* f) const; | 638 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 636 | 639 |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 ASSERT(!IsGraphEntry()); | 1758 ASSERT(!IsGraphEntry()); |
| 1756 ASSERT(!IsReturn()); | 1759 ASSERT(!IsReturn()); |
| 1757 ASSERT(!IsBranch()); | 1760 ASSERT(!IsBranch()); |
| 1758 ASSERT(!IsPhi()); | 1761 ASSERT(!IsPhi()); |
| 1759 ASSERT(instr == NULL || !instr->IsBlockEntry()); | 1762 ASSERT(instr == NULL || !instr->IsBlockEntry()); |
| 1760 // TODO(fschneider): Also add Throw and ReThrow to the list of instructions | 1763 // TODO(fschneider): Also add Throw and ReThrow to the list of instructions |
| 1761 // that do not have a successor. Currently, the graph builder will continue | 1764 // that do not have a successor. Currently, the graph builder will continue |
| 1762 // to append instruction in case of a Throw inside an expression. This | 1765 // to append instruction in case of a Throw inside an expression. This |
| 1763 // condition should be handled in the graph builder | 1766 // condition should be handled in the graph builder |
| 1764 next_ = instr; | 1767 next_ = instr; |
| 1765 if ((instr != NULL) && !instr->IsBlockEntry()) { | |
| 1766 instr->set_previous(this); | |
| 1767 } | |
| 1768 } | 1768 } |
| 1769 | 1769 |
| 1770 // Normal instructions can have 0 (inside a block) or 1 (last instruction in | 1770 // Normal instructions can have 0 (inside a block) or 1 (last instruction in |
| 1771 // a block) successors. Branch instruction with >1 successors override this | 1771 // a block) successors. Branch instruction with >1 successors override this |
| 1772 // function. | 1772 // function. |
| 1773 virtual intptr_t SuccessorCount() const; | 1773 virtual intptr_t SuccessorCount() const; |
| 1774 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; | 1774 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; |
| 1775 | 1775 |
| 1776 void Goto(JoinEntryInstr* entry); | 1776 void Goto(JoinEntryInstr* entry); |
| 1777 | 1777 |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 const GrowableArray<BlockEntryInstr*>& block_order_; | 2519 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2520 | 2520 |
| 2521 private: | 2521 private: |
| 2522 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2522 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2523 }; | 2523 }; |
| 2524 | 2524 |
| 2525 | 2525 |
| 2526 } // namespace dart | 2526 } // namespace dart |
| 2527 | 2527 |
| 2528 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2528 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |