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

8267726: ZGC: array_copy_requires_gc_barriers too strict #4230

Closed
wants to merge 3 commits into from

Conversation

neliasso
Copy link

@neliasso neliasso commented May 27, 2021

I found some cases where an arraycopy clone is eliminated with G1 but not with ZGC. This is probably something that wasn't updated fully after the transition to late gc barrier insertion.

During parse and optimizaton phases array_copy_requires_gc_barriers should return false for clones of oop-arrays. Clone of oop-arrays should be treated the same way as clones of primitive-arrays. During optimization phase - only clones of instances should return true - and that's because they can't be reduced to a raw bulk copy, Clones of instances must either become deconstructed into field copies, or be handled in a special call.

During expansion array_copy_requires_gc_barriers must return true - because we must use a copy with barriers.

To fix this I had to add an extra field to array_copy_requires_gc_barriers to be able to handle instance clones separately. I will follow up with a cleanup. The intersection of arraycopy-kinds and array_copy_requires_gc_barriers-method is the source of much unnecessary complexity.

Please review,
Best regards,
Nils Eliasson


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8267726: ZGC: array_copy_requires_gc_barriers too strict

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4230/head:pull/4230
$ git checkout pull/4230

Update a local copy of the PR:
$ git checkout pull/4230
$ git pull https://git.openjdk.java.net/jdk pull/4230/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4230

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4230.diff

@bridgekeeper
Copy link

bridgekeeper bot commented May 27, 2021

👋 Welcome back neliasso! 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
Copy link

openjdk bot commented May 27, 2021

@neliasso The following labels will be automatically applied to this pull request:

  • hotspot
  • shenandoah

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

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels May 27, 2021
@neliasso neliasso marked this pull request as ready for review May 28, 2021 09:11
@neliasso
Copy link
Author

/add label hotspot-compiler

@neliasso
Copy link
Author

/remove label hotspot

@openjdk openjdk bot added the rfr Pull request is ready for review label May 28, 2021
@openjdk
Copy link

openjdk bot commented May 28, 2021

@neliasso Unknown command add - for a list of valid commands use /help.

@openjdk
Copy link

openjdk bot commented May 28, 2021

@neliasso Unknown command remove - for a list of valid commands use /help.

@mlbridge
Copy link

mlbridge bot commented May 28, 2021

Webrevs

@neliasso
Copy link
Author

/label add hotpsot-compiler
/label remove hotspot

@openjdk
Copy link

openjdk bot commented May 28, 2021

@neliasso The label hotpsot-compiler is not a valid label. These labels are valid:

  • serviceability
  • hotspot
  • sound
  • hotspot-compiler
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • 2d
  • security
  • swing
  • hotspot-runtime
  • jmx
  • build
  • nio
  • beans
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr
  • awt

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label May 28, 2021
@openjdk
Copy link

openjdk bot commented May 28, 2021

@neliasso
The hotspot label was successfully removed.

@neliasso
Copy link
Author

/label add hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label May 28, 2021
@openjdk
Copy link

openjdk bot commented May 28, 2021

@neliasso
The hotspot-compiler label was successfully added.

@neliasso
Copy link
Author

Moved to hotspot-compiler

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please file a cleanup RFE and link it to this bug. Also, this might be a good candidate for adding a regression test once the IR verification framework is there.

@openjdk
Copy link

openjdk bot commented Jun 1, 2021

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

8267726: ZGC: array_copy_requires_gc_barriers too strict

Reviewed-by: thartmann, vlivanov

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

  • d47a77d: 8267773: PhaseStringOpts::int_stringSize doesn't handle min_jint correctly
  • 496fb90: 8267969: Add vectorized implementation for VectorMask.eq()
  • 1cea6ca: 8260360: IGV: Short name of combined nodes is hidden by background color
  • 7530c00: 8266559: XPathEvaluationResult.XPathResultType.NODESET maps to incorrect type
  • b98e52a: 8267570: The comment of the class JavacParser is not appropriate
  • 379376f: 8265130: Make ConstantDesc class hierarchy sealed
  • 00c7aee: 8267861: Update SourceVersion with new language features in 16 and 17
  • cb7128b: 8266950: Remove vestigial support for non-strict floating-point execution
  • 8624cb5: 8266530: HotSpot changes for JEP 306
  • 0ae4ceb: 8244146: javac changes for JEP 306
  • ... and 129 more: https://git.openjdk.java.net/jdk/compare/ee2651b9e5a9ab468b4be73d43b8f643e9e92042...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 Jun 1, 2021
@neliasso
Copy link
Author

neliasso commented Jun 1, 2021

I filed RFE https://bugs.openjdk.java.net/browse/JDK-8268020

Yes - all the arraycopy and clone tests should be ported to IR verification. I might do that as a part of the RFE.

Thanks for the review Tobias!

Copy link

@iwanowww iwanowww left a comment

Choose a reason for hiding this comment

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

Looks good.

@neliasso
Copy link
Author

neliasso commented Jun 2, 2021

Thanks for the reviews, Tobias and Vladimir.

/integrate

@neliasso
Copy link
Author

neliasso commented Jun 2, 2021

Thanks for the reviews, Tobias and Vladimir.

@openjdk openjdk bot closed this Jun 2, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 2, 2021
@openjdk
Copy link

openjdk bot commented Jun 2, 2021

@neliasso Since your change was applied there have been 139 commits pushed to the master branch:

  • d47a77d: 8267773: PhaseStringOpts::int_stringSize doesn't handle min_jint correctly
  • 496fb90: 8267969: Add vectorized implementation for VectorMask.eq()
  • 1cea6ca: 8260360: IGV: Short name of combined nodes is hidden by background color
  • 7530c00: 8266559: XPathEvaluationResult.XPathResultType.NODESET maps to incorrect type
  • b98e52a: 8267570: The comment of the class JavacParser is not appropriate
  • 379376f: 8265130: Make ConstantDesc class hierarchy sealed
  • 00c7aee: 8267861: Update SourceVersion with new language features in 16 and 17
  • cb7128b: 8266950: Remove vestigial support for non-strict floating-point execution
  • 8624cb5: 8266530: HotSpot changes for JEP 306
  • 0ae4ceb: 8244146: javac changes for JEP 306
  • ... and 129 more: https://git.openjdk.java.net/jdk/compare/ee2651b9e5a9ab468b4be73d43b8f643e9e92042...master

Your commit was automatically rebased without conflicts.

Pushed as commit bba3728.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated shenandoah shenandoah-dev@openjdk.org
3 participants