From 326b9e1c662c9d3a2b8186340a660990d89c2618 Mon Sep 17 00:00:00 2001 From: Dipak Bagadiya Date: Fri, 30 Dec 2022 05:34:28 -0800 Subject: [PATCH] Add JVMTI VirtualThread Mount and Unmount Events JVMTI VirtualThreadMount and VirtualThreadUnMount events are part of the JVMTI Extension API which is not covered by the JVMTI documentation. The following JVMTI extension events are implemented: -VirtualThreadmount: Trigger/Hook the Virtual thread mount event -VirtualThreadUnmount: Trigger/Hook the Virtual thread unmount event Fixes: eclipse-openj9#16167 Signed-off-by: Dipak Bagadiya dipak.bagadiya@ibm.com --- runtime/include/ibmjvmti.h | 3 + runtime/j9vm/javanextvmi.cpp | 4 +- runtime/jvmti/j9jvmti.tdf | 6 ++ runtime/jvmti/jvmtiEventManagement.c | 6 +- runtime/jvmti/jvmtiExtensionMechanism.c | 26 +++++++ runtime/jvmti/jvmtiHelpers.c | 4 +- runtime/jvmti/jvmtiHook.c | 92 ++++++++++++++++++++++++- runtime/nls/j9ti/jvmti.nls | 14 ++++ runtime/oti/j9consts.h | 84 +++++++++++----------- runtime/oti/j9vm.hdf | 22 +++++- runtime/oti/jvmtiInternal.h | 12 ++-- 11 files changed, 220 insertions(+), 53 deletions(-) diff --git a/runtime/include/ibmjvmti.h b/runtime/include/ibmjvmti.h index aa3c0f2cb17..f99af0b7a68 100644 --- a/runtime/include/ibmjvmti.h +++ b/runtime/include/ibmjvmti.h @@ -103,6 +103,9 @@ #define COM_SUN_HOTSPOT_FUNCTIONS_GET_VIRTUAL_THREAD "com.sun.hotspot.functions.GetVirtualThread" #define COM_SUN_HOTSPOT_FUNCTIONS_GET_CARRIER_THREAD "com.sun.hotspot.functions.GetCarrierThread" +#define COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT "com.sun.hotspot.events.VirtualThreadMount" +#define COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT "com.sun.hotspot.events.VirtualThreadUnmount" + #define COM_IBM_SHARED_CACHE_MODLEVEL_JAVA5 1 #define COM_IBM_SHARED_CACHE_MODLEVEL_JAVA6 2 #define COM_IBM_SHARED_CACHE_MODLEVEL_JAVA7 3 diff --git a/runtime/j9vm/javanextvmi.cpp b/runtime/j9vm/javanextvmi.cpp index d232aea3f6d..cd1bb4386cd 100644 --- a/runtime/j9vm/javanextvmi.cpp +++ b/runtime/j9vm/javanextvmi.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2022 IBM Corp. and others + * Copyright (c) 2018, 2023 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -390,6 +390,7 @@ JVM_VirtualThreadMountEnd(JNIEnv *env, jobject thread, jboolean firstMount) TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_STARTED(vm->hookInterface, currentThread); } + TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_MOUNT(vm->hookInterface, currentThread); /* Allow thread to be inspected again. */ Assert_SC_true(-1 == J9OBJECT_I64_LOAD(currentThread, threadObj, vm->virtualThreadInspectorCountOffset)); @@ -460,6 +461,7 @@ JVM_VirtualThreadUnmountBegin(JNIEnv *env, jobject thread, jboolean lastUnmount) */ J9OBJECT_I64_STORE(currentThread, threadObj, vm->virtualThreadInspectorCountOffset, -1); + TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_UNMOUNT(vm->hookInterface, currentThread); if (lastUnmount) { if (NULL != vm->liveVirtualThreadList) { j9object_t threadPrev = J9OBJECT_OBJECT_LOAD(currentThread, threadObj, vm->virtualThreadLinkPreviousOffset); diff --git a/runtime/jvmti/j9jvmti.tdf b/runtime/jvmti/j9jvmti.tdf index 39f4d1dafaf..eaee444195d 100644 --- a/runtime/jvmti/j9jvmti.tdf +++ b/runtime/jvmti/j9jvmti.tdf @@ -652,3 +652,9 @@ TraceEntry=Trc_JVMTI_jvmtiGetVirtualThread_Exit Overhead=1 Level=1 Noenv Templat TraceEntry=Trc_JVMTI_jvmtiGetCarrierThread_Entry Overhead=1 Level=1 Noenv Template="GetCarrierThread env=%p" TraceEntry=Trc_JVMTI_jvmtiGetCarrierThread_Exit Overhead=1 Level=1 Noenv Template="GetCarrierThread returning %d" + +TraceEntry=Trc_JVMTI_jvmtiHookVirtualThreadUnmount_Entry Overhead=1 Level=5 Noenv Template="HookVirtualThreadUnmount" +TraceExit=Trc_JVMTI_jvmtiHookVirtualThreadUnmount_Exit Overhead=1 Level=5 Noenv Template="HookVirtualThreadUnmount" + +TraceEntry=Trc_JVMTI_jvmtiHookVirtualThreadMount_Entry Overhead=1 Level=5 Noenv Template="HookVirtualThreadMount" +TraceExit=Trc_JVMTI_jvmtiHookVirtualThreadMount_Exit Overhead=1 Level=5 Noenv Template="HookVirtualThreadMount" diff --git a/runtime/jvmti/jvmtiEventManagement.c b/runtime/jvmti/jvmtiEventManagement.c index 8caa0313bd5..5f25c6429cd 100644 --- a/runtime/jvmti/jvmtiEventManagement.c +++ b/runtime/jvmti/jvmtiEventManagement.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2022 IBM Corp. and others + * Copyright (c) 1991, 2023 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -100,7 +100,7 @@ jvmtiSetEventNotificationMode(jvmtiEnv* env, /* Ensure the required capabilities are enabled for the event if the event is being enabled */ if (mode == JVMTI_ENABLE) { - switch(event_type) { + switch((int)event_type) { case JVMTI_EVENT_FIELD_MODIFICATION: ENSURE_CAPABILITY(env, can_generate_field_modification_events); break; @@ -159,6 +159,8 @@ jvmtiSetEventNotificationMode(jvmtiEnv* env, #if JAVA_SPEC_VERSION >= 19 case JVMTI_EVENT_VIRTUAL_THREAD_START: case JVMTI_EVENT_VIRTUAL_THREAD_END: + case J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT: + case J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT: ENSURE_CAPABILITY(env, can_support_virtual_threads); break; #endif /* JAVA_SPEC_VERSION >= 19 */ diff --git a/runtime/jvmti/jvmtiExtensionMechanism.c b/runtime/jvmti/jvmtiExtensionMechanism.c index c79e539e651..9dd2b0f6463 100644 --- a/runtime/jvmti/jvmtiExtensionMechanism.c +++ b/runtime/jvmti/jvmtiExtensionMechanism.c @@ -350,6 +350,18 @@ static const jvmtiParamInfo jvmtiRegisterTracePointSubscriber_params[] = { static const jvmtiParamInfo jvmtiDeregisterTracepointSubscriber_params[] = { { "subscriptionID", JVMTI_KIND_IN_PTR, JVMTI_TYPE_CVOID, JNI_FALSE } }; +#if JAVA_SPEC_VERSION >= 19 +/* (jvmtiEnv *jvmti_env, jthread thread) */ +static const jvmtiParamInfo jvmtiVirtualThreadMount_params[] = { + { "jni_env", JVMTI_KIND_IN_PTR, JVMTI_TYPE_JNIENV, JNI_FALSE }, + { "thread", JVMTI_KIND_IN, JVMTI_TYPE_JTHREAD, JNI_FALSE } +}; + +static const jvmtiParamInfo jvmtiVirtualThreadUnmount_params[] = { + { "jni_env", JVMTI_KIND_IN_PTR, JVMTI_TYPE_JNIENV, JNI_FALSE }, + { "thread", JVMTI_KIND_IN, JVMTI_TYPE_JTHREAD, JNI_FALSE } +}; +#endif /* JAVA_SPEC_VERSION >= 19 */ #if JAVA_SPEC_VERSION >= 19 /* (jvmtiEnv *jvmti_env, jthread carrier_thread, jthread *virtual_thread_ptr) */ @@ -824,6 +836,20 @@ static const J9JVMTIExtensionEventInfo J9JVMTIExtensionEventInfoTable[] = { J9NLS_JVMTI_COM_IBM_GARBAGE_COLLECTION_CYCLE_FINISH_DESCRIPTION, EMPTY_SIZE_AND_TABLE, }, +#if JAVA_SPEC_VERSION >= 19 + { + J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT, + COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT, + J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT, + SIZE_AND_TABLE(jvmtiVirtualThreadMount_params), + }, + { + J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT, + COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT, + J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT, + SIZE_AND_TABLE(jvmtiVirtualThreadUnmount_params), + }, +#endif /* JAVA_SPEC_VERSION >= 19 */ }; #define NUM_EXTENSION_EVENTS (sizeof(J9JVMTIExtensionEventInfoTable) / sizeof(J9JVMTIExtensionEventInfoTable[0])) diff --git a/runtime/jvmti/jvmtiHelpers.c b/runtime/jvmti/jvmtiHelpers.c index 66f4e4c1f9b..d6110125658 100644 --- a/runtime/jvmti/jvmtiHelpers.c +++ b/runtime/jvmti/jvmtiHelpers.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2022 IBM Corp. and others + * Copyright (c) 1991, 2023 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -75,6 +75,8 @@ static const UDATA reasonCodeFromJVMTIEvent[] = { J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VM_DUMP_END, /* J9JVMTI_EVENT_COM_IBM_VM_DUMP_END */ J9_JNI_OFFLOAD_SWITCH_J9JVMTI_GC_CYCLE_START, /* J9JVMTI_EVENT_COM_IBM_GARBAGE_COLLECTION_CYCLE_START */ J9_JNI_OFFLOAD_SWITCH_J9JVMTI_GC_CYCLE_FINISH, /* J9JVMTI_EVENT_COM_IBM_GARBAGE_COLLECTION_CYCLE_FINISH */ + J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VIRTUAL_THREAD_MOUNT, /* J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT */ + J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VIRTUAL_THREAD_UNMOUNT, /* J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT */ }; #endif /* J9VM_OPT_JAVA_OFFLOAD_SUPPORT */ diff --git a/runtime/jvmti/jvmtiHook.c b/runtime/jvmti/jvmtiHook.c index 32b4e7f78ec..838733fe999 100644 --- a/runtime/jvmti/jvmtiHook.c +++ b/runtime/jvmti/jvmtiHook.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2022 IBM Corp. and others + * Copyright (c) 1991, 2023 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -148,6 +148,8 @@ static UDATA methodExists(J9Class * methodClass, U_8 * nameData, UDATA nameLengt static void jvmtiHookVirtualThreadStarted (J9HookInterface** hook, UDATA eventNum, void* eventData, void* userData); static void jvmtiHookVirtualThreadEnd (J9HookInterface** hook, UDATA eventNum, void* eventData, void* userData); static void jvmtiHookVirtualThreadDestroy (J9HookInterface **hook, UDATA eventNum, void *eventData, void *userData); +static void jvmtiHookVirtualThreadMount (J9HookInterface** hook, UDATA eventNum, void* eventData, void* userData); +static void jvmtiHookVirtualThreadUnmount (J9HookInterface** hook, UDATA eventNum, void* eventData, void* userData); #endif /* JAVA_SPEC_VERSION >= 19 */ static void @@ -421,6 +423,86 @@ jvmtiHookVirtualThreadDestroy(J9HookInterface **hook, UDATA eventNum, void *even TRACE_JVMTI_EVENT_RETURN(jvmtiHookVirtualThreadDestroy); } + +/** + * Virtual thread mount event. + * + * @param hook Hook interface used by the JVM. + * @param eventNum The hook event number + * @param eventData hook specific event data. + * @param userData pointer to J9VMRuntimeStateListener + * @return void. + */ +static void +jvmtiHookVirtualThreadMount(J9HookInterface **hook, UDATA eventNum, void *eventData, void *userData) +{ + J9VMVirtualThreadMountEvent *data = eventData; + J9JVMTIEnv *j9env = userData; + J9VMThread *currentThread = data->currentThread; + jvmtiExtensionEvent callback = *J9JVMTI_EXTENSION_CALLBACK(j9env, J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT); + + Trc_JVMTI_jvmtiHookVirtualThreadMount_Entry(); + + ENSURE_EVENT_PHASE_LIVE(jvmtiHookVirtualThreadMount, j9env); + + /* Call the event callback */ + + if (NULL != callback) { + jthread threadRef = NULL; + UDATA hadVMAccess = 0; + UDATA javaOffloadOldState = 0; + if (prepareForEvent( + j9env, currentThread, currentThread, J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT, + &threadRef, &hadVMAccess, TRUE, 0, &javaOffloadOldState) + ) { + callback((jvmtiEnv *)j9env, (JNIEnv *)currentThread, threadRef); + finishedEvent(currentThread, J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT, hadVMAccess, javaOffloadOldState); + } + } + + TRACE_JVMTI_EVENT_RETURN(jvmtiHookVirtualThreadMount); +} + +/** + * Virtual thread unmount event. + * + * @param hook Hook interface used by the JVM. + * @param eventNum The hook event number + * @param eventData hook specific event data. + * @param userData pointer to J9VMRuntimeStateListener + * @return void. + */ +static void +jvmtiHookVirtualThreadUnmount(J9HookInterface **hook, UDATA eventNum, void *eventData, void *userData) +{ + J9VMVirtualThreadUnmountEvent *data = eventData; + J9JVMTIEnv *j9env = userData; + jvmtiExtensionEvent callback = *J9JVMTI_EXTENSION_CALLBACK(j9env, J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT); + J9VMThread *currentThread = data->currentThread; + + Trc_JVMTI_jvmtiHookVirtualThreadUnmount_Entry(); + + ENSURE_EVENT_PHASE_LIVE(jvmtiHookVirtualThreadUnmount, j9env); + + /* Call the event callback */ + + if (NULL != callback) { + jthread threadRef = NULL; + UDATA hadVMAccess = 0; + UDATA javaOffloadOldState = 0; + + if (prepareForEvent( + j9env, currentThread, currentThread, J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT, + &threadRef, &hadVMAccess, TRUE, 0, &javaOffloadOldState) + ) { + callback((jvmtiEnv *)j9env, (JNIEnv *)currentThread, threadRef); + finishedEvent(data->currentThread, J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT, hadVMAccess, javaOffloadOldState); + } + } + + TRACE_JVMTI_EVENT_RETURN(jvmtiHookVirtualThreadUnmount); +} + #endif /* JAVA_SPEC_VERSION >= 19 */ static IDATA @@ -618,6 +700,14 @@ processEvent(J9JVMTIEnv* j9env, jint event, J9HookRedirectorFunction redirectorF } else { return 0; } +#if JAVA_SPEC_VERSION >= 19 + case J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT: + return redirectorFunction(vmHook, J9HOOK_VM_VIRTUAL_THREAD_MOUNT, jvmtiHookVirtualThreadMount, OMR_GET_CALLSITE(), j9env); + + case J9JVMTI_EVENT_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT: + return redirectorFunction(vmHook, J9HOOK_VM_VIRTUAL_THREAD_UNMOUNT, jvmtiHookVirtualThreadUnmount, OMR_GET_CALLSITE(), j9env); +#endif /* JAVA_SPEC_VERSION >= 19 */ + } return 0; diff --git a/runtime/nls/j9ti/jvmti.nls b/runtime/nls/j9ti/jvmti.nls index 327f7443373..faa864e6503 100644 --- a/runtime/nls/j9ti/jvmti.nls +++ b/runtime/nls/j9ti/jvmti.nls @@ -624,3 +624,17 @@ J9NLS_JVMTI_COM_SUN_HOTSPOT_FUNCTIONS_GET_CARRIER_THREAD.explanation=Internation J9NLS_JVMTI_COM_SUN_HOTSPOT_FUNCTIONS_GET_CARRIER_THREAD.system_action=None J9NLS_JVMTI_COM_SUN_HOTSPOT_FUNCTIONS_GET_CARRIER_THREAD.user_response=None # END NON-TRANSLATABLE + +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT=Report a virtual thread mount. +# START NON-TRANSLATABLE +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT.explanation=Internationalized description of a JVMTI extension +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT.system_action=None +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_MOUNT.user_response=None +# END NON-TRANSLATABLE + +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT=Report a virtual thread unmount. +# START NON-TRANSLATABLE +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT.explanation=Internationalized description of a JVMTI extension +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT.system_action=None +J9NLS_JVMTI_COM_SUN_HOTSPOT_EVENTS_VIRTUAL_THREAD_UNMOUNT.user_response=None +# END NON-TRANSLATABLE diff --git a/runtime/oti/j9consts.h b/runtime/oti/j9consts.h index edcfe197e52..636567d5296 100644 --- a/runtime/oti/j9consts.h +++ b/runtime/oti/j9consts.h @@ -741,51 +741,51 @@ extern "C" { /* Jazz 99339: The reason code for JVMTI event callbacks on zOS. * Note: refer to jvmtiEventCallbacks (/runtime/include/jvmti.h) for reserved JVMTI events. */ -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_INIT 0x16 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_DEATH 0x17 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_THREAD_START 0x18 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_THREAD_END 0x19 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_CLASS_FILE_LOAD_HOOK 0x1A -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_CLASS_LOAD 0x1B -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_CLASS_PREPARE 0x1C -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_START 0x1D -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_EXCEPTION 0x1E -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_EXCEPTION_CATCH 0x1F -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_SINGLE_STEP 0x20 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_FRAME_POP 0x21 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_BREAKPOINT 0x22 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_FIELD_ACCESS 0x23 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_FIELD_MODIFICATION 0x24 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_METHOD_ENTRY 0x25 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_METHOD_EXIT 0x26 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_NATIVE_METHOD_BIND 0x27 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_COMPILED_METHOD_LOAD 0x28 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_COMPILED_METHOD_UNLOAD 0x29 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_DYNAMIC_CODE_GENERATED 0x2A -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_DATA_DUMP_REQUEST 0x2B +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_INIT 0x16 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_DEATH 0x17 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_THREAD_START 0x18 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_THREAD_END 0x19 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_CLASS_FILE_LOAD_HOOK 0x1A +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_CLASS_LOAD 0x1B +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_CLASS_PREPARE 0x1C +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_START 0x1D +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_EXCEPTION 0x1E +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_EXCEPTION_CATCH 0x1F +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_SINGLE_STEP 0x20 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_FRAME_POP 0x21 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_BREAKPOINT 0x22 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_FIELD_ACCESS 0x23 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_FIELD_MODIFICATION 0x24 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_METHOD_ENTRY 0x25 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_METHOD_EXIT 0x26 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_NATIVE_METHOD_BIND 0x27 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_COMPILED_METHOD_LOAD 0x28 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_COMPILED_METHOD_UNLOAD 0x29 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_DYNAMIC_CODE_GENERATED 0x2A +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_DATA_DUMP_REQUEST 0x2B /* 0x2C Reserved for JVMTI event */ -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_WAIT 0x2D -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_WAITED 0x2E -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_CONTENDED_ENTER 0x2F -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_CONTENDED_ENTERED 0x30 -/* 0x31 Reserved for JVMTI event */ -/* 0x32 Reserved for JVMTI event */ +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_WAIT 0x2D +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_WAITED 0x2E +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_CONTENDED_ENTER 0x2F +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_MONITOR_CONTENDED_ENTERED 0x30 +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VIRTUAL_THREAD_MOUNT 0x31 +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VIRTUAL_THREAD_UNMOUNT 0x32 /* 0x33 Reserved for JVMTI event */ -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_RESOURCE_EXHAUSTED 0x34 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_GC_START 0x35 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_GC_FINISH 0x36 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_OBJECT_FREE 0x37 -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_OBJECT_ALLOC 0x38 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_RESOURCE_EXHAUSTED 0x34 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_GC_START 0x35 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_GC_FINISH 0x36 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_OBJECT_FREE 0x37 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_VM_OBJECT_ALLOC 0x38 /* 0x39 Reserved for JVMTI event */ -#define J9_JNI_OFFLOAD_SWITCH_JVMTI_SAMPLED_OBJECT_ALLOC 0x3A -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_COMPILING_START 0x3B -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_COMPILING_END 0x3C -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_INSTRUMENTABLE_OBJECT_ALLOC 0x3D -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VM_DUMP_START 0x3E -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VM_DUMP_END 0x3F -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_GC_CYCLE_START 0x40 -#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_GC_CYCLE_FINISH 0x41 -#define J9_JNI_OFFLOAD_SWITCH_TRACE_SUBSCRIBER_THREAD 0x42 +#define J9_JNI_OFFLOAD_SWITCH_JVMTI_SAMPLED_OBJECT_ALLOC 0x3A +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_COMPILING_START 0x3B +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_COMPILING_END 0x3C +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_INSTRUMENTABLE_OBJECT_ALLOC 0x3D +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VM_DUMP_START 0x3E +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_VM_DUMP_END 0x3F +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_GC_CYCLE_START 0x40 +#define J9_JNI_OFFLOAD_SWITCH_J9JVMTI_GC_CYCLE_FINISH 0x41 +#define J9_JNI_OFFLOAD_SWITCH_TRACE_SUBSCRIBER_THREAD 0x42 #define J9_JNI_OFFLOAD_SWITCH_THRESHOLD 0x4000 #define J9_JNI_OFFLOAD_WITH_SUBTASKS_FLAG 0x40000000 diff --git a/runtime/oti/j9vm.hdf b/runtime/oti/j9vm.hdf index e36a4b3519d..37f6dbd3ebf 100644 --- a/runtime/oti/j9vm.hdf +++ b/runtime/oti/j9vm.hdf @@ -1,6 +1,6 @@