staticvoid assert_epoch_identity(JavaThread* jt, u2 current_epoch) {
assert_precondition(jt); // Verify the epoch updates got written through also to the vthread object. const u2 epoch_raw = ThreadIdAccess::epoch(jt->vthread()); constbool excluded = epoch_raw & excluded_bit;
assert(!excluded, "invariant");
assert(!JfrThreadLocal::is_excluded(jt), "invariant"); const u2 vthread_epoch = epoch_raw & epoch_mask;
assert(vthread_epoch == current_epoch, "invariant");
} #endif// ASSERT
void* JfrIntrinsicSupport::write_checkpoint(JavaThread* jt) {
DEBUG_ONLY(assert_precondition(jt);)
assert(JfrThreadLocal::is_vthread(jt), "invariant"); const u2 vthread_thread_local_epoch = JfrThreadLocal::vthread_epoch(jt); const u2 current_epoch = ThreadIdAccess::current_epoch(); if (vthread_thread_local_epoch == current_epoch) { // After the epoch test in the intrinsic, the thread sampler interleaved // and suspended the thread. As part of taking a sample, it updated // the vthread object and the thread local "for us". We are good.
DEBUG_ONLY(assert_epoch_identity(jt, current_epoch);)
ThreadInVMfromJava transition(jt); return JfrJavaEventWriter::event_writer(jt);
} const traceid vthread_tid = JfrThreadLocal::vthread_id(jt); // Transition before reading the epoch generation anew, now as _thread_in_vm. Can safepoint here.
ThreadInVMfromJava transition(jt);
JfrThreadLocal::set_vthread_epoch(jt, vthread_tid, ThreadIdAccess::current_epoch()); return JfrJavaEventWriter::event_writer(jt);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.