> 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 internal API includes 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` > > To get the test results clean, the update also fixes the test issue: > [8318631](https://bugs.openjdk.org/browse/JDK-8318631): > GetStackTraceSuspendedStressTest.java failed with "check_jvmti_status: JVMTI > function returned error: JVMTI_ERROR_THREAD_NOT_ALIVE (15)" > > Testing: > - the mach5 tiers 1-6 are all passed
Serguei Spitsyn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision: - Merge - addressed review: (1) removed is_vthread_alive checks; (2) reverted one update - addressed review: added check for jdk_internal_vm_Continuation::done(cont) - review: get rid of the VM_HandshakeUnmountedVirtualThread - remove unneeded ResourceMark from JVMTI GetStackTrace - address review: remove fix in libGetStackTraceSuspendedStress.cpp - addressed initial minor review comments - 8319244: implement JVMTI handshakes support for virtual threads ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16460/files - new: https://git.openjdk.org/jdk/pull/16460/files/a526bd60..2df63547 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16460&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16460&range=05-06 Stats: 634349 lines in 1310 files changed: 89706 ins; 480412 del; 64231 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