-
Notifications
You must be signed in to change notification settings - Fork 65
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
7903923: Derive C_* layouts directly from the Linker #269
base: master
Are you sure you want to change the base?
7903923: Derive C_* layouts directly from the Linker #269
Conversation
👋 Welcome back nbenalla! A progress list of the required criteria for merging this PR into |
@nizarbenalla This change now passes all automated pre-integration checks. 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
.withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); | ||
"""); | ||
if (TypeImpl.IS_WINDOWS) { | ||
first.appendIndentedLines("public static final ValueLayout.OfInt C_LONG = ValueLayout.JAVA_INT;"); | ||
first.appendIndentedLines("public static final ValueLayout.OfDouble C_LONG_DOUBLE = ValueLayout.JAVA_DOUBLE;"); | ||
first.appendIndentedLines("public static final ValueLayout.OfInt C_LONG = (ValueLayout.OfInt) Linker.nativeLinker().canonicalLayouts().get(\"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.
The canonical layout for this has name long
. But the result is a ValueLayout.OfInt
(because FFM uses int
to model values of that type on Windows). In other words, the only thing that changes in Windows is the cast that should be to OfInt
, not to OfLong
.
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.
Thanks for explaining, will fix it.
first.appendIndentedLines("public static final ValueLayout.OfInt C_LONG = ValueLayout.JAVA_INT;"); | ||
first.appendIndentedLines("public static final ValueLayout.OfDouble C_LONG_DOUBLE = ValueLayout.JAVA_DOUBLE;"); | ||
first.appendIndentedLines("public static final ValueLayout.OfInt C_LONG = (ValueLayout.OfInt) Linker.nativeLinker().canonicalLayouts().get(\"int\");"); | ||
first.appendIndentedLines("public static final ValueLayout.OfDouble C_LONG_DOUBLE = (ValueLayout.OfDouble) Linker.nativeLinker().canonicalLayouts().get(\"double\");"); |
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, there's no canonical layout for long double
. (but what you did retains compatibility with what we had). But I wonder if FFM should add one? @JornVernee , @minborg ?
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 would be okay with adding long double
as a canonical layout, just on Windows, if that's what you mean.
I'm seeing multiple failures on windows (and only on windows), will need to investigate. |
Depending on the platform, different
C_*
correspond to differentJAVA_*
types. We can get those values directly from the linker.This patch can allows us to have a common class for different platforms.
Please review, and thanks in advance!
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jextract.git pull/269/head:pull/269
$ git checkout pull/269
Update a local copy of the PR:
$ git checkout pull/269
$ git pull https://git.openjdk.org/jextract.git pull/269/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 269
View PR using the GUI difftool:
$ git pr show -t 269
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jextract/pull/269.diff
Using Webrev
Link to Webrev Comment