298
298
typedef void (* j9_tls_finalizer_t )(void * );
299
299
#endif /* JAVA_SPEC_VERSION >= 19 */
300
300
301
+ #if JAVA_SPEC_VERSION >= 24
302
+ /* Constants from java.lang.VirutalThread.state that are used by the VM.
303
+ * The full mapping is under jvmtiInternals.h <JVMTI_VTHREAD_STATE_*>.
304
+ */
305
+ #define JAVA_LANG_VIRTUALTHREAD_BLOCKING 12
306
+ #define JAVA_LANG_VIRTUALTHREAD_WAITING 13
307
+ #define JAVA_LANG_VIRTUALTHREAD_TIMED_WAITING 17
308
+ #endif /* JAVA_SPEC_VERSION >= 24 */
309
+
301
310
typedef enum {
302
311
J9FlushCompQueueDataBreakpoint
303
312
} J9JITFlushCompilationQueueReason ;
@@ -1717,6 +1726,11 @@ typedef struct J9ObjectMonitor {
1717
1726
#endif /* defined(J9VM_THR_SMART_DEFLATION) */
1718
1727
j9objectmonitor_t alternateLockword ;
1719
1728
U_32 hash ;
1729
+ #if JAVA_SPEC_VERSION >= 24
1730
+ U_32 virtualThreadWaitCount ;
1731
+ struct J9VMContinuation * ownerContinuation ;
1732
+ struct J9VMContinuation * waitingContinuations ;
1733
+ #endif /* JAVA_SPEC_VERSION >= 24 */
1720
1734
} J9ObjectMonitor ;
1721
1735
1722
1736
typedef struct J9ClassWalkState {
@@ -5329,6 +5343,10 @@ typedef struct J9InternalVMFunctions {
5329
5343
struct J9Class * (* initializeSnapshotClassObject )(struct J9JavaVM * javaVM , struct J9ClassLoader * classLoader , struct J9Class * clazz );
5330
5344
BOOLEAN (* loadWarmClassFromSnapshot )(struct J9VMThread * vmThread , struct J9ClassLoader * classLoader , struct J9Class * clazz );
5331
5345
#endif /* defined(J9VM_OPT_SNAPSHOTS) */
5346
+ #if JAVA_SPEC_VERSION >= 24
5347
+ struct J9ObjectMonitor * (* monitorTablePeek )(struct J9JavaVM * vm , j9object_t object );
5348
+ jobject (* takeVirtualThreadListToUnblock )(struct J9VMThread * currentThread , struct J9JavaVM * vm );
5349
+ #endif /* JAVA_SPEC_VERSION >= 24 */
5332
5350
} J9InternalVMFunctions ;
5333
5351
5334
5352
/* Jazz 99339: define a new structure to replace JavaVM so as to pass J9NativeLibrary to JVMTIEnv */
@@ -5407,6 +5425,13 @@ typedef struct J9JITGPRSpillArea {
5407
5425
typedef uintptr_t ContinuationState ;
5408
5426
5409
5427
#if JAVA_SPEC_VERSION >= 19
5428
+ #define J9VM_CONTINUATION_RETURN_FROM_YIELD 1
5429
+ #if JAVA_SPEC_VERSION >= 24
5430
+ #define J9VM_CONTINUATION_RETURN_FROM_MONITOR_ENTER 0
5431
+ #define J9VM_CONTINUATION_RETURN_FROM_OBJECT_WAIT 2
5432
+ #define J9VM_CONTINUATION_RETURN_FROM_SYNC_METHOD 3
5433
+ #endif /* JAVA_SPEC_VERSION >= 24 */
5434
+
5410
5435
typedef struct J9VMContinuation {
5411
5436
UDATA * arg0EA ;
5412
5437
UDATA * bytecodes ;
@@ -5422,6 +5447,16 @@ typedef struct J9VMContinuation {
5422
5447
struct J9I2JState i2jState ;
5423
5448
struct J9VMEntryLocalStorage * oldEntryLocalStorage ;
5424
5449
UDATA dropFlags ;
5450
+ UDATA returnState ;
5451
+ #if JAVA_SPEC_VERSION >= 24
5452
+ IDATA waitingMonitorEnterCount ;
5453
+ UDATA ownedMonitorCount ;
5454
+ struct J9Pool * monitorEnterRecordPool ;
5455
+ struct J9MonitorEnterRecord * monitorEnterRecords ;
5456
+ struct J9MonitorEnterRecord * jniMonitorEnterRecords ;
5457
+ j9object_t vthread ;
5458
+ struct J9VMContinuation * nextWaitingContinuation ;
5459
+ #endif /* JAVA_SPEC_VERSION >= 24 */
5425
5460
} J9VMContinuation ;
5426
5461
#endif /* JAVA_SPEC_VERSION >= 19 */
5427
5462
@@ -6341,6 +6376,10 @@ typedef struct J9JavaVM {
6341
6376
#if defined(J9VM_OPT_JFR )
6342
6377
UDATA loadedClassCount ;
6343
6378
#endif /* defined(J9VM_OPT_JFR) */
6379
+ #if JAVA_SPEC_VERSION >= 24
6380
+ J9VMContinuation * blockedContinuations ;
6381
+ omrthread_monitor_t blockedVirtualThreadsMutex ;
6382
+ #endif /* JAVA_SPEC_VERSION >= 24 */
6344
6383
} J9JavaVM ;
6345
6384
6346
6385
#define J9JFR_SAMPLER_STATE_UNINITIALIZED 0
@@ -6380,7 +6419,10 @@ typedef struct J9JavaVM {
6380
6419
#if defined(J9VM_OPT_CRIU_SUPPORT )
6381
6420
#define J9_OBJECT_MONITOR_CRIU_SINGLE_THREAD_MODE_THROW 2
6382
6421
#endif /* defined(J9VM_OPT_CRIU_SUPPORT) */
6383
- #define J9_OBJECT_MONITOR_BLOCKING 3
6422
+ #if JAVA_SPEC_VERSION >= 24
6423
+ #define J9_OBJECT_MONITOR_YIELD_VIRTUAL 3
6424
+ #endif /* JAVA_SPEC_VERSION >= 24 */
6425
+ #define J9_OBJECT_MONITOR_BLOCKING 4
6384
6426
6385
6427
#if (JAVA_SPEC_VERSION >= 16 ) || defined(J9VM_OPT_CRIU_SUPPORT )
6386
6428
#define J9_OBJECT_MONITOR_ENTER_FAILED (rc ) ((UDATA)(rc) < J9_OBJECT_MONITOR_BLOCKING)
0 commit comments