-
Notifications
You must be signed in to change notification settings - Fork 61
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
8312615: Ensure jdk_foreign tests pass on linux-x86 #849
Conversation
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
dependencies: ["devkit", "gtest", "libffi"], | ||
configure_args: concat(common.configure_args_32bit, [ | ||
"--with-jvm-variants=minimal,server", | ||
"--with-zlib=system", | ||
"--with-libffi=" + input.get("libffi", "home_path"), | ||
"--enable-libffi-bundling", | ||
"--enable-fallback-linker" | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'm adding the libffi dependency and enabling the fallback linker on linux-x86 (in our CI)
@@ -184,18 +186,23 @@ enum LayoutKind { | |||
this.layout = segment; | |||
} | |||
|
|||
private static final Pattern LAYOUT_PATTERN = Pattern.compile("^(?<align>\\d+%)?(?<char>[azcsifjdAZCSIFJD])\\d+$"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 32-bit platforms, the string representation of e.g. long
is 4%j8
. This pattern helps to filter out the 4%
.
* @requires vm.bits == 64 | ||
* @run testng/othervm -Xmx4G -XX:MaxDirectMemorySize=1M --enable-native-access=ALL-UNNAMED TestSegments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails on 32-bit platforms due to the -Xmx4G
flag. I've disabled it there.
public static final MemoryLayout S_PDI_LAYOUT = switch ((int) ValueLayout.ADDRESS.byteSize()) { | ||
case 8 -> MemoryLayout.structLayout( | ||
C_POINTER.withName("p0"), | ||
C_DOUBLE.withName("p1"), | ||
C_INT.withName("p2"), | ||
MemoryLayout.paddingLayout(4)); | ||
case 4 -> MemoryLayout.structLayout( | ||
C_POINTER.withName("p0"), | ||
C_DOUBLE.withName("p1"), | ||
C_INT.withName("p2")); | ||
default -> throw new UnsupportedOperationException("Unsupported address size"); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both TestUpcallHighArity and TestUpcallStructScope use this layout. I've moved it here to avoid declaring it twice.
Webrevs
|
/** | ||
* The layout for the {@code size_t} C type | ||
*/ | ||
public static final ValueLayout C_SIZE_T = ValueLayout.ADDRESS.byteSize() == 8 ? C_LONG_LONG : C_INT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you set SIZE_T using the canonical layout API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. We could change the other layouts in this file over to that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update this list of layouts to use canonicalLayouts() instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@JornVernee This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit f31c46c. |
@JornVernee Pushed as commit f31c46c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Ensure that the jdk_foreign tests pass on linux-x86.
This is useful to ensure that there are no hard to fix issues (that would require API changes) when trying to use the linker API on a 32-bit platform. This is a good indication that the FFM API is ready for finalization.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/panama-foreign.git pull/849/head:pull/849
$ git checkout pull/849
Update a local copy of the PR:
$ git checkout pull/849
$ git pull https://git.openjdk.org/panama-foreign.git pull/849/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 849
View PR using the GUI difftool:
$ git pr show -t 849
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/panama-foreign/pull/849.diff
Webrev
Link to Webrev Comment