| 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 |
| 93 INLINE(~Label()) { | 94 INLINE(~Label()) { |
| 94 ASSERT(!is_linked()); | 95 ASSERT(!is_linked()); |
| 95 ASSERT(!is_near_linked()); | 96 ASSERT(!is_near_linked()); |
| 96 } | 97 } |
| 97 | 98 |
| 98 INLINE(void Unuse()) { pos_ = 0; } | 99 INLINE(void Unuse()) { pos_ = 0; } |
| 99 INLINE(void UnuseNear()) { near_link_pos_ = 0; } | 100 INLINE(void UnuseNear()) { near_link_pos_ = 0; } |
| 100 | 101 |
| 101 INLINE(bool is_bound() const) { return pos_ < 0; } | 102 INLINE(bool is_bound() const) { return pos_ < 0; } |
| 102 INLINE(bool is_unused() const) { return pos_ == 0 && near_link_pos_ == 0; } | 103 INLINE(bool is_unused() const) { return pos_ == 0 && near_link_pos_ == 0; } |
| 103 INLINE(bool is_linked() const) { return pos_ > 0; } | 104 INLINE(bool is_linked() const) { return pos_ > 0; } |
| 104 INLINE(bool is_near_linked() const) { return near_link_pos_ > 0; } | 105 INLINE(bool is_near_linked() const) { return near_link_pos_ > 0; } |
| 105 | 106 |
| 106 // Returns the position of bound or linked labels. Cannot be used | 107 // Returns the position of bound or linked labels. Cannot be used |
| 107 // for unused labels. | 108 // for unused labels. |
| 108 int pos() const; | 109 int pos() const; |
| 109 int near_link_pos() const { return near_link_pos_ - 1; } | 110 int near_link_pos() const { return near_link_pos_ - 1; } |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 // pos_ encodes both the binding state (via its sign) | 113 // pos_ encodes both the binding state (via its sign) |
| 113 // and the binding position (via its value) of a label. | 114 // and the binding position (via its value) of a label. |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 public: | 866 public: |
| 866 NullCallWrapper() { } | 867 NullCallWrapper() { } |
| 867 virtual ~NullCallWrapper() { } | 868 virtual ~NullCallWrapper() { } |
| 868 virtual void BeforeCall(int call_size) const { } | 869 virtual void BeforeCall(int call_size) const { } |
| 869 virtual void AfterCall() const { } | 870 virtual void AfterCall() const { } |
| 870 }; | 871 }; |
| 871 | 872 |
| 872 } } // namespace v8::internal | 873 } } // namespace v8::internal |
| 873 | 874 |
| 874 #endif // V8_ASSEMBLER_H_ | 875 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |