@@ -189,33 +189,28 @@ class markWord {
189189 bool has_monitor () const {
190190 return ((value () & lock_mask_in_place) == monitor_value);
191191 }
192+ markWord set_has_monitor () const {
193+ return markWord ((value () & ~lock_mask_in_place) | monitor_value);
194+ }
192195 ObjectMonitor* monitor () const {
193196 assert (has_monitor (), " check" );
194197 assert (!UseObjectMonitorTable, " Locking with OM table does not use markWord for monitors" );
195198 // Use xor instead of &~ to provide one extra tag-bit check.
196199 return (ObjectMonitor*) (value () ^ monitor_value);
197200 }
198- bool has_displaced_mark_helper () const {
199- intptr_t lockbits = value () & lock_mask_in_place;
200- return !UseObjectMonitorTable && lockbits == monitor_value;
201- }
202- markWord displaced_mark_helper () const ;
203- void set_displaced_mark_helper (markWord m) const ;
204- markWord copy_set_hash (intptr_t hash) const {
205- uintptr_t tmp = value () & (~hash_mask_in_place);
206- tmp |= ((hash & hash_mask) << hash_shift);
207- return markWord (tmp);
208- }
209201
210202 static markWord encode (ObjectMonitor* monitor) {
211203 assert (!UseObjectMonitorTable, " Locking with OM table does not use markWord for monitors" );
212204 uintptr_t tmp = (uintptr_t ) monitor;
213205 return markWord (tmp | monitor_value);
214206 }
215207
216- markWord set_has_monitor () const {
217- return markWord ((value () & ~lock_mask_in_place) | monitor_value);
208+ bool has_displaced_mark_helper () const {
209+ intptr_t lockbits = value () & lock_mask_in_place;
210+ return !UseObjectMonitorTable && lockbits == monitor_value;
218211 }
212+ markWord displaced_mark_helper () const ;
213+ void set_displaced_mark_helper (markWord m) const ;
219214
220215 // used to encode pointers during GC
221216 markWord clear_lock_bits () const { return markWord (value () & ~lock_mask_in_place); }
@@ -240,6 +235,12 @@ class markWord {
240235 return hash () == no_hash;
241236 }
242237
238+ markWord copy_set_hash (intptr_t hash) const {
239+ uintptr_t tmp = value () & (~hash_mask_in_place);
240+ tmp |= ((hash & hash_mask) << hash_shift);
241+ return markWord (tmp);
242+ }
243+
243244 inline Klass* klass () const ;
244245 inline Klass* klass_or_null () const ;
245246 inline Klass* klass_without_asserts () const ;
0 commit comments