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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 776 |
777 typedef EnumSet<GVNFlag> GVNFlagSet; | 777 typedef EnumSet<GVNFlag> GVNFlagSet; |
778 | 778 |
779 | 779 |
780 class HValue: public ZoneObject { | 780 class HValue: public ZoneObject { |
781 public: | 781 public: |
782 static const int kNoNumber = -1; | 782 static const int kNoNumber = -1; |
783 | 783 |
784 enum Flag { | 784 enum Flag { |
785 kFlexibleRepresentation, | 785 kFlexibleRepresentation, |
| 786 kCannotBeTagged, |
786 // Participate in Global Value Numbering, i.e. elimination of | 787 // Participate in Global Value Numbering, i.e. elimination of |
787 // unnecessary recomputations. If an instruction sets this flag, it must | 788 // unnecessary recomputations. If an instruction sets this flag, it must |
788 // implement DataEquals(), which will be used to determine if other | 789 // implement DataEquals(), which will be used to determine if other |
789 // occurrences of the instruction are indeed the same. | 790 // occurrences of the instruction are indeed the same. |
790 kUseGVN, | 791 kUseGVN, |
791 // Track instructions that are dominating side effects. If an instruction | 792 // Track instructions that are dominating side effects. If an instruction |
792 // sets this flag, it must implement SetSideEffectDominator() and should | 793 // sets this flag, it must implement SetSideEffectDominator() and should |
793 // indicate which side effects to track by setting GVN flags. | 794 // indicate which side effects to track by setting GVN flags. |
794 kTrackSideEffectDominators, | 795 kTrackSideEffectDominators, |
795 kCanOverflow, | 796 kCanOverflow, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 void set_id(int id) { id_ = id; } | 884 void set_id(int id) { id_ = id; } |
884 | 885 |
885 HUseIterator uses() const { return HUseIterator(use_list_); } | 886 HUseIterator uses() const { return HUseIterator(use_list_); } |
886 | 887 |
887 virtual bool EmitAtUses() { return false; } | 888 virtual bool EmitAtUses() { return false; } |
888 Representation representation() const { return representation_; } | 889 Representation representation() const { return representation_; } |
889 void ChangeRepresentation(Representation r) { | 890 void ChangeRepresentation(Representation r) { |
890 ASSERT(CheckFlag(kFlexibleRepresentation)); | 891 ASSERT(CheckFlag(kFlexibleRepresentation)); |
891 RepresentationChanged(r); | 892 RepresentationChanged(r); |
892 representation_ = r; | 893 representation_ = r; |
893 if (r.IsTagged()) { | 894 if (r.IsTagged() || |
| 895 (r.IsDouble() && CheckFlag(kCannotBeTagged))) { |
894 // Tagged is the bottom of the lattice, don't go any further. | 896 // Tagged is the bottom of the lattice, don't go any further. |
895 ClearFlag(kFlexibleRepresentation); | 897 ClearFlag(kFlexibleRepresentation); |
896 } | 898 } |
897 } | 899 } |
898 virtual void AssumeRepresentation(Representation r); | 900 virtual void AssumeRepresentation(Representation r); |
899 | 901 |
900 virtual Representation KnownOptimalRepresentation() { | 902 virtual Representation KnownOptimalRepresentation() { |
901 Representation r = representation(); | 903 Representation r = representation(); |
902 if (r.IsTagged()) { | 904 if (r.IsTagged()) { |
903 HType t = type(); | 905 HType t = type(); |
(...skipping 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6608 virtual bool IsDeletable() const { return true; } | 6610 virtual bool IsDeletable() const { return true; } |
6609 }; | 6611 }; |
6610 | 6612 |
6611 | 6613 |
6612 #undef DECLARE_INSTRUCTION | 6614 #undef DECLARE_INSTRUCTION |
6613 #undef DECLARE_CONCRETE_INSTRUCTION | 6615 #undef DECLARE_CONCRETE_INSTRUCTION |
6614 | 6616 |
6615 } } // namespace v8::internal | 6617 } } // namespace v8::internal |
6616 | 6618 |
6617 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6619 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |