Mercurial > hg > graal-jvmci-8
diff src/share/vm/oops/markOop.hpp @ 6818:22b8d3d181d9
8000351: Tenuring threshold should be unsigned
Summary: Change the flags and variables related to tenuring threshold to be unsigned
Reviewed-by: jmasa, johnc
author | jwilhelm |
---|---|
date | Wed, 03 Oct 2012 20:31:41 +0200 |
parents | da91efe96a93 |
children |
line wrap: on
line diff
--- a/src/share/vm/oops/markOop.hpp Wed Oct 03 08:08:52 2012 -0700 +++ b/src/share/vm/oops/markOop.hpp Wed Oct 03 20:31:41 2012 +0200 @@ -318,7 +318,7 @@ intptr_t tmp = (intptr_t) monitor; return (markOop) (tmp | monitor_value); } - static markOop encode(JavaThread* thread, int age, int bias_epoch) { + static markOop encode(JavaThread* thread, uint age, int bias_epoch) { intptr_t tmp = (intptr_t) thread; assert(UseBiasedLocking && ((tmp & (epoch_mask_in_place | age_mask_in_place | biased_lock_mask_in_place)) == 0), "misaligned JavaThread pointer"); assert(age <= max_age, "age too large"); @@ -333,10 +333,10 @@ markOop set_marked() { return markOop((value() & ~lock_mask_in_place) | marked_value); } markOop set_unmarked() { return markOop((value() & ~lock_mask_in_place) | unlocked_value); } - int age() const { return mask_bits(value() >> age_shift, age_mask); } - markOop set_age(int v) const { + uint age() const { return mask_bits(value() >> age_shift, age_mask); } + markOop set_age(uint v) const { assert((v & ~age_mask) == 0, "shouldn't overflow age field"); - return markOop((value() & ~age_mask_in_place) | (((intptr_t)v & age_mask) << age_shift)); + return markOop((value() & ~age_mask_in_place) | (((uintptr_t)v & age_mask) << age_shift)); } markOop incr_age() const { return age() == max_age ? markOop(this) : set_age(age() + 1); }