From fe4dd46741b57697b9915a3c2a5a2c76fafda1f2 Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Mon, 5 May 2025 12:30:44 +0200 Subject: [PATCH 1/2] Adapt JDK-8356126: Revisit CaptureCallState --- .../svm/core/foreign/ForeignFunctionsRuntime.java | 12 ++++++------ .../foreign/ForeignFunctionsConfigurationParser.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/ForeignFunctionsRuntime.java b/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/ForeignFunctionsRuntime.java index ec4bf1e8adf4..f9e95be5d196 100644 --- a/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/ForeignFunctionsRuntime.java +++ b/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/ForeignFunctionsRuntime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -228,8 +228,8 @@ private static String generateMessage(JavaEntryPointInfo jep) { * Workaround for CapturableState.mask() being interruptible. */ @Fold - static int getMask(CapturableState state) { - return state.mask(); + static int getMask(String state) { + return CapturableState.forName(state).mask; } @Fold @@ -255,18 +255,18 @@ public static void captureCallState(int statesToCapture, CIntPointer captureBuff if (isWindows()) { assert WindowsAPIs.isSupported() : "Windows APIs should be supported on Windows OS"; - if ((statesToCapture & getMask(CapturableState.GET_LAST_ERROR)) != 0) { + if ((statesToCapture & getMask("GetLastError")) != 0) { captureBuffer.write(i, WindowsAPIs.getLastError()); } ++i; - if ((statesToCapture & getMask(CapturableState.WSA_GET_LAST_ERROR)) != 0) { + if ((statesToCapture & getMask("WSAGetLastError")) != 0) { captureBuffer.write(i, WindowsAPIs.wsaGetLastError()); } ++i; } assert LibC.isSupported() : "LibC should always be supported"; - if ((statesToCapture & getMask(CapturableState.ERRNO)) != 0) { + if ((statesToCapture & getMask("errno")) != 0) { captureBuffer.write(i, LibC.errno()); } ++i; diff --git a/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsConfigurationParser.java b/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsConfigurationParser.java index e18c7e64dba1..12687e1f7c5b 100644 --- a/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsConfigurationParser.java @@ -302,7 +302,7 @@ private List parseDowncallOptions(EconomicMap map * information from the run-time NativeEntryPoint object. So, we always use * 'Linker.Option.captureCallState("errno")' here. */ - res.add(Linker.Option.captureCallState(CapturableState.ERRNO.stateName())); + res.add(Linker.Option.captureCallState("errno")); } } if (map.containsKey(DOWNCALL_OPTION_CRITICAL)) { From c34f0019584eaf2c92b6ba1e3b77ecb9ef818cee Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Mon, 5 May 2025 12:31:08 +0200 Subject: [PATCH 2/2] Update galahad jdk. --- common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.json b/common.json index ec2fe1be1a52..b9fd8237b837 100644 --- a/common.json +++ b/common.json @@ -8,7 +8,7 @@ "COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet", "jdks": { - "galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+21-2525", "platformspecific": true, "extrabundles": ["static-libs"]}, + "galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "2025-05-05-1027536.yudi.zheng.jdk", "platformspecific": true, "extrabundles": ["static-libs"]}, "oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]}, "labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },