< prev index next >
src/hotspot/share/runtime/biasedLocking.cpp
Print this page
*** 43,53 ****
static bool _biased_locking_enabled = false;
BiasedLockingCounters BiasedLocking::_counters;
! static GrowableArray<Handle>* _preserved_oop_stack = NULL;
static GrowableArray<markWord>* _preserved_mark_stack = NULL;
static void enable_biased_locking(InstanceKlass* k) {
k->set_prototype_header(markWord::biased_locking_prototype());
}
--- 43,53 ----
static bool _biased_locking_enabled = false;
BiasedLockingCounters BiasedLocking::_counters;
! static GrowableArray<Handle>* _preserved_oop_stack = NULL;
static GrowableArray<markWord>* _preserved_mark_stack = NULL;
static void enable_biased_locking(InstanceKlass* k) {
k->set_prototype_header(markWord::biased_locking_prototype());
}
*** 476,486 ****
if (attempt_rebias_of_object &&
o->mark().has_bias_pattern() &&
klass->prototype_header().has_bias_pattern()) {
markWord new_mark = markWord::encode(requesting_thread, o->mark().age(),
! klass->prototype_header().bias_epoch());
o->set_mark(new_mark);
status_code = BIAS_REVOKED_AND_REBIASED;
log_info(biasedlocking)(" Rebiased object toward thread " INTPTR_FORMAT, (intptr_t) requesting_thread);
}
--- 476,486 ----
if (attempt_rebias_of_object &&
o->mark().has_bias_pattern() &&
klass->prototype_header().has_bias_pattern()) {
markWord new_mark = markWord::encode(requesting_thread, o->mark().age(),
! klass->prototype_header().bias_epoch());
o->set_mark(new_mark);
status_code = BIAS_REVOKED_AND_REBIASED;
log_info(biasedlocking)(" Rebiased object toward thread " INTPTR_FORMAT, (intptr_t) requesting_thread);
}
*** 690,700 ****
return NOT_BIASED;
}
ThreadsListHandle tlh;
markWord prototype = obj->klass()->prototype_header();
if (!prototype.has_bias_pattern() || (!tlh.includes(biaser) && biaser == mark.biased_locker() &&
! prototype.bias_epoch() == mark.bias_epoch())) {
obj->cas_set_mark(markWord::prototype().set_age(mark.age()), mark);
if (event.should_commit()) {
post_revocation_event(&event, obj->klass(), &revoke);
}
assert(!obj->mark().has_bias_pattern(), "bias should be revoked by now");
--- 690,700 ----
return NOT_BIASED;
}
ThreadsListHandle tlh;
markWord prototype = obj->klass()->prototype_header();
if (!prototype.has_bias_pattern() || (!tlh.includes(biaser) && biaser == mark.biased_locker() &&
! prototype.bias_epoch() == mark.bias_epoch())) {
obj->cas_set_mark(markWord::prototype().set_age(mark.age()), mark);
if (event.should_commit()) {
post_revocation_event(&event, obj->klass(), &revoke);
}
assert(!obj->mark().has_bias_pattern(), "bias should be revoked by now");
*** 811,821 ****
// to rebias or revoke the bias of this object we can do it
// efficiently enough with a CAS that we shouldn't update the
// heuristics. This is normally done in the assembly code but we
// can reach this point due to various points in the runtime
// needing to revoke biases.
! markWord res_mark(0);
if (attempt_rebias) {
assert(THREAD->is_Java_thread(), "");
markWord biased_value = mark;
markWord rebiased_prototype = markWord::encode((JavaThread*) THREAD, mark.age(), prototype_header.bias_epoch());
res_mark = obj->cas_set_mark(rebiased_prototype, mark);
--- 811,821 ----
// to rebias or revoke the bias of this object we can do it
// efficiently enough with a CAS that we shouldn't update the
// heuristics. This is normally done in the assembly code but we
// can reach this point due to various points in the runtime
// needing to revoke biases.
! markWord res_mark;
if (attempt_rebias) {
assert(THREAD->is_Java_thread(), "");
markWord biased_value = mark;
markWord rebiased_prototype = markWord::encode((JavaThread*) THREAD, mark.age(), prototype_header.bias_epoch());
res_mark = obj->cas_set_mark(rebiased_prototype, mark);
< prev index next >