943 oop mirror = JNIHandles::resolve_external_guard(object);
944 NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT);
945 NULL_CHECK(info_ptr, JVMTI_ERROR_NULL_POINTER);
946
947 hobj = Handle(current_thread, mirror);
948 }
949
950 JavaThread *owning_thread = NULL;
951 ObjectMonitor *mon = NULL;
952 jvmtiMonitorUsage ret = {
953 NULL, 0, 0, NULL, 0, NULL
954 };
955
956 uint32_t debug_bits = 0;
957 // first derive the object's owner and entry_count (if any)
958 {
959 // Revoke any biases before querying the mark word
960 if (at_safepoint) {
961 BiasedLocking::revoke_at_safepoint(hobj);
962 } else {
963 BiasedLocking::revoke_and_rebias(hobj, false, calling_thread);
964 }
965
966 address owner = NULL;
967 {
968 markWord mark = hobj()->mark();
969
970 if (!mark.has_monitor()) {
971 // this object has a lightweight monitor
972
973 if (mark.has_locker()) {
974 owner = (address)mark.locker(); // save the address of the Lock word
975 }
976 // implied else: no owner
977 } else {
978 // this object has a heavyweight monitor
979 mon = mark.monitor();
980
981 // The owner field of a heavyweight monitor may be NULL for no
982 // owner, a JavaThread * or it may still be the address of the
983 // Lock word in a JavaThread's stack. A monitor can be inflated
|
943 oop mirror = JNIHandles::resolve_external_guard(object);
944 NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT);
945 NULL_CHECK(info_ptr, JVMTI_ERROR_NULL_POINTER);
946
947 hobj = Handle(current_thread, mirror);
948 }
949
950 JavaThread *owning_thread = NULL;
951 ObjectMonitor *mon = NULL;
952 jvmtiMonitorUsage ret = {
953 NULL, 0, 0, NULL, 0, NULL
954 };
955
956 uint32_t debug_bits = 0;
957 // first derive the object's owner and entry_count (if any)
958 {
959 // Revoke any biases before querying the mark word
960 if (at_safepoint) {
961 BiasedLocking::revoke_at_safepoint(hobj);
962 } else {
963 BiasedLocking::revoke(hobj, calling_thread);
964 }
965
966 address owner = NULL;
967 {
968 markWord mark = hobj()->mark();
969
970 if (!mark.has_monitor()) {
971 // this object has a lightweight monitor
972
973 if (mark.has_locker()) {
974 owner = (address)mark.locker(); // save the address of the Lock word
975 }
976 // implied else: no owner
977 } else {
978 // this object has a heavyweight monitor
979 mon = mark.monitor();
980
981 // The owner field of a heavyweight monitor may be NULL for no
982 // owner, a JavaThread * or it may still be the address of the
983 // Lock word in a JavaThread's stack. A monitor can be inflated
|