Skip to content
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

8323601: Improve LayoutPath.PathElement::toString #17417

Closed
wants to merge 5 commits into from

Conversation

minborg
Copy link
Contributor

@minborg minborg commented Jan 15, 2024

This PR proposes to add an improved Improve LayoutPath.PathElement::toString method simplifying debugging.

Opinions and suggestions for static PathElement sequenceElement(long start, long step) are welcome.


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

Issue

  • JDK-8323601: Improve LayoutPath.PathElement::toString (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17417

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17417.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 15, 2024

👋 Welcome back pminborg! 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 15, 2024
@openjdk
Copy link

openjdk bot commented Jan 15, 2024

@minborg 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 Jan 15, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 15, 2024

Webrevs

@@ -949,7 +954,8 @@ static PathElement sequenceElement() {
*/
static PathElement dereferenceElement() {
return new LayoutPath.PathElementImpl(PathKind.DEREF_ELEMENT,
LayoutPath::derefElement);
LayoutPath::derefElement,
"*");
Copy link
Member

Choose a reason for hiding this comment

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

It seems that this would result in paths like a.b* rather than the *a.b, which is correct C syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. Additional logic is needed to form a correct C syntax. It would be possible to provide a method that does this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could add such a method under another issue (https://bugs.openjdk.org/browse/JDK-8323746) because it will be much easier to implement it once the contemplated changes for that issue are in.

Copy link
Contributor

Choose a reason for hiding this comment

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

After some more thinking, I think the toString should just mimic the expression used to create the path.
e.g.
groupElement("foo")
or
sequenceElement()
sequenceElement(2)
sequenceElement(2, 3)
etc.

Copy link
Member

@JornVernee JornVernee left a comment

Choose a reason for hiding this comment

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

I like the latest approach. It leans on familiar names/syntax. I think that will be more intuitive than mimicking C syntax.

@openjdk
Copy link

openjdk bot commented Jan 30, 2024

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

8323601: Improve LayoutPath.PathElement::toString

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

  • f0024f5: 8324734: Relax too-strict assert(VM_Version::supports_evex()) in Assembler::locate_operand()
  • fd8adf3: 8324856: Serial: Move Generation::is_in to DefNewGeneration
  • a1d65eb: 8324125: Improve class initialization barrier in TemplateTable::_new for RISC-V
  • b6d364a: 8324865: windows-x64-slowdebug still does not build after JDK-8324840
  • 64c3642: 8242564: javadoc crashes:: class cast exception com.sun.tools.javac.code.Symtab$6
  • e999dfc: 8323503: x86: Shorter movptr(reg, imm) for 32-bit unsigned immediates
  • 84deeb6: 8324667: fold Parse::seems_stable_comparison()
  • fb07bbe: 8324717: Remove HotSpotJVMCICompilerFactory
  • d1e6763: 8324733: [macos14] Problem list tests which fail due to macOS bug described in JDK-8322653
  • c1281e6: 8324678: Replace NULL with nullptr in HotSpot gtests
  • ... and 2 more: https://git.openjdk.org/jdk/compare/fe0eec7e20bc4c39d6c2b58d81ffd5c0ef1fdeda...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 Jan 30, 2024
@minborg
Copy link
Contributor Author

minborg commented Jan 31, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jan 31, 2024

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

  • f7121de: 8322648: Improve class initialization barrier in TemplateTable::_new for PPC
  • 577de17: 8259550: The content of the print out displayed incomplete with the NimbusLAF
  • 83b3c9b: 8322649: Improve class initialization barrier in TemplateTable::_new for S390
  • 7d1a488: 8324861: Exceptions::wrap_dynamic_exception() doesn't have ResourceMark
  • c3c1d5b: 8324998: Add test cases for String.regionMatches comparing Turkic dotted/dotless I with uppercase latin I
  • 8892d45: 8324582: Replace -Djava.util.concurrent.ForkJoinPool.common.parallelism to -Djdk.virtualThreadScheduler.maxPoolSize in jvmti vthread tests
  • 11e28bd: 8324794: C2 SuperWord: do not ignore reductions in SuperWord::unrolling_analysis
  • d51aaf6: 8323950: Null CLD while loading shared lambda proxy class with javaagent active
  • f57c722: 8324880: Rename get_stack_trace.h
  • f0024f5: 8324734: Relax too-strict assert(VM_Version::supports_evex()) in Assembler::locate_operand()
  • ... and 11 more: https://git.openjdk.org/jdk/compare/fe0eec7e20bc4c39d6c2b58d81ffd5c0ef1fdeda...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 31, 2024

@minborg Pushed as commit ec56c72.

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

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Good job

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

Successfully merging this pull request may close these issues.

3 participants