Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Thread Support #18432

Merged
merged 3 commits into from
Nov 9, 2023
Merged

Virtual Thread Support #18432

merged 3 commits into from
Nov 9, 2023

Commits on Nov 9, 2023

  1. Remove unused variables in jvm.c

    This improves perf by saving the resources used to store and
    initialize these variable.
    
    Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
    babsingh committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    618358b View commit details
    Browse the repository at this point in the history
  2. Update error handling in JVMTI NotifyFramePop

    Return JVMTI_ERROR_THREAD_NOT_SUSPENDED if the thread was not
    suspended and was not the current thread.
    
    For virtual threads, VirtualThread.state is read and it is checked
    if JVMTI_VTHREAD_STATE_SUSPENDED is set in VirtualThread.state.
    
    This check is incorrect because JVMTI_VTHREAD_STATE_SUSPENDED
    represents an internal state at the Java level. It does not
    imply if the virtual thread is suspended through JVMTI.
    
    JVMTI NotifyFramePop is updated to check if the virtual thread
    is suspended through JVMTI.
    
    Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
    babsingh committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    661d399 View commit details
    Browse the repository at this point in the history
  3. Update acquireVThreadInspector and enterVThreadTransitionCritical

    VM is entered by the invocation of internalEnterVMFromJNI.
    VM is exited by the invocation of internalExitVMToJNI.
    
    VM is always entered before acquireVThreadInspector and
    enterVThreadTransitionCritical are invoked.
    
    In these functions, the goal can be achieved by just releasing
    and re-acquiring VM access. The new changes just release and
    re-acquire VM access instead of exiting and entering the VM.
    This has less overhead.
    
    Addresses: eclipse-openj9#18420 (comment)
    
    Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
    babsingh committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    7c82a95 View commit details
    Browse the repository at this point in the history