src/share/vm/oops/markOop.inline.hpp

changeset 2380
74ee0db180fa
parent 2314
f95d63e2154a
child 4037
da91efe96a93
     1.1 --- a/src/share/vm/oops/markOop.inline.hpp	Fri Dec 17 11:26:53 2010 -0800
     1.2 +++ b/src/share/vm/oops/markOop.inline.hpp	Fri Dec 17 23:41:31 2010 -0800
     1.3 @@ -30,7 +30,7 @@
     1.4  #include "oops/markOop.hpp"
     1.5  #include "runtime/globals.hpp"
     1.6  
     1.7 -// Should this header be preserved during GC?
     1.8 +// Should this header be preserved during GC (when biased locking is enabled)?
     1.9  inline bool markOopDesc::must_be_preserved_with_bias(oop obj_containing_mark) const {
    1.10    assert(UseBiasedLocking, "unexpected");
    1.11    if (has_bias_pattern()) {
    1.12 @@ -47,14 +47,15 @@
    1.13    return (!is_unlocked() || !has_no_hash());
    1.14  }
    1.15  
    1.16 +// Should this header be preserved during GC?
    1.17  inline bool markOopDesc::must_be_preserved(oop obj_containing_mark) const {
    1.18    if (!UseBiasedLocking)
    1.19      return (!is_unlocked() || !has_no_hash());
    1.20    return must_be_preserved_with_bias(obj_containing_mark);
    1.21  }
    1.22  
    1.23 -// Should this header (including its age bits) be preserved in the
    1.24 -// case of a promotion failure during scavenge?
    1.25 +// Should this header be preserved in the case of a promotion failure
    1.26 +// during scavenge (when biased locking is enabled)?
    1.27  inline bool markOopDesc::must_be_preserved_with_bias_for_promotion_failure(oop obj_containing_mark) const {
    1.28    assert(UseBiasedLocking, "unexpected");
    1.29    // We don't explicitly save off the mark words of biased and
    1.30 @@ -70,18 +71,20 @@
    1.31        prototype_for_object(obj_containing_mark)->has_bias_pattern()) {
    1.32      return true;
    1.33    }
    1.34 -  return (this != prototype());
    1.35 +  return (!is_unlocked() || !has_no_hash());
    1.36  }
    1.37  
    1.38 +// Should this header be preserved in the case of a promotion failure
    1.39 +// during scavenge?
    1.40  inline bool markOopDesc::must_be_preserved_for_promotion_failure(oop obj_containing_mark) const {
    1.41    if (!UseBiasedLocking)
    1.42 -    return (this != prototype());
    1.43 +    return (!is_unlocked() || !has_no_hash());
    1.44    return must_be_preserved_with_bias_for_promotion_failure(obj_containing_mark);
    1.45  }
    1.46  
    1.47  
    1.48 -// Should this header (including its age bits) be preserved in the
    1.49 -// case of a scavenge in which CMS is the old generation?
    1.50 +// Same as must_be_preserved_with_bias_for_promotion_failure() except that
    1.51 +// it takes a klassOop argument, instead of the object of which this is the mark word.
    1.52  inline bool markOopDesc::must_be_preserved_with_bias_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const {
    1.53    assert(UseBiasedLocking, "unexpected");
    1.54    // CMS scavenges preserve mark words in similar fashion to promotion failures; see above
    1.55 @@ -89,11 +92,14 @@
    1.56        klass_of_obj_containing_mark->klass_part()->prototype_header()->has_bias_pattern()) {
    1.57      return true;
    1.58    }
    1.59 -  return (this != prototype());
    1.60 +  return (!is_unlocked() || !has_no_hash());
    1.61  }
    1.62 +
    1.63 +// Same as must_be_preserved_for_promotion_failure() except that
    1.64 +// it takes a klassOop argument, instead of the object of which this is the mark word.
    1.65  inline bool markOopDesc::must_be_preserved_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const {
    1.66    if (!UseBiasedLocking)
    1.67 -    return (this != prototype());
    1.68 +    return (!is_unlocked() || !has_no_hash());
    1.69    return must_be_preserved_with_bias_for_cms_scavenge(klass_of_obj_containing_mark);
    1.70  }
    1.71  

mercurial