The handshakes support for virtual threads is needed to simplify the JVMTI 
implementation for virtual threads. There is a significant duplication in the 
JVMTI code to differentiate code intended to support platform, virtual threads 
or both. The handshakes are unified, so it is enough to define just one 
handshake for both platform and virtual thread.
At the low level, the JVMTI code supporting platform and virtual threads still 
can be different.
This implementation is based on the `JvmtiVTMSTransitionDisabler` class.

The interface includes, at least, two new classes:
  - `JvmtiHandshake` and `JvmtiUnifiedHandshakeClosure`
  
  The `JvmtiUnifiedHandshakeClosure` defines two different callback functions: 
`do_thread()` and `do_vthread()`.

The first JVMTI functions are picked first to be converted to use the 
`JvmtiHandshake`:
 - `GetStackTrace`, `GetFrameCount`, `GetFrameLocation`, `NotifyFramePop`

Testing:
 - the mach5 tiers 1-6 are all passed

-------------

Commit messages:
 - 8319244: implement JVMTI handshakes support for virtual threads

Changes: https://git.openjdk.org/jdk/pull/16460/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16460&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8319244
  Stats: 532 lines in 5 files changed: 176 ins; 329 del; 27 mod
  Patch: https://git.openjdk.org/jdk/pull/16460.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16460/head:pull/16460

PR: https://git.openjdk.org/jdk/pull/16460

Reply via email to