Closed fengxue-IS closed 1 year ago
@thallium is currently working on GetFrameCount
@thallium can you take a look at GetStackTrace
, should be similar to GetFrameCount
, though you will need to modify jvmtiInternalGetStackTrace
to accept continuation and use the helper walkContinuationStackFrames
for VirtualThreads
jvmtiNotifyFramePop
GetLocal(Object|Instance|Int|Long|Float|Double)
SetLocal(Object|Int|Long|Float|Double)
should need the same work as well to check if thread is virtual and fetch continuation object from thread for unmounted virtual thread, changes also have to be made to findDecompileInfo
same as jvmtiInternalGetStackTrace
Given the dup of jvmti functionality between standard jvmti and jvmti extension, should we dup the changes to jvmti in OpenJ9 jvmti extension? ie jvmtiGetStackTraceExtended and etc... @babsingh
should we dup the changes to jvmti in OpenJ9 jvmti extension?
can you specify what exactly will be duplicated? if the duplication can't be avoided, the only option will be to duplicate it.
For API that have 2 versions, we should make the same change to the following, right?
jvmtiGetStackTraceExtended
jvmtiGetAllStackTracesExtended
jvmtiGetThreadListStackTracesExtended
jvmtiInternalGetStackTraceExtended
For API that have 2 versions, we should make the same change to the following, right?
Yes, they will need identical changes to support virtual threads.
Closing as all APIs listed have been merged. For any issues with test, please open new issue with specific test failure
Part of #15183
Handle Yielded Virtual Threads
If a virtual thread is yielded, it won't have a carrier thread i.e. it is not associated to a J9VMThread. For a yielded virtual thread, helperStackAllocateVirtualThread will stack allocate a J9VMThread and fake-mount the virtual thread on it. Assumption: Existing JVMTI functions should work with the stack-allocated J9VMThread to inspect a yielded virtual thread.
Stackwalking will be done either using the existing API
vm->walkStackFrames
or new APIwalkContinuationStackFrames
provided in ContinuationHelpers.cpp, in order for all jvmti code to access the new API, it will have to be added tovm->internalVMFunctions
Currently we purpose to divide the
walkContinuationStackFrames
API to move theJ9VMThread
init code into a new helper which can be used by any JVMTI function which have multi-layer abstraction between the thread struct creation and call towalkStackFrames
(ex. code that usesjvmtiInternalGetStackTrace
) so they can stack allocate the structures locally and use the helper to copy fields from contination. (Note: due to jvmti code being written in C, it will not be able to include hpp helpers from ContinuationHelpers.hpp hence the new helper will also have to be added toJ9InternalVMFunctions
, we may choose to just modifyjvmtiInternalGetStackTrace
to accept a contination object and useswalkContinuationStackFrames
directly.see https://github.com/eclipse-openj9/openj9/issues/15183#issuecomment-1219243366 https://github.com/eclipse-openj9/openj9/issues/15183#issuecomment-1219287248 for more context