< prev index next >

src/share/vm/runtime/synchronizer.cpp

Print this page

        

*** 22,31 **** --- 22,32 ---- * */ #include "precompiled.hpp" #include "classfile/vmSymbols.hpp" + #include "jfr/jfrEvents.hpp" #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" #include "oops/oop.inline.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/handles.inline.hpp"
*** 1176,1185 **** --- 1177,1195 ---- Thread::muxRelease (&ListLock) ; TEVENT (omFlush) ; } + static void post_monitor_inflate_event(EventJavaMonitorInflate* event, + const oop obj) { + assert(event != NULL, "invariant"); + assert(event->should_commit(), "invariant"); + event->set_monitorClass(obj->klass()); + event->set_address((uintptr_t)(void*)obj); + event->commit(); + } + // Fast path code shared by multiple functions ObjectMonitor* ObjectSynchronizer::inflate_helper(oop obj) { markOop mark = obj->mark(); if (mark->has_monitor()) { assert(ObjectSynchronizer::verify_objmon_isinpool(mark->monitor()), "monitor is invalid");
*** 1198,1207 **** --- 1208,1219 ---- // Inflate mutates the heap ... // Relaxing assertion for bug 6320749. assert (Universe::verify_in_progress() || !SafepointSynchronize::is_at_safepoint(), "invariant") ; + EventJavaMonitorInflate event; + for (;;) { const markOop mark = object->mark() ; assert (!mark->has_bias_pattern(), "invariant") ; // The mark can be in one of the following states:
*** 1328,1337 **** --- 1340,1352 ---- tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", (void *) object, (intptr_t) object->mark(), object->klass()->external_name()); } } + if (event.should_commit()) { + post_monitor_inflate_event(&event, object); + } return m ; } // CASE: neutral // TODO-FIXME: for entry we currently inflate and then try to CAS _owner.
*** 1378,1387 **** --- 1393,1405 ---- tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", (void *) object, (intptr_t) object->mark(), object->klass()->external_name()); } } + if (event.should_commit()) { + post_monitor_inflate_event(&event, object); + } return m ; } } // Note that we could encounter some performance loss through false-sharing as
< prev index next >