Author SHA1 Message Date
isrc-riscv-port 13be4fa588 jdk/riscv64: Default to fork launcher on Linux
Pre-submit tests / Prerequisites (push) Has been cancelled
Pre-submit tests / Linux x64 (-debug, --enable-debug, build debug) (push) Has been cancelled
Pre-submit tests / Linux x64 (build release) (push) Has been cancelled
Pre-submit tests / Linux x64 (hotspot_tier1, hotspot/tier1) (push) Has been cancelled
Pre-submit tests / Linux x64 (jdk_security_infra, jdk/security_infra) (push) Has been cancelled
Pre-submit tests / Linux x64 (jdk_tier1, jdk/tier1) (push) Has been cancelled
Pre-submit tests / Linux x64 (langtools_tier1, langtools/tier1) (push) Has been cancelled
Pre-submit tests / Linux additional (--enable-debug --disable-precompiled-headers --with-jvm-variants=client --with-target-bits=32, hs x86 client build only, true) (push) Has been cancelled
Pre-submit tests / Linux additional (--enable-debug --disable-precompiled-headers --with-jvm-variants=minimal1 --with-target-bits=32, hs x86 minimal build only, true) (push) Has been cancelled
Pre-submit tests / Linux additional (--enable-debug --disable-precompiled-headers --with-jvm-variants=zero, hs x64 zero build only) (push) Has been cancelled
Pre-submit tests / Linux additional (--enable-debug --disable-precompiled-headers, hs x64 build only) (push) Has been cancelled
Pre-submit tests / Linux additional (arm64, --enable-debug --disable-precompiled-headers, hs aarch64 build only, aarch64) (push) Has been cancelled
Pre-submit tests / Linux additional (armhf, --enable-debug --disable-precompiled-headers --with-jvm-variants=zero, hs arm build only, arm, eabihf) (push) Has been cancelled
Pre-submit tests / Linux additional (ppc64el, --enable-debug --disable-precompiled-headers, hs ppc64le build only, powerpc64le) (push) Has been cancelled
Pre-submit tests / Linux additional (s390x, --enable-debug --disable-precompiled-headers --with-jvm-variants=zero, hs s390x build only, s390x) (push) Has been cancelled
Pre-submit tests / Linux x86 (-debug, --enable-debug, build debug) (push) Has been cancelled
Pre-submit tests / Linux x86 (build release) (push) Has been cancelled
Pre-submit tests / Linux x86 (hotspot_tier1, hotspot/tier1) (push) Has been cancelled
Pre-submit tests / Linux x86 (jdk_security_infra, jdk/security_infra) (push) Has been cancelled
Pre-submit tests / Linux x86 (jdk_tier1, jdk/tier1) (push) Has been cancelled
Pre-submit tests / Linux x86 (langtools_tier1, langtools/tier1) (push) Has been cancelled
Pre-submit tests / Windows x64 (-debug, --enable-debug, build debug) (push) Has been cancelled
Pre-submit tests / Windows x64 (build release) (push) Has been cancelled
Pre-submit tests / Windows x86 (-debug, --enable-debug, build debug) (push) Has been cancelled
Pre-submit tests / Windows x86 (build release) (push) Has been cancelled
Pre-submit tests / Windows x64 (hotspot_tier1, hotspot/tier1) (push) Has been cancelled
Pre-submit tests / Windows x64 (jdk_security_infra, jdk/security_infra) (push) Has been cancelled
Pre-submit tests / Windows x64 (jdk_tier1, jdk/tier1) (push) Has been cancelled
Pre-submit tests / Windows x64 (langtools_tier1, langtools/tier1) (push) Has been cancelled
Pre-submit tests / Windows x86 (hotspot_tier1, hotspot/tier1) (push) Has been cancelled
Pre-submit tests / Windows x86 (jdk_security_infra, jdk/security_infra) (push) Has been cancelled
Pre-submit tests / Windows x86 (jdk_tier1, jdk/tier1) (push) Has been cancelled
Pre-submit tests / Windows x86 (langtools_tier1, langtools/tier1) (push) Has been cancelled
Pre-submit tests / macOS x64 (-debug, --enable-debug, build debug) (push) Has been cancelled
Pre-submit tests / macOS x64 (build release) (push) Has been cancelled
Pre-submit tests / macOS x64 (hotspot_tier1, hotspot/tier1) (push) Has been cancelled
Pre-submit tests / macOS x64 (jdk_security_infra, jdk/security_infra) (push) Has been cancelled
Pre-submit tests / macOS x64 (jdk_tier1, jdk/tier1) (push) Has been cancelled
Pre-submit tests / macOS x64 (langtools_tier1, langtools/tier1) (push) Has been cancelled
Pre-submit tests / Post-process artifacts (push) Has been cancelled
Repeated Runtime.exec calls can wedge in the Linux vfork launch path under riscv64 user-mode execution. Use fork by default on linux-riscv64 while preserving the launchMechanism property override.
2026-05-14 00:06:49 +00:00
isrc-riscv-port 3fbfd9e56d hotspot/riscv64: Disable unsafe Object.clone intrinsic
The current riscv64 C2 backend can drop oop fields copied through the raw arraycopy expansion in the clone fast path. Keep Object.clone on the VM runtime path until the backend copy and barrier sequence is corrected.
2026-05-14 00:06:49 +00:00
isrc-riscv-port 2528eb998b hotspot/riscv64: Fix String.equals intrinsic length
The riscv64 string_equals helper receives UTF-16 lengths in characters but compares memory in bytes. Scale the count for two-byte elements so C2 does not report distinct short strings as equal.
2026-05-14 00:06:49 +00:00
isrc-riscv-port 9e1502020d jdk/riscv64: Preserve LambdaForm cache sharing
Do not force riscv64 pairwise conversions down the indirect path. The editor path is required for LambdaForm cache sharing, and targeted C2 MethodHandle coverage now passes without the indirect workaround.

Also avoid synthesizing a second uncustomized LambdaForm when a customized form observes a temporarily unset back-link.
2026-05-14 00:06:49 +00:00
isrc-riscv-port 45257ca32e hotspot/riscv64: Hide internal methods from stack walks
Hidden method handle adapter frames must not be exposed to caller-sensitive security stack walks. Treat hidden methods like method handle intrinsics and compiled LambdaForms when deciding whether a frame should be ignored.
2026-05-14 00:06:49 +00:00
7 changed files with 26 additions and 15 deletions
@@ -3315,6 +3315,10 @@ void MacroAssembler::string_equals(Register a1, Register a2,
BLOCK_COMMENT("string_equals {");
if (elem_size == 2) {
slli(cnt1, cnt1, 1);
}
beqz(cnt1, SAME);
mv(result, false);
+1 -1
View File
@@ -1065,7 +1065,7 @@ bool Method::is_ignored_by_security_stack_walk() const {
// This is an auxilary frame -- ignore it
return true;
}
if (is_method_handle_intrinsic() || is_compiled_lambda_form()) {
if (is_method_handle_intrinsic() || is_compiled_lambda_form() || is_hidden()) {
// This is an internal adapter frame for method handles -- ignore it
return true;
}
+1 -1
View File
@@ -806,7 +806,7 @@ class Method : public Metadata {
void set_force_inline(bool x) { _force_inline = x; }
bool dont_inline() { return _dont_inline; }
void set_dont_inline(bool x) { _dont_inline = x; }
bool is_hidden() { return _hidden; }
bool is_hidden() const { return _hidden; }
void set_hidden(bool x) { _hidden = x; }
bool has_injected_profile() { return _has_injected_profile; }
void set_has_injected_profile(bool x) { _has_injected_profile = x; }
@@ -423,6 +423,12 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
does_virtual_dispatch = true;
break;
case vmIntrinsics::_clone:
#ifdef TARGET_ARCH_riscv64
// The current riscv64 C2 backend can miscompile the clone fast path and
// drop oop fields copied by the raw arraycopy expansion. Keep clone on
// the VM runtime path until that backend copy/barrier sequence is fixed.
return NULL;
#endif
does_virtual_dispatch = true;
case vmIntrinsics::_copyOf:
case vmIntrinsics::_copyOfRange:
@@ -395,11 +395,13 @@ class LambdaForm {
}
Object uncustomized = transformCache;
if (uncustomized == null) {
// riscv64 tiered execution can observe a customized form before its
// uncustomized back-link is visible. Rebuild the uncustomized form
// instead of feeding null into the bytecode compilation path.
uncustomized = new LambdaForm(debugName, arity, names, result, forceInline, null);
transformCache = uncustomized;
for (int i = 0; uncustomized == null && i < 1000; i++) {
Thread.yield();
uncustomized = transformCache;
}
if (uncustomized == null) {
throw newInternalError("Missing uncustomized LambdaForm link");
}
}
LambdaForm uncustomizedForm = (LambdaForm)uncustomized;
if (COMPILE_THRESHOLD > 0 && isCompiled) {
@@ -56,8 +56,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
@Override
public Void run() {
values[0] = Integer.getInteger(MethodHandleImpl.class.getName()+".MAX_ARITY", 255);
values[1] = Boolean.getBoolean(MethodHandleImpl.class.getName()+".USE_INDIRECT_PAIRWISE_CONVERT") ||
"riscv64".equals(System.getProperty("os.arch"));
values[1] = Boolean.getBoolean(MethodHandleImpl.class.getName()+".USE_INDIRECT_PAIRWISE_CONVERT");
return null;
}
});
@@ -195,12 +194,6 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodType dstType = target.type();
if (srcType == dstType)
return target;
// The linux-riscv64 JDK8 server port avoids the editor-based BMH
// extension path for pairwise conversions. That path can create
// high-arity invokeBasic adapters while extending Species_L8+ handles;
// under C2 those adapters mispass stack arguments during bootstrap of
// collector/asType handles. The indirect LambdaForm path keeps the
// same semantics without materializing the fragile BMH extension chain.
if (USE_INDIRECT_PAIRWISE_CONVERT)
return makePairwiseConvertIndirect(target, srcType, strict, monobox);
return makePairwiseConvertByEditor(target, srcType, strict, monobox);
@@ -131,6 +131,12 @@ final class UNIXProcess extends Process {
LaunchMechanism lm;
if (s == null) {
lm = defaultLaunchMechanism;
if (this == LINUX &&
"riscv64".equals(System.getProperty("os.arch"))) {
// vfork can wedge under linux-riscv64 user-mode
// emulation during repeated Runtime.exec calls.
lm = LaunchMechanism.FORK;
}
s = lm.name().toLowerCase(Locale.ENGLISH);
} else {
try {