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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions jcl/src/java.base/share/classes/java/lang/Access.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,18 @@ public char getUTF16Char(byte[] val, int index) {
public int countPositives(byte[] ba, int off, int len) {
return StringCoding.countPositives(ba, off, len);
}

public long stringConcatCoder(char value) {
return StringConcatHelper.coder(value);
}

public long stringBuilderConcatMix(long lengthCoder, StringBuilder sb) {
return sb.mix(lengthCoder);
}

public long stringBuilderConcatPrepend(long lengthCoder, byte[] buf, StringBuilder sb) {
return sb.prepend(lengthCoder, buf);
}
/*[ENDIF] JAVA_SPEC_VERSION >= 21 */
/*[ELSE] JAVA_SPEC_VERSION >= 20 */
public Object[] extentLocalCache() {
Expand Down
3 changes: 3 additions & 0 deletions runtime/j9vm/exports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ if(JAVA_SPEC_VERSION LESS 21)
else()
jvm_add_exports(jvm
JVM_IsForeignLinkerSupported
JVM_PrintWarningAtDynamicAgentLoad
JVM_VirtualThreadEnd
JVM_VirtualThreadMount
JVM_VirtualThreadStart
JVM_VirtualThreadUnmount
)
endif()
Expand Down
40 changes: 26 additions & 14 deletions runtime/j9vm/j9scar.tdf
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ TraceEntry=Trc_SC_RegisterSignal_Entry Overhead=1 Level=1 Template="JVM_Register
TraceExit=Trc_SC_RegisterSignal_Exit Overhead=1 Level=1 Template="JVM_RegisterSignal -- return old OS handler = %p"
TraceException=Trc_SC_RegisterSignal_FailedToRegisterHandler Overhead=1 Level=1 Template="Failed to register handler: OS signal value = %d, new signal handler = %p, old signal handler = %p"

TraceEntry=Trc_SC_GetExtendedNPEMessage_Entry Overhead=1 Level=3 Template="JVM_GetExtendedNPEMessage - throwableObj(0x%p)"
TraceEntry=Trc_SC_GetExtendedNPEMessage_Entry2 Overhead=1 Level=1 Template="JVM_GetExtendedNPEMessage - throwableObj(0x%p)"
TraceEvent=Trc_SC_GetExtendedNPEMessage_Null_NPE_MSG Overhead=1 Level=1 Template="JVM_GetExtendedNPEMessage - returns a NULL NPE message : romClass (0x%p) && romMethod (0x%p) bytecodeOffset (%d)"
TraceExit=Trc_SC_GetExtendedNPEMessage_Exit Overhead=1 Level=3 Template="JVM_GetExtendedNPEMessage - returns msgObjectRef(0x%p)"
TraceEntry=Trc_SC_GetExtendedNPEMessage_Entry Overhead=1 Level=3 Template="JVM_GetExtendedNPEMessage - throwableObj(%p)"
TraceEntry=Trc_SC_GetExtendedNPEMessage_Entry2 Overhead=1 Level=1 Template="JVM_GetExtendedNPEMessage - throwableObj(%p)"
TraceEvent=Trc_SC_GetExtendedNPEMessage_Null_NPE_MSG Overhead=1 Level=1 Template="JVM_GetExtendedNPEMessage - returns a NULL NPE message : romClass (%p) && romMethod (%p) bytecodeOffset (%d)"
TraceExit=Trc_SC_GetExtendedNPEMessage_Exit Overhead=1 Level=3 Template="JVM_GetExtendedNPEMessage - returns msgObjectRef(%p)"

TraceEntry=Trc_SC_UnloadLibrary_Entry NoEnv Overhead=1 Level=2 Template="JVM_UnloadLibrary(handle=%p)"
TraceEvent=Trc_SC_LoadLibrary_BootStrap NoEnv Overhead=1 Level=3 Template="JVM_LoadLibrary(name=%s) Bootstrap library"
Expand All @@ -351,21 +351,21 @@ TraceEvent=Trc_SC_LoadLibrary_OpenShared_Decorate NoEnv Overhead=1 Level=3 Templ

TraceExit=Trc_SC_LoadLibrary_Exit NoEnv Overhead=1 Level=2 Template="JVM_LoadLibrary -- return 0x%zx"

TraceEntry=Trc_SC_VirtualThreadMountBegin_Entry Overhead=1 Level=3 Template="thread = 0x%p, firstMount = %d"
TraceExit=Trc_SC_VirtualThreadMountBegin_Exit Overhead=1 Level=3 Template="thread = 0x%p, firstMount = %d"
TraceEntry=Trc_SC_VirtualThreadMountBegin_Entry Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
TraceExit=Trc_SC_VirtualThreadMountBegin_Exit Overhead=1 Level=3 Template="thread = %p, firstMount = %d"

TraceEntry=Trc_SC_VirtualThreadMountEnd_Entry Overhead=1 Level=3 Template="thread = 0x%p, firstMount = %d"
TraceExit=Trc_SC_VirtualThreadMountEnd_Exit Overhead=1 Level=3 Template="thread = 0x%p, firstMount = %d"
TraceEntry=Trc_SC_VirtualThreadMountEnd_Entry Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
TraceExit=Trc_SC_VirtualThreadMountEnd_Exit Overhead=1 Level=3 Template="thread = %p, firstMount = %d"

TraceEntry=Trc_SC_VirtualThreadUnmountBegin_Entry Overhead=1 Level=3 Template="thread = 0x%p, lastUnmount = %d"
TraceExit=Trc_SC_VirtualThreadUnmountBegin_Exit Overhead=1 Level=3 Template="thread = 0x%p, lastUnmount = %d"
TraceEntry=Trc_SC_VirtualThreadUnmountBegin_Entry Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
TraceExit=Trc_SC_VirtualThreadUnmountBegin_Exit Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"

TraceEntry=Trc_SC_VirtualThreadUnmountEnd_Entry Overhead=1 Level=3 Template="thread = 0x%p, lastUnmount = %d"
TraceExit=Trc_SC_VirtualThreadUnmountEnd_Exit Overhead=1 Level=3 Template="thread = 0x%p, lastUnmount = %d"
TraceEntry=Trc_SC_VirtualThreadUnmountEnd_Entry Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
TraceExit=Trc_SC_VirtualThreadUnmountEnd_Exit Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"

TraceEvent=Trc_SC_VirtualThread_Info Overhead=1 Level=3 Test Template="virtualThreadObj = 0x%p, virtualThreadState = 0x%p, virtualThreadInspectorCount = %lld, carrierThreadObj = 0x%p, continuationObj = 0x%p, J9VMContinuation = 0x%p"
TraceEvent=Trc_SC_VirtualThread_Info Overhead=1 Level=3 Test Template="virtualThreadObj = %p, virtualThreadState = %p, virtualThreadInspectorCount = %lld, carrierThreadObj = %p, continuationObj = %p, J9VMContinuation = %p"

TraceEvent=Trc_SC_VirtualThread_RootNodeSet Overhead=1 Level=1 Test Template="Virtual threadlist root node set, global ref = 0x%p"
TraceEvent=Trc_SC_VirtualThread_RootNodeSet Overhead=1 Level=1 Test Template="Virtual threadlist root node set, global ref = %p"

TraceEntry=Trc_SC_ValidateJNILibrary_Entry NoEnv Overhead=1 Level=1 Template="JVM_ValidateJNILibrary(name=%s, handle=%p, isStatic=%d)"
TraceExit=Trc_SC_ValidateJNILibrary_Exit NoEnv Overhead=1 Level=1 Template="JVM_ValidateJNILibrary -- return %p"
Expand All @@ -375,3 +375,15 @@ TraceExit=Trc_SC_UnloadLibrary_Exit NoEnv Overhead=1 Level=2 Template="JVM_Unloa
// z/OS only
TraceEntry=Trc_SC_Invoke31BitJNI_OnXLoad_Entry NoEnv Overhead=1 Level=3 Template="JVM_Invoke31BitJNI_OnXLoad(vm=%p, handle=%p, isOnLoad=%d, reserved=%p)"
TraceExit=Trc_SC_Invoke31BitJNI_OnXLoad_Exit NoEnv Overhead=1 Level=3 Template="JVM_Invoke31BitJNI_OnXLoad -- return %d"

TraceEntry=Trc_SC_VirtualThreadMount_Entry Overhead=1 Level=3 Template="thread = %p, hide = %d"
TraceExit=Trc_SC_VirtualThreadMount_Exit Overhead=1 Level=3 Template="thread = %p, hide = %d"

TraceEntry=Trc_SC_VirtualThreadUnmount_Entry Overhead=1 Level=3 Template="thread = %p, hide = %d"
TraceExit=Trc_SC_VirtualThreadUnmount_Exit Overhead=1 Level=3 Template="thread = %p, hide = %d"

TraceEntry=Trc_SC_VirtualThreadStart_Entry Overhead=1 Level=3 Template="thread = %p"
TraceExit=Trc_SC_VirtualThreadStart_Exit Overhead=1 Level=3 Template="thread = %p"

TraceEntry=Trc_SC_VirtualThreadEnd_Entry Overhead=1 Level=3 Template="thread = %p"
TraceExit=Trc_SC_VirtualThreadEnd_Exit Overhead=1 Level=3 Template="thread = %p"
3 changes: 3 additions & 0 deletions runtime/j9vm/j9vmnatives.xml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<exports group="jdk21">
<!-- Additions for Java 21 (General) -->
<export name="JVM_IsForeignLinkerSupported"/>
<export name="JVM_PrintWarningAtDynamicAgentLoad"/>
<export name="JVM_VirtualThreadEnd"/>
<export name="JVM_VirtualThreadMount"/>
<export name="JVM_VirtualThreadStart"/>
<export name="JVM_VirtualThreadUnmount"/>
</exports>
</exportlists>
Loading