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

8269986: Remove +3 from Symbol::identity_hash() #6287


Copy link

@iklam iklam commented Nov 7, 2021

Please review this trivial change that removes the +3 from here:

  unsigned Symbol::identity_hash() const {
    unsigned addr_bits = (unsigned)((uintptr_t)this >> (LogMinObjAlignmentInBytes + 3));
    return ((unsigned)extract_hash(_hash_and_refcount) & 0xffff) |
           ((addr_bits ^ (length() << 8) ^ (( _body[0] << 8) | _body[1])) << 16);

The +3 was intended to avoid getting the same value for these bits:

((uintptr_t)this) >> LogMinObjAlignmentInBytes) & 0x07)

However, as shown in the bug report, the values for these bits are evenly distributed. So the +3 is not necessary and may actually be counter-productive.

Testing: Oracle CI tiers 1-4


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




Using git

Checkout this PR locally:
$ git fetch pull/6287/head:pull/6287
$ git checkout pull/6287

Update a local copy of the PR:
$ git checkout pull/6287
$ git pull pull/6287/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6287

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

Using diff file

Download this PR as a diff file:

Copy link

@bridgekeeper bridgekeeper bot commented Nov 7, 2021

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

Copy link

@openjdk openjdk bot commented Nov 7, 2021

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

  • hotspot

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 hotspot label Nov 7, 2021
@iklam iklam marked this pull request as ready for review Nov 7, 2021
@openjdk openjdk bot added the rfr label Nov 7, 2021
Copy link

@mlbridge mlbridge bot commented Nov 7, 2021


coleenp approved these changes Nov 9, 2021
Copy link

@coleenp coleenp left a comment

Looks good! Thanks for doing the performance analysis.

Copy link

@openjdk openjdk bot commented Nov 9, 2021

@iklam This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file for details.

After integration, the commit message for the final commit will be:

8269986: Remove +3 from Symbol::identity_hash()

Reviewed-by: coleenp

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

  • 0699220: 8268882: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
  • d7012fb: 8276880: Remove java/lang/RuntimeTests/exec/ExecWithDir as unnecessary
  • f9024d0: 8230130: javadoc search result dialog shows cut off headers for long results
  • 055de6f: 8223358: Incorrect HTML structure in annotation pages
  • a60e912: 8198626: java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html fails on mac
  • dde959d: 8276808: java/nio/channels/Channels/ timed out
  • daf77eb: 8276337: Use override specifier in HeapDumper
  • 93692ea: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat
  • e35abe3: 8256208: Javadoc's generated overview does not show classes of unnamed package
  • f65db88: 8276841: Add support for Visual Studio 2022
  • ... and 29 more:

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 label Nov 9, 2021
Copy link
Member Author

@iklam iklam commented Nov 10, 2021

Thanks @coleenp for the review. @cl4es also reviewed it off-line. Since the change is trivial, I am pushing it now.

Copy link

@openjdk openjdk bot commented Nov 10, 2021

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

  • 2374abd: 8276678: Malformed Javadoc inline tags in JDK source in com/sun/beans/decoder/
  • 67c2714: 8276889: Improve compatibility discussion in instanceKlass.cpp
  • a5c160c: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs
  • ce3ed65: 8273154: Provide a JavadocTester method for non-overlapping, unordered output matching
  • f561d3c: 8276864: Update boot JDKs to 17.0.1 in GHA
  • 38ec3a1: 8276672: Cannot build hsdis on WSL
  • 55b36c6: 8276825: hotspot/runtime/SelectionResolution test errors
  • 0f23c6a: 8276926: Use String.valueOf() when initializing File.separator and File.pathSeparator
  • a0b8445: 8276846: JDK-8273416 is incomplete for UseSSE=1
  • a3f710e: 8276215: Intrinsics matchers should handle native method flags better
  • ... and 47 more:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 10, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 10, 2021
Copy link

@openjdk openjdk bot commented Nov 10, 2021

@iklam Pushed as commit df02daa.

💡 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
hotspot integrated
3 participants