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

JDK21 adds PreviewFeature APIs and JVM methods #17514

Merged
merged 2 commits into from
Jun 20, 2023

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented Jun 2, 2023

JDK21 adds PreviewFeature APIs and JVM methods

Added the following PreviewFeature APIs:

stringConcatCoder(char value)
stringBuilderConcatMix(long lengthCoder, StringBuilder sb)
stringBuilderConcatPrepend(long lengthCoder, byte[] buf, StringBuilder
sb)

Also added JVM_PrintWarningAtDynamicAgentLoad.

Rebased on

required by

Signed-off-by: Jason Feng fengj@ca.ibm.com

jcl/src/java.base/share/classes/java/lang/Access.java Outdated Show resolved Hide resolved
runtime/redirector/forwarders.m4 Outdated Show resolved Hide resolved
runtime/j9vm/javanextvmi.cpp Outdated Show resolved Hide resolved
runtime/j9vm/javanextvmi.cpp Show resolved Hide resolved
runtime/redirector/forwarders.m4 Outdated Show resolved Hide resolved
@babsingh
Copy link
Contributor

babsingh commented Jun 5, 2023

#17125 addresses all issues related to the JVM_VirtualThread* functions. Instead of adding stubs, #17125 can be used to unblock the jdk-next/openj9-staging build. Also, adding stubs will cause merge conflicts in #17125. fyi @fengxue-IS @thallium

@JasonFengJ9
Copy link
Member Author

#17125 can be used to unblock the jdk-next/openj9-staging build

If #17125 has a better chance to be merged first, this PR can just keep j.l.Access new APIs.

@babsingh
Copy link
Contributor

babsingh commented Jun 5, 2023

@thallium Can you confirm if #17125 is ready to be merged?

@babsingh
Copy link
Contributor

babsingh commented Jun 5, 2023

sanity.functional test suite, which is used to promote openj9-staging builds, has Jep425Tests_testVirtualThread. All the changes from #17125 are probably needed to pass these tests. Stubs might lead to test failures.

@thallium
Copy link
Contributor

thallium commented Jun 5, 2023

@thallium Can you confirm if #17125 is ready to be merged?

@babsingh Yes.

@JasonFengJ9
Copy link
Member Author

Just updated this PR to address the comments except for the actual implementation for JVM_VirtualThread[Mount|Unmount].

This PR probably is not sufficient for openj9-staging promotion though it could enable Merge-to-Staging-JDKNext for further openjdk content consumption before #17125 is to be merged.

@keithc-ca
Copy link
Contributor

Please rebase this on #17125; see ibmruntimes/openj9-openjdk-jdk#608 (comment).

- Move code of APIs of JDK 20 such as JVM_VirtualThreadMountBegin
  to helpers so they can be called by APIs of both JDK 20 and 21
- Hide frames between mount/unmount begin and mount/unmount end
- Seperate out code that is specific to first mount and last unmount.

Fixes eclipse-openj9#16984

Outlines of related functions:

virtualThread[Mount|Unmount]Begin:
    enterVThreadTransition()
    virtualThreadHideFrames(true)

virtualThread[Mount|Unmount]End:
    virtualThreadHideFrames(false)
    exitVThreadTransition()

JVM_VirtualThreadMount(bool hide):
    if (hide)
	virtualThreadMountBegin()
    else
	virtualThreadMountEnd()
	TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_MOUNT()

JVM_VirtualThreadUnmount(bool hide):
    if (hide)
	TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_UNMOUNT()
	virtualThreadUnmountBegin()
    else
	virtualThreadUnmountEnd()

JVM_VirtualThreadStart()
    virtualThreadMountEnd()
    TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_STARTED()

JVM_VirtualThreadEnd()
    TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_END()
    virtualThreadUnmountBegin()

Signed-off-by: Gengchen Tuo <gengchen.tuo@ibm.com>
@JasonFengJ9 JasonFengJ9 changed the title JDK21 adds @PreviewFeature APIs and JVM_VirtualThread[Start|End] JDK21 adds PreviewFeature APIs and JVM methods Jun 13, 2023
@JasonFengJ9
Copy link
Member Author

Added following PreviewFeature APIs:
stringConcatCoder(char value)
stringBuilderConcatMix(long lengthCoder, StringBuilder sb)
stringBuilderConcatPrepend(long lengthCoder, byte[] buf, StringBuilder
sb)
Also added JVM_PrintWarningAtDynamicAgentLoad.

Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@keithc-ca
Copy link
Contributor

@keithc-ca keithc-ca merged commit 262a469 into eclipse-openj9:master Jun 20, 2023
2 checks passed
@JasonFengJ9 JasonFengJ9 deleted the jdk21sbprepend branch June 21, 2023 01:50
babsingh added a commit to babsingh/aqa-tests that referenced this pull request Jul 27, 2023
eclipse-openj9/openj9#17125 fixes framepop02.java#id1, and it was
embedded in eclipse-openj9/openj9#17514 and merged.

Now, the MethodExitTest failure is being tracked through
eclipse-openj9/openj9#17514.

Closes eclipse-openj9/openj9#16346

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh added a commit to babsingh/aqa-tests that referenced this pull request Jul 27, 2023
eclipse-openj9/openj9#17125 fixes framepop02.java#id1, and it was
embedded in eclipse-openj9/openj9#17514 and merged.

Now, the MethodExitTest failure is being tracked through
eclipse-openj9/openj9#17490.

Closes eclipse-openj9/openj9#16346

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
llxia pushed a commit to adoptium/aqa-tests that referenced this pull request Jul 27, 2023
eclipse-openj9/openj9#17125 fixes framepop02.java#id1, and it was
embedded in eclipse-openj9/openj9#17514 and merged.

Now, the MethodExitTest failure is being tracked through
eclipse-openj9/openj9#17490.

Closes eclipse-openj9/openj9#16346

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants