40 * the code once, but it is problematic in GC hotpath code. 41 * 42 * b. With filler object mechanics, we may need to allocate more space for 43 * the forwarding ptr to meet alignment requirements for objects. This 44 * means *_offset and *_size calls are NOT interchangeable. The accesses 45 * to forwarding ptrs should always be via *_offset. Storage size 46 * calculations should always be via *_size. 47 */ 48 49 /* Offset from the object start, in HeapWords. */ 50 static inline int word_offset() { 51 return -1; // exactly one HeapWord 52 } 53 54 /* Offset from the object start, in bytes. */ 55 static inline int byte_offset() { 56 return -HeapWordSize; // exactly one HeapWord 57 } 58 59 /* Allocated size, in HeapWords. */ 60 static inline size_t word_size() { 61 return MinObjAlignment; 62 } 63 64 /* Allocated size, in bytes */ 65 static inline size_t byte_size() { 66 return MinObjAlignmentInBytes; 67 } 68 69 /* Initializes Brooks pointer (to self). 70 */ 71 static inline void initialize(oop obj); 72 73 /* Gets forwardee from the given object. 74 */ 75 static inline oop forwardee(oop obj); 76 77 /* Forcefully sets forwardee in $holder to $update. 78 */ 79 static inline void set_forwardee(oop obj, oop update); 80 81 /* Tries to atomically update forwardee in $holder object to $update. 82 * Assumes $holder points at itself. 83 * Asserts $holder is in from-space. 84 * Asserts $update is in to-space. 85 */ 86 static inline oop try_update_forwardee(oop obj, oop update); | 40 * the code once, but it is problematic in GC hotpath code. 41 * 42 * b. With filler object mechanics, we may need to allocate more space for 43 * the forwarding ptr to meet alignment requirements for objects. This 44 * means *_offset and *_size calls are NOT interchangeable. The accesses 45 * to forwarding ptrs should always be via *_offset. Storage size 46 * calculations should always be via *_size. 47 */ 48 49 /* Offset from the object start, in HeapWords. */ 50 static inline int word_offset() { 51 return -1; // exactly one HeapWord 52 } 53 54 /* Offset from the object start, in bytes. */ 55 static inline int byte_offset() { 56 return -HeapWordSize; // exactly one HeapWord 57 } 58 59 /* Allocated size, in HeapWords. */ 60 static inline uint word_size() { 61 return (uint) MinObjAlignment; 62 } 63 64 /* Allocated size, in bytes */ 65 static inline uint byte_size() { 66 return (uint) MinObjAlignmentInBytes; 67 } 68 69 /* Assert basic stuff once at startup. */ 70 static void initial_checks() { 71 guarantee (MinObjAlignment > 0, "sanity, word_size is correct"); 72 guarantee (MinObjAlignmentInBytes > 0, "sanity, byte_size is correct"); 73 } 74 75 /* Initializes Brooks pointer (to self). 76 */ 77 static inline void initialize(oop obj); 78 79 /* Gets forwardee from the given object. 80 */ 81 static inline oop forwardee(oop obj); 82 83 /* Forcefully sets forwardee in $holder to $update. 84 */ 85 static inline void set_forwardee(oop obj, oop update); 86 87 /* Tries to atomically update forwardee in $holder object to $update. 88 * Assumes $holder points at itself. 89 * Asserts $holder is in from-space. 90 * Asserts $update is in to-space. 91 */ 92 static inline oop try_update_forwardee(oop obj, oop update); |