diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass029/redefclass029.cpp b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass029/redefclass029.cpp index bb867b3d2b4..d2b4b720c55 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass029/redefclass029.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/redefclass029/redefclass029.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,16 +97,6 @@ CompiledMethodLoad(jvmtiEnv *jvmti_env, jmethodID method, jint code_size, const void* compile_info) { char *name; char *sig; - jvmtiPhase phase; - - if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) { - nsk_jvmti_setFailStatus(); - return; - } - if (phase == JVMTI_PHASE_DEAD) { - NSK_DISPLAY0("CompiledMethodLoad event recieved in dead phase"); - return; - } NSK_DISPLAY0("CompiledMethodLoad event received for:\n"); if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sig, nullptr))) { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM04/em04t001/em04t001.cpp b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM04/em04t001/em04t001.cpp index ca1e5ddb7db..a7244db3441 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM04/em04t001/em04t001.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM04/em04t001/em04t001.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -116,18 +116,6 @@ cbDynamicCodeGenerated2(jvmtiEnv *jvmti_env, const char *name, NSK_DISPLAY3("NOT FOUND: 0x%p %7d %s\n", address, length, name); jvmti->RawMonitorExit(syncLock); -} - - void JNICALL -cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni_env) { - if (!NSK_VERIFY(nsk_list_destroy(plist))) { - nsk_jvmti_setFailStatus(); - } - - if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock))) { - nsk_jvmti_setFailStatus(); - } - } /* ============================================================================= */ @@ -147,7 +135,6 @@ int setCallBacks(int stage) { jvmtiEventCallbacks eventCallbacks; memset(&eventCallbacks, 0, sizeof(eventCallbacks)); - eventCallbacks.VMDeath = cbVMDeath; eventCallbacks.DynamicCodeGenerated = (stage == 1) ? cbDynamicCodeGenerated1 : cbDynamicCodeGenerated2; @@ -255,4 +242,23 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) { return JNI_OK; } +/* ============================================================================= */ + +JNIEXPORT void JNICALL +#ifdef STATIC_BUILD +Agent_OnUnload_em04t001(JavaVM *jvm) +#else +Agent_OnUnload(JavaVM *jvm) +#endif +{ + + if (!NSK_VERIFY(nsk_list_destroy(plist))) { + nsk_jvmti_setFailStatus(); + } + + if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock))) { + nsk_jvmti_setFailStatus(); + } +} + } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006.cpp b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006.cpp index c25f19b5f93..2c6a186656e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,18 +51,9 @@ CompiledMethodLoad(jvmtiEnv *jvmti_env, jmethodID method, const jvmtiAddrLocationMap* map, const void* compile_info) { char *name = nullptr; char *signature = nullptr; - jvmtiPhase phase; CompiledMethodLoadEventsCount++; - if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) { - nsk_jvmti_setFailStatus(); - return; - } - if (phase == JVMTI_PHASE_DEAD) { - NSK_DISPLAY0("CompiledMethodLoad event recieved in dead phase"); - return; - } if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, nullptr))) { nsk_jvmti_setFailStatus(); return; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp index ae2fb040dde..0b43e5ac782 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,6 @@ * questions. */ -#include #include #include @@ -63,9 +62,6 @@ static volatile int currentAgentStatus = NSK_STATUS_PASSED; void nsk_jvmti_setFailStatus() { currentAgentStatus = NSK_STATUS_FAILED; - printf("Test failed by setFailStatus(). See log."); - fflush(stdout); - exit(97); } int nsk_jvmti_isFailStatus() { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/hotswap/HotSwap.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/hotswap/HotSwap.cpp index 97105b6b9f0..b47be9bb74a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/hotswap/HotSwap.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/hotswap/HotSwap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -141,19 +141,9 @@ CompiledMethodLoad(jvmtiEnv *jvmti_env, jmethodID method, const jvmtiAddrLocationMap* map, const void* compile_info) { char *name = nullptr; char *signature = nullptr; - jvmtiPhase phase; CompiledMethodLoadEventsCount++; - // GetMethodName works in live phase only so just exit if the event is generated too late - if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) { - nsk_jvmti_setFailStatus(); - return; - } - if (phase == JVMTI_PHASE_DEAD) { - NSK_DISPLAY0("CompiledMethodLoad event recieved in dead phase"); - return; - } if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, nullptr))) { nsk_jvmti_setFailStatus(); return;