@@ -929,7 +929,9 @@ class JvmtiClassFileLoadHookPoster : public StackObj {
929
929
_cached_class_file_ptr = cache_ptr;
930
930
_has_been_modified = false ;
931
931
932
- assert (!_thread->is_in_any_VTMS_transition (), " CFLH events are not allowed in any VTMS transition" );
932
+ if (_thread->is_in_any_VTMS_transition ()) {
933
+ return ; // no events should be posted if thread is in any VTMS transition
934
+ }
933
935
_state = JvmtiExport::get_jvmti_thread_state (_thread);
934
936
if (_state != nullptr ) {
935
937
_class_being_redefined = _state->get_class_being_redefined ();
@@ -1366,10 +1368,9 @@ void JvmtiExport::post_class_load(JavaThread *thread, Klass* klass) {
1366
1368
if (state == nullptr ) {
1367
1369
return ;
1368
1370
}
1369
- if (thread->is_in_tmp_VTMS_transition ()) {
1370
- return ; // skip ClassLoad events in tmp VTMS transition
1371
+ if (thread->is_in_any_VTMS_transition ()) {
1372
+ return ; // no events should be posted if thread is in any VTMS transition
1371
1373
}
1372
- assert (!thread->is_in_any_VTMS_transition (), " class load events are not allowed in any VTMS transition" );
1373
1374
1374
1375
EVT_TRIG_TRACE (JVMTI_EVENT_CLASS_LOAD, (" [%s] Trg Class Load triggered" ,
1375
1376
JvmtiTrace::safe_get_thread_name (thread)));
@@ -1404,10 +1405,9 @@ void JvmtiExport::post_class_prepare(JavaThread *thread, Klass* klass) {
1404
1405
if (state == nullptr ) {
1405
1406
return ;
1406
1407
}
1407
- if (thread->is_in_tmp_VTMS_transition ()) {
1408
- return ; // skip ClassPrepare events in tmp VTMS transition
1408
+ if (thread->is_in_any_VTMS_transition ()) {
1409
+ return ; // no events should be posted if thread is in any VTMS transition
1409
1410
}
1410
- assert (!thread->is_in_any_VTMS_transition (), " class prepare events are not allowed in any VTMS transition" );
1411
1411
1412
1412
EVT_TRIG_TRACE (JVMTI_EVENT_CLASS_PREPARE, (" [%s] Trg Class Prepare triggered" ,
1413
1413
JvmtiTrace::safe_get_thread_name (thread)));
0 commit comments