Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

8289558: Need spec clarification of j.l.foreign.*Layout #98

Closed
wants to merge 2 commits into from

Conversation

mcimadamore
Copy link
Contributor

@mcimadamore mcimadamore commented Jul 1, 2022

This patch fixes few javadoc issues in the memory layout API.
The main issues are that SequenceLayout::flatten and SequenceLayout::reshape still mention failures caused by a lack of size. But that condition is no longer possible in the new API.

The javadoc of ValueLayout::arrayElementVarHandle is suboptimal and can be clarified - UOE is only thrown if the value layout alignment is bigger than its size.

Finally, the MemoryLayout::equals method does not mention value layout carriers.

The JBS issue associated with this PR mentions also other issues, mostly related to the overly broad visibility of some of the methods in the javadoc (e.g. isPadding). Unfortunately, given the presence of an intermediate, non-public, abstract class, this is what we get from javadoc. Fixing these issues would require a deeper restructuring of the implementation, which would be too riskt at this stage.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires a CSR request to be approved

Issues

  • JDK-8289558: Need spec clarification of j.l.foreign.*Layout
  • JDK-8289577: Need spec clarification of j.l.foreign.*Layout (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk19 pull/98/head:pull/98
$ git checkout pull/98

Update a local copy of the PR:
$ git checkout pull/98
$ git pull https://git.openjdk.org/jdk19 pull/98/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 98

View PR using the GUI difftool:
$ git pr show -t 98

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/98.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 1, 2022

👋 Welcome back mcimadamore! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@@ -155,6 +159,7 @@ public boolean equals(Object that) {
}

return Objects.equals(name, ((AbstractLayout) that).name) &&
Objects.equals(size, ((AbstractLayout)that).size) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've consolidated things a bit here - the superclass should check name, size and alignment - while subclasses should only check additional properties.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 1, 2022
@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@mcimadamore The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jul 1, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 1, 2022

Webrevs

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jul 1, 2022
@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Jul 5, 2022
@openjdk
Copy link

openjdk bot commented Jul 5, 2022

@mcimadamore 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:

8289558: Need spec clarification of j.l.foreign.*Layout

Reviewed-by: psandoz, jvernee

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 16 new commits pushed to the master branch:

  • 0b6fd48: 8288128: S390X: Fix crashes after JDK-8284161 (Virtual Threads)
  • 30e134e: 8289091: move oop safety check from SharedRuntime::get_java_tid() to JavaThread::threadObj()
  • 29ea642: 8287847: Fatal Error when suspending virtual thread after it has terminated
  • f640fc5: 8067757: Incorrect HTML generation for copied javadoc with multiple @throws tags
  • 0dff327: 8289569: [test] java/lang/ProcessBuilder/Basic.java fails on Alpine/musl
  • 1a27164: 8287851: C2 crash: assert(t->meet(t0) == t) failed: Not monotonic
  • 5b5bc6c: 8287672: jtreg test com/sun/jndi/ldap/LdapPoolTimeoutTest.java fails intermittently in nightly run
  • dc4edd3: 8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId
  • c4dcce4: 8289619: JVMTI SelfSuspendDisablerTest.java failed with RuntimeException: Test FAILED: Unexpected thread state
  • f5cdaba: 8245268: -Xcomp is missing from java launcher documentation
  • ... and 6 more: https://git.openjdk.org/jdk19/compare/95497772e7207b5752e6ecace4a6686df2b45227...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 5, 2022
@mcimadamore
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jul 7, 2022

Going to push as commit 889150b.
Since your change was applied there have been 24 commits pushed to the master branch:

  • 8dd94a2: 8289196: Pattern domination not working properly for record patterns
  • 8f24d25: 6509045: {@inheritdoc} only copies one instance of the specified exception
  • 9a0fa82: 8288949: serviceability/jvmti/vthread/ContStackDepthTest/ContStackDepthTest.java failing
  • 55fa19b: 8289857: ProblemList jdk/jfr/event/runtime/TestActiveSettingEvent.java
  • 32b650c: 8289840: ProblemList vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java when run with vthread wrapper
  • ef3f2ed: 8289841: ProblemList vmTestbase/gc/gctests/MemoryEaterMT/MemoryEaterMT.java with ZGC on windows
  • 0526402: 8289477: Memory corruption with CPU_ALLOC, CPU_FREE on muslc
  • b3a0e48: 8289439: Clarify relationship between ThreadStart/ThreadEnd and can_support_virtual_threads capability
  • 0b6fd48: 8288128: S390X: Fix crashes after JDK-8284161 (Virtual Threads)
  • 30e134e: 8289091: move oop safety check from SharedRuntime::get_java_tid() to JavaThread::threadObj()
  • ... and 14 more: https://git.openjdk.org/jdk19/compare/95497772e7207b5752e6ecace4a6686df2b45227...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 7, 2022
@openjdk openjdk bot closed this Jul 7, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 7, 2022
@openjdk
Copy link

openjdk bot commented Jul 7, 2022

@mcimadamore Pushed as commit 889150b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants