Skip to content

[JDK-8356156] Adapt JDK-8356126: Duplication handling and optimization of CaptureCallState #11135

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

Open
wants to merge 2 commits into
base: galahad
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private List<Linker.Option> parseDowncallOptions(EconomicMap<String, Object> 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)) {
Expand Down
Loading