< prev index next >
src/hotspot/share/runtime/biasedLocking.cpp
Print this page
rev 47316 : 8187042: Event to show which objects are associated with biased object revocations
*** 33,42 ****
--- 33,43 ----
#include "runtime/biasedLocking.hpp"
#include "runtime/task.hpp"
#include "runtime/vframe.hpp"
#include "runtime/vmThread.hpp"
#include "runtime/vm_operations.hpp"
+ #include "trace/tracing.hpp"
static bool _biased_locking_enabled = false;
BiasedLockingCounters BiasedLocking::_counters;
static GrowableArray<Handle>* _preserved_oop_stack = NULL;
*** 646,667 ****
--- 647,683 ----
BiasedLocking::Condition cond = revoke_bias(obj(), false, false, (JavaThread*) THREAD);
((JavaThread*) THREAD)->set_cached_monitor_info(NULL);
assert(cond == BIAS_REVOKED, "why not?");
return cond;
} else {
+ EventBiasedLockRevocation event;
VM_RevokeBias revoke(&obj, (JavaThread*) THREAD);
VMThread::execute(&revoke);
+ if (event.should_commit() && (revoke.status_code() != NOT_BIASED)) {
+ event.set_lockClass(k);
+ // Subtract 1 to match the id of events committed inside the safepoint
+ event.set_safepointId(SafepointSynchronize::safepoint_counter() - 1);
+ event.commit();
+ }
return revoke.status_code();
}
}
assert((heuristics == HR_BULK_REVOKE) ||
(heuristics == HR_BULK_REBIAS), "?");
+ EventBiasedLockClassRevocation event;
VM_BulkRevokeBias bulk_revoke(&obj, (JavaThread*) THREAD,
(heuristics == HR_BULK_REBIAS),
attempt_rebias);
VMThread::execute(&bulk_revoke);
+ if (event.should_commit()) {
+ event.set_revokedClass(obj->klass());
+ event.set_disableBiasing((heuristics != HR_BULK_REBIAS));
+ // Subtract 1 to match the id of events committed inside the safepoint
+ event.set_safepointId(SafepointSynchronize::safepoint_counter() - 1);
+ event.commit();
+ }
return bulk_revoke.status_code();
}
void BiasedLocking::revoke(GrowableArray<Handle>* objs) {
< prev index next >