OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 class Label BASE_EMBEDDED { | 83 class Label BASE_EMBEDDED { |
84 public: | 84 public: |
85 enum Distance { | 85 enum Distance { |
86 kNear, kFar | 86 kNear, kFar |
87 }; | 87 }; |
88 | 88 |
89 INLINE(Label()) { | 89 INLINE(Label()) { |
90 Unuse(); | 90 Unuse(); |
91 UnuseNear(); | 91 UnuseNear(); |
92 } | 92 } |
93 INLINE(~Label()) { ASSERT(!is_linked()); } | |
94 | 93 |
95 INLINE(void Unuse()) { pos_ = 0; } | 94 INLINE(~Label()) { |
96 INLINE(void UnuseNear()) { near_link_pos_ = 0; } | 95 ASSERT(!is_linked()); |
| 96 ASSERT(!is_near_linked()); |
| 97 } |
97 | 98 |
98 INLINE(bool is_bound() const) { return pos_ < 0; } | 99 INLINE(void Unuse()) { pos_ = 0; } |
99 INLINE(bool is_unused() const) { return pos_ == 0 && near_link_pos_ == 0; } | 100 INLINE(void UnuseNear()) { near_link_pos_ = 0; } |
100 INLINE(bool is_linked() const) { return pos_ > 0; } | 101 |
| 102 INLINE(bool is_bound() const) { return pos_ < 0; } |
| 103 INLINE(bool is_unused() const) { return pos_ == 0 && near_link_pos_ == 0; } |
| 104 INLINE(bool is_linked() const) { return pos_ > 0; } |
101 INLINE(bool is_near_linked() const) { return near_link_pos_ > 0; } | 105 INLINE(bool is_near_linked() const) { return near_link_pos_ > 0; } |
102 | 106 |
103 // Returns the position of bound or linked labels. Cannot be used | 107 // Returns the position of bound or linked labels. Cannot be used |
104 // for unused labels. | 108 // for unused labels. |
105 int pos() const; | 109 int pos() const; |
106 int near_link_pos() const { return near_link_pos_ - 1; } | 110 int near_link_pos() const { return near_link_pos_ - 1; } |
107 | 111 |
108 private: | 112 private: |
109 // pos_ encodes both the binding state (via its sign) | 113 // pos_ encodes both the binding state (via its sign) |
110 // and the binding position (via its value) of a label. | 114 // and the binding position (via its value) of a label. |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 public: | 853 public: |
850 NullCallWrapper() { } | 854 NullCallWrapper() { } |
851 virtual ~NullCallWrapper() { } | 855 virtual ~NullCallWrapper() { } |
852 virtual void BeforeCall(int call_size) const { } | 856 virtual void BeforeCall(int call_size) const { } |
853 virtual void AfterCall() const { } | 857 virtual void AfterCall() const { } |
854 }; | 858 }; |
855 | 859 |
856 } } // namespace v8::internal | 860 } } // namespace v8::internal |
857 | 861 |
858 #endif // V8_ASSEMBLER_H_ | 862 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |