Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8256811: Delayed/missed jdwp class unloading events #9168

Closed
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
580d0ce
v0
Jun 14, 2022
1434ced
Add test
Jun 14, 2022
681cbb5
Update
Jun 14, 2022
911e8e5
Update
Jun 14, 2022
c1293f5
Remove empty line
Jun 14, 2022
d8e961c
Cleanup
Jun 14, 2022
b48ba1b
Update
Jun 14, 2022
abfe1aa
Remove redundant check
Jun 15, 2022
2fdfba9
v1
Jun 21, 2022
87a25b2
v2
Jun 21, 2022
44cc76a
v0
Jun 22, 2022
6bee14b
Merge branch 'jdi_tmp' into JDK-8256811-jdi-missing-class-unloading-e…
Jun 22, 2022
9edaea7
Merge branch 'master' into JDK-8256811-jdi-missing-class-unloading-event
Jun 22, 2022
a286c0c
v2
Jun 22, 2022
6cbe888
v3
Jun 22, 2022
89da788
v4
Jun 23, 2022
f521a03
Merge branch 'master' into JDK-8256811-jdi-missing-class-unloading-event
Jun 23, 2022
559b4bf
Improve naming and cleanup
Jun 23, 2022
2d9a81e
v5
Jun 27, 2022
bf334b1
Renamed eventHandler_synthesizeUnloadEvent
Jun 28, 2022
759e305
Removed HiddenClass test from Problem.txt and cleanup test
Jun 29, 2022
0b74710
Adding log for debugging test failure on Windows
Jun 29, 2022
4a2f49e
debug test
Jun 29, 2022
1c91f24
Use Shenandoah GC for debuggee for deterministic
Jun 29, 2022
e0338c4
Fix test
Jun 30, 2022
425521f
Moved TestClassUnloadEvents.java to new location
Jun 30, 2022
a07b373
Merge branch 'master' into JDK-8256811-jdi-missing-class-unloading-event
Jun 30, 2022
d265b76
Incorporated plummercj's test changes
Jul 1, 2022
b474927
Fix test to ensure class unloading
Jul 11, 2022
6fed417
plummercj's comment
Jul 11, 2022
c45dd04
Merge
Jul 11, 2022
9205633
Rename test
Jul 12, 2022
6f14f45
Fix race
Jul 12, 2022
6ef6c2f
Fix a bug
Jul 12, 2022
fce565d
Coleen's comments
Jul 18, 2022
902f0ff
Don't freeing objects and posting events from JvmtiEnv::GetObjectsWit…
Jul 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/hotspot/share/prims/jvmtiExport.cpp
Expand Up @@ -1690,20 +1690,25 @@ void JvmtiExport::continuation_yield_cleanup(JavaThread* thread, jint continuati
}
}

void JvmtiExport::post_object_free(JvmtiEnv* env, jlong tag) {
Thread *thread = Thread::current();
void JvmtiExport::post_object_free(JvmtiEnv* env, GrowableArray<jlong>* objects) {
assert(objects != NULL, "Nothing to post");

if (thread->is_Java_thread() && JavaThread::cast(thread)->is_in_VTMS_transition()) {
JavaThread *javaThread = JavaThread::current();
if (javaThread->is_in_VTMS_transition()) {
return; // no events should be posted if thread is in a VTMS transition
}
zhengyu123 marked this conversation as resolved.
Show resolved Hide resolved
assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE), "checking");

EVT_TRIG_TRACE(JVMTI_EVENT_OBJECT_FREE, ("[?] Trg Object Free triggered" ));
EVT_TRACE(JVMTI_EVENT_OBJECT_FREE, ("[?] Evt Object Free sent"));

JvmtiThreadEventMark jem(javaThread);
JvmtiJavaThreadEventTransition jet(javaThread);
jvmtiEventObjectFree callback = env->callbacks()->ObjectFree;
if (callback != NULL) {
(*callback)(env->jvmti_external(), tag);
for (int index = 0; index < objects->length(); index++) {
(*callback)(env->jvmti_external(), objects->at(index));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/prims/jvmtiExport.hpp
Expand Up @@ -386,7 +386,7 @@ class JvmtiExport : public AllStatic {
static void post_monitor_contended_entered(JavaThread *thread, ObjectMonitor *obj_mntr) NOT_JVMTI_RETURN;
static void post_monitor_wait(JavaThread *thread, oop obj, jlong timeout) NOT_JVMTI_RETURN;
static void post_monitor_waited(JavaThread *thread, ObjectMonitor *obj_mntr, jboolean timed_out) NOT_JVMTI_RETURN;
static void post_object_free(JvmtiEnv* env, jlong tag) NOT_JVMTI_RETURN;
static void post_object_free(JvmtiEnv* env, GrowableArray<jlong>* objects) NOT_JVMTI_RETURN;
static void post_resource_exhausted(jint resource_exhausted_flags, const char* detail) NOT_JVMTI_RETURN;
static void record_vm_internal_object_allocation(oop object) NOT_JVMTI_RETURN;
// Post objects collected by vm_object_alloc_event_collector.
Expand Down