| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 | 44 |
| 45 // ----------------------------------------------------------------------------- | 45 // ----------------------------------------------------------------------------- |
| 46 // Labels represent pc locations; they are typically jump or call targets. | 46 // Labels represent pc locations; they are typically jump or call targets. |
| 47 // After declaration, a label can be freely used to denote known or (yet) | 47 // After declaration, a label can be freely used to denote known or (yet) |
| 48 // unknown pc location. Assembler::bind() is used to bind a label to the | 48 // unknown pc location. Assembler::bind() is used to bind a label to the |
| 49 // current pc. A label can be bound only once. | 49 // current pc. A label can be bound only once. |
| 50 | 50 |
| 51 class Label : public ZoneObject { // LabelShadows are dynamically allocated. | 51 class Label : public ZoneObject { // LabelShadows are dynamically allocated. |
| 52 public: | 52 public: |
| 53 INLINE(Label()) { Unuse(); } | 53 INLINE(Label()) |
| 54 { Unuse(); } |
| 54 INLINE(~Label()) { ASSERT(!is_linked()); } | 55 INLINE(~Label()) { ASSERT(!is_linked()); } |
| 55 | 56 |
| 56 INLINE(void Unuse()) { pos_ = 0; } | 57 INLINE(void Unuse()) { pos_ = 0; } |
| 57 | 58 |
| 58 INLINE(bool is_bound() const) { return pos_ < 0; } | 59 INLINE(bool is_bound() const) { return pos_ < 0; } |
| 59 INLINE(bool is_unused() const) { return pos_ == 0; } | 60 INLINE(bool is_unused() const) { return pos_ == 0; } |
| 60 INLINE(bool is_linked() const) { return pos_ > 0; } | 61 INLINE(bool is_linked() const) { return pos_ > 0; } |
| 61 | 62 |
| 62 // Returns the position of bound or linked labels. Cannot be used | 63 // Returns the position of bound or linked labels. Cannot be used |
| 63 // for unused labels. | 64 // for unused labels. |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 static inline bool is_uint4(int x) { return is_uintn(x, 4); } | 471 static inline bool is_uint4(int x) { return is_uintn(x, 4); } |
| 471 static inline bool is_uint5(int x) { return is_uintn(x, 5); } | 472 static inline bool is_uint5(int x) { return is_uintn(x, 5); } |
| 472 static inline bool is_uint8(int x) { return is_uintn(x, 8); } | 473 static inline bool is_uint8(int x) { return is_uintn(x, 8); } |
| 473 static inline bool is_uint12(int x) { return is_uintn(x, 12); } | 474 static inline bool is_uint12(int x) { return is_uintn(x, 12); } |
| 474 static inline bool is_uint16(int x) { return is_uintn(x, 16); } | 475 static inline bool is_uint16(int x) { return is_uintn(x, 16); } |
| 475 static inline bool is_uint24(int x) { return is_uintn(x, 24); } | 476 static inline bool is_uint24(int x) { return is_uintn(x, 24); } |
| 476 | 477 |
| 477 } } // namespace v8::internal | 478 } } // namespace v8::internal |
| 478 | 479 |
| 479 #endif // V8_ASSEMBLER_H_ | 480 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |