34 class PromotedObject VALUE_OBJ_CLASS_SPEC {
35 private:
36 enum {
37 promoted_mask = right_n_bits(2), // i.e. 0x3
38 displaced_mark = nth_bit(2), // i.e. 0x4
39 next_mask = ~(right_n_bits(3)) // i.e. ~(0x7)
40 };
41
42 // Below, we want _narrow_next in the "higher" 32 bit slot,
43 // whose position will depend on endian-ness of the platform.
44 // This is so that there is no interference with the
45 // cms_free_bit occupying bit position 7 (lsb == 0)
46 // when we are using compressed oops; see FreeChunk::is_free().
47 // We cannot move the cms_free_bit down because currently
48 // biased locking code assumes that age bits are contiguous
49 // with the lock bits. Even if that assumption were relaxed,
50 // the least position we could move this bit to would be
51 // to bit position 3, which would require 16 byte alignment.
52 typedef struct {
53 #ifdef VM_LITTLE_ENDIAN
54 LP64_ONLY(narrowOop _pad;)
55 narrowOop _narrow_next;
56 #else
57 narrowOop _narrow_next;
58 LP64_ONLY(narrowOop _pad;)
59 #endif
60 } Data;
61
62 union {
63 intptr_t _next;
64 Data _data;
65 };
66 public:
67 PromotedObject* next() const;
68 void setNext(PromotedObject* x);
69 inline void setPromotedMark() {
70 _next |= promoted_mask;
71 assert(!((FreeChunk*)this)->is_free(), "Error");
72 }
73 inline bool hasPromotedMark() const {
74 assert(!((FreeChunk*)this)->is_free(), "Error");
75 return (_next & promoted_mask) == promoted_mask;
76 }
77 inline void setDisplacedMark() {
78 _next |= displaced_mark;
|
34 class PromotedObject VALUE_OBJ_CLASS_SPEC {
35 private:
36 enum {
37 promoted_mask = right_n_bits(2), // i.e. 0x3
38 displaced_mark = nth_bit(2), // i.e. 0x4
39 next_mask = ~(right_n_bits(3)) // i.e. ~(0x7)
40 };
41
42 // Below, we want _narrow_next in the "higher" 32 bit slot,
43 // whose position will depend on endian-ness of the platform.
44 // This is so that there is no interference with the
45 // cms_free_bit occupying bit position 7 (lsb == 0)
46 // when we are using compressed oops; see FreeChunk::is_free().
47 // We cannot move the cms_free_bit down because currently
48 // biased locking code assumes that age bits are contiguous
49 // with the lock bits. Even if that assumption were relaxed,
50 // the least position we could move this bit to would be
51 // to bit position 3, which would require 16 byte alignment.
52 typedef struct {
53 #ifdef VM_LITTLE_ENDIAN
54 LP64_ONLY(jint _pad;)
55 jint _narrow_next;
56 #else
57 jint _narrow_next;
58 LP64_ONLY(jint _pad;)
59 #endif
60 } Data;
61
62 union {
63 intptr_t _next;
64 Data _data;
65 };
66 public:
67 PromotedObject* next() const;
68 void setNext(PromotedObject* x);
69 inline void setPromotedMark() {
70 _next |= promoted_mask;
71 assert(!((FreeChunk*)this)->is_free(), "Error");
72 }
73 inline bool hasPromotedMark() const {
74 assert(!((FreeChunk*)this)->is_free(), "Error");
75 return (_next & promoted_mask) == promoted_mask;
76 }
77 inline void setDisplacedMark() {
78 _next |= displaced_mark;
|