< prev index next >
src/hotspot/share/runtime/biasedLocking.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 620,630 ****
log_info(biasedlocking, handshake)("JavaThread " INTPTR_FORMAT " handshaking JavaThread "
INTPTR_FORMAT " to revoke object " INTPTR_FORMAT, p2i(requester),
p2i(biaser), p2i(obj()));
RevokeOneBias revoke(obj, requester, biaser);
! bool executed = Handshake::execute(&revoke, biaser);
if (revoke.status_code() == NOT_REVOKED) {
return NOT_REVOKED;
}
if (executed) {
log_info(biasedlocking, handshake)("Handshake revocation for object " INTPTR_FORMAT " succeeded. Bias was %srevoked",
--- 620,630 ----
log_info(biasedlocking, handshake)("JavaThread " INTPTR_FORMAT " handshaking JavaThread "
INTPTR_FORMAT " to revoke object " INTPTR_FORMAT, p2i(requester),
p2i(biaser), p2i(obj()));
RevokeOneBias revoke(obj, requester, biaser);
! bool executed = Handshake::execute_direct(&revoke, biaser);
if (revoke.status_code() == NOT_REVOKED) {
return NOT_REVOKED;
}
if (executed) {
log_info(biasedlocking, handshake)("Handshake revocation for object " INTPTR_FORMAT " succeeded. Bias was %srevoked",
*** 666,676 ****
// Caller should have instantiated a ResourceMark object before calling this method
void BiasedLocking::walk_stack_and_revoke(oop obj, JavaThread* biased_locker) {
assert(!SafepointSynchronize::is_at_safepoint() || !SafepointMechanism::uses_thread_local_poll(),
"if SafepointMechanism::uses_thread_local_poll() is enabled this should always be executed outside safepoints");
! assert(Thread::current() == biased_locker || Thread::current()->is_VM_thread(), "wrong thread");
markWord mark = obj->mark();
assert(mark.biased_locker() == biased_locker &&
obj->klass()->prototype_header().bias_epoch() == mark.bias_epoch(), "invariant");
--- 666,677 ----
// Caller should have instantiated a ResourceMark object before calling this method
void BiasedLocking::walk_stack_and_revoke(oop obj, JavaThread* biased_locker) {
assert(!SafepointSynchronize::is_at_safepoint() || !SafepointMechanism::uses_thread_local_poll(),
"if SafepointMechanism::uses_thread_local_poll() is enabled this should always be executed outside safepoints");
! assert(Thread::current() == biased_locker || Thread::current() == biased_locker->get_active_handshaker() ||
! Thread::current()->is_VM_thread(), "wrong thread");
markWord mark = obj->mark();
assert(mark.biased_locker() == biased_locker &&
obj->klass()->prototype_header().bias_epoch() == mark.bias_epoch(), "invariant");
< prev index next >