250 // other thread. (They should spin or block instead. The 0 value |
250 // other thread. (They should spin or block instead. The 0 value |
251 // is transient and *should* be short-lived). |
251 // is transient and *should* be short-lived). |
252 static markWord INFLATING() { return zero(); } // inflate-in-progress |
252 static markWord INFLATING() { return zero(); } // inflate-in-progress |
253 |
253 |
254 // Should this header be preserved during GC? |
254 // Should this header be preserved during GC? |
255 inline bool must_be_preserved(oop obj_containing_mark) const; |
255 template <typename KlassProxy> |
256 inline bool must_be_preserved_with_bias(oop obj_containing_mark) const; |
256 inline bool must_be_preserved(KlassProxy klass) const; |
257 |
257 |
258 // Should this header (including its age bits) be preserved in the |
258 // Should this header (including its age bits) be preserved in the |
259 // case of a promotion failure during scavenge? |
259 // case of a promotion failure during scavenge? |
260 // Note that we special case this situation. We want to avoid |
260 // Note that we special case this situation. We want to avoid |
261 // calling BiasedLocking::preserve_marks()/restore_marks() (which |
261 // calling BiasedLocking::preserve_marks()/restore_marks() (which |
270 // place in which to call them in any of the scavengers (although |
270 // place in which to call them in any of the scavengers (although |
271 // guarded by appropriate locks we could make one), but the |
271 // guarded by appropriate locks we could make one), but the |
272 // observation is that promotion failures are quite rare and |
272 // observation is that promotion failures are quite rare and |
273 // reducing the number of mark words preserved during them isn't a |
273 // reducing the number of mark words preserved during them isn't a |
274 // high priority. |
274 // high priority. |
275 inline bool must_be_preserved_for_promotion_failure(oop obj_containing_mark) const; |
275 template <typename KlassProxy> |
276 inline bool must_be_preserved_with_bias_for_promotion_failure(oop obj_containing_mark) const; |
276 inline bool must_be_preserved_for_promotion_failure(KlassProxy klass) const; |
277 |
277 |
278 // Should this header be preserved during a scavenge where CMS is |
278 // Should this header be preserved during a scavenge where CMS is |
279 // the old generation? |
279 // the old generation? |
280 // (This is basically the same body as must_be_preserved_for_promotion_failure(), |
280 // (This is basically the same body as must_be_preserved_for_promotion_failure(), |
281 // but takes the Klass* as argument instead) |
281 // but takes the Klass* as argument instead) |
282 inline bool must_be_preserved_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const; |
282 inline bool must_be_preserved_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const; |
283 inline bool must_be_preserved_with_bias_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const; |
|
284 |
283 |
285 // WARNING: The following routines are used EXCLUSIVELY by |
284 // WARNING: The following routines are used EXCLUSIVELY by |
286 // synchronization functions. They are not really gc safe. |
285 // synchronization functions. They are not really gc safe. |
287 // They must get updated if markWord layout get changed. |
286 // They must get updated if markWord layout get changed. |
288 markWord set_unlocked() const { |
287 markWord set_unlocked() const { |
370 static markWord prototype() { |
369 static markWord prototype() { |
371 return markWord( no_hash_in_place | no_lock_in_place ); |
370 return markWord( no_hash_in_place | no_lock_in_place ); |
372 } |
371 } |
373 |
372 |
374 // Helper function for restoration of unmarked mark oops during GC |
373 // Helper function for restoration of unmarked mark oops during GC |
375 static inline markWord prototype_for_object(oop obj); |
374 static inline markWord prototype_for_klass(const Klass* klass); |
376 |
375 |
377 // Debugging |
376 // Debugging |
378 void print_on(outputStream* st) const; |
377 void print_on(outputStream* st) const; |
379 |
378 |
380 // Prepare address of oop for placement into mark |
379 // Prepare address of oop for placement into mark |