< prev index next >
src/hotspot/share/runtime/biasedLocking.cpp
Print this page
rev 56205 : imported patch 8226705-v1
*** 724,733 ****
--- 724,754 ----
}
assert(!obj->mark().has_bias_pattern(), "must not be biased");
}
+ void BiasedLocking::revoke_own_locks(Handle obj, TRAPS) {
+ markWord mark = obj->mark();
+
+ if (!mark.has_bias_pattern()) {
+ return;
+ }
+
+ Klass *k = obj->klass();
+ markWord prototype_header = k->prototype_header();
+ assert(mark.biased_locker() == THREAD &&
+ prototype_header.bias_epoch() == mark.bias_epoch(), "Revoke failed, unhandled biased lock state");
+ ResourceMark rm;
+ log_info(biasedlocking)("Revoking bias by walking my own stack:");
+ EventBiasedLockSelfRevocation event;
+ BiasedLocking::walk_stack_and_revoke(obj(), (JavaThread*) THREAD);
+ ((JavaThread*) THREAD)->set_cached_monitor_info(NULL);
+ assert(!obj->mark().has_bias_pattern(), "invariant");
+ if (event.should_commit()) {
+ post_self_revocation_event(&event, k);
+ }
+ }
void BiasedLocking::revoke(Handle obj, TRAPS) {
assert(!SafepointSynchronize::is_at_safepoint(), "must not be called while at safepoint");
while (true) {
*** 862,888 ****
clean_up_cached_monitor_info();
}
}
- void BiasedLocking::revoke_at_safepoint(GrowableArray<Handle>* objs) {
- assert(SafepointSynchronize::is_at_safepoint(), "must only be called while at safepoint");
- int len = objs->length();
- for (int i = 0; i < len; i++) {
- oop obj = (objs->at(i))();
- HeuristicsResult heuristics = update_heuristics(obj);
- if (heuristics == HR_SINGLE_REVOKE) {
- single_revoke_at_safepoint(obj, false, NULL, NULL);
- } else if ((heuristics == HR_BULK_REBIAS) ||
- (heuristics == HR_BULK_REVOKE)) {
- bulk_revoke_at_safepoint(obj, (heuristics == HR_BULK_REBIAS), NULL);
- }
- }
- clean_up_cached_monitor_info();
- }
-
-
void BiasedLocking::preserve_marks() {
if (!UseBiasedLocking)
return;
assert(SafepointSynchronize::is_at_safepoint(), "must only be called while at safepoint");
--- 883,892 ----
< prev index next >