Skip to content

JDK21 adds PreviewFeature APIs and JVM methods - #17514

Merged
keithc-ca merged 2 commits into
eclipse-openj9:masterfrom
JasonFengJ9:jdk21sbprepend
Jun 20, 2023
Merged

JDK21 adds PreviewFeature APIs and JVM methods#17514
keithc-ca merged 2 commits into
eclipse-openj9:masterfrom
JasonFengJ9:jdk21sbprepend

Conversation

@JasonFengJ9

@JasonFengJ9 JasonFengJ9 commented Jun 2, 2023

Copy link
Copy Markdown
Member

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

Comment thread jcl/src/java.base/share/classes/java/lang/Access.java Outdated
Comment thread runtime/redirector/forwarders.m4 Outdated
Comment thread runtime/j9vm/javanextvmi.cpp Outdated
Comment thread runtime/j9vm/javanextvmi.cpp Outdated
Comment thread runtime/redirector/forwarders.m4 Outdated
@babsingh

babsingh commented Jun 5, 2023

Copy link
Copy Markdown
Contributor

#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
Copy Markdown
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

babsingh commented Jun 5, 2023

Copy link
Copy Markdown
Contributor

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

@babsingh

babsingh commented Jun 5, 2023

Copy link
Copy Markdown
Contributor

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

thallium commented Jun 5, 2023

Copy link
Copy Markdown
Contributor

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

@babsingh Yes.

@JasonFengJ9

Copy link
Copy Markdown
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.

Comment thread runtime/j9vm/javanextvmi.cpp Outdated
@keithc-ca

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

@keithc-ca
keithc-ca merged commit 262a469 into eclipse-openj9:master Jun 20, 2023
@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.

4 participants