Navigation Menu

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

8263891: Changes for 8076985 missed the fix. #3102

Closed
wants to merge 1 commit into from

Conversation

vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Mar 20, 2021

The fix for JDK-8076985 was supposed to be this:
https://cr.openjdk.java.net/~kvn/8076985/webrev.00/src/hotspot/cpu/x86/x86_64.ad.udiff.html

But the final push had only comment change:
https://hg.openjdk.java.net/jdk/jdk/rev/4d1c4400c75d

Here is explanation of the fix from 8076985 RFR:

First, this is about how C2 generates code for *constant* class pointers.

A little history here. When we implemented compressed oops and class pointers we had PermGen and classes were Java objects. We used the same decoding/encoding code for oops and classes - we used the same register containing Heap Base address. It was profitable to decode constant class and reuse it [1]. Also we greatly benefited on SPARC since decoding 32-bit constant required 4 instructions instead of up to 7 instructions to load 64-bit constant.

Now compressed class decoding is different and always takes 2 instructions on x86 [2] if either base or shift is not 0.

As result we generated 3 instructions to get full class pointer from compressed 32-bit constant (example for base = 0, shift = 3):

movl $0x200001d5,%r11d
movabs $0x0,%r10
lea (%r10,%r11,8),%r10

Also when we store compressed class pointer into new object header we don't use register anymore on x86 - keeping it in register does not help now:

movl $0x200001d5,0x8(%rax)

Aleksey suggested to have only one instruction to load full 64-bit class pointer:

movq $0x100000EA8,%r10

It frees one register and uses 10 bytes instead of up to 20 bytes of code on x86.

In JDK 9 SAP contributed nice change [3] to have choice when to use 'compressed class pointer + decoding' or full '64-bit constant class pointer'. It significantly simplified changes for this RFE.


I ran performance testing but did not see difference - we don't use biased locking now and as result we don't need to load prototype header from class. But there are other places where we need load from class. 

Tested tier1-3


Progress

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

Issue

Reviewers

Download

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

To update a local copy of the PR:
$ git checkout pull/3102
$ git pull https://git.openjdk.java.net/jdk pull/3102/head

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 20, 2021

👋 Welcome back kvn! 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 Mar 20, 2021
@openjdk
Copy link

openjdk bot commented Mar 20, 2021

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

  • hotspot-compiler

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-compiler hotspot-compiler-dev@openjdk.org label Mar 20, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 20, 2021

Webrevs

Copy link
Contributor

@rwestrel rwestrel 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.

@openjdk
Copy link

openjdk bot commented Mar 22, 2021

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

8263891: Changes for 8076985 missed the fix.

Reviewed-by: roland

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

  • 42104e5: 8263488: Verify CWarningWindow works with metal rendering pipeline
  • 5a7f22a: 8263579: ZGC: Concurrent mark hangs with debug loglevel
  • 35cd945: 8263908: Build fails due to initialize_static_field_for_dump defined but not used after JDK-8263771
  • cd45538: 8263771: Refactor javaClasses initialization code to isolate dumping code
  • 118a49f: 8263846: Bad JNI lookup getFocusOwner in accessibility code on Mac OS X
  • cb742f9: 8255255: Update Apache Santuario (XML Signature) to version 2.2.1
  • d2c137d: 8263558: Possible NULL dereference in fast path arena free if ZapResourceArea is true
  • ab66d69: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe
  • 5b8233b: 8263871: On sem_destroy() failing we should assert
  • 96e5c3f: 8263890: Broken links to Unicode.org
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/d41f75120ddbce4573a3fda1a7085941a61387f3...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 Mar 22, 2021
@vnkozlov
Copy link
Contributor Author

Thank you, Roland.

@vnkozlov
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Mar 22, 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 Mar 22, 2021
@openjdk
Copy link

openjdk bot commented Mar 22, 2021

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

  • b2df513: 8261785: Calling "main" method in anonymous nested class crashes the JVM
  • 840ab7b: 8263894: Convert defaultPrinter and printers fields to local variables
  • ba504fc: 8187450: JNI local refs exceeds capacity warning in NetworkInterface::getAll
  • 0abbfb2: 8263729: [test] divert spurious output away from stream under test in ProcessBuilder Basic test
  • 6c2220e: 8263861: Shenandoah: Remove unused member in ShenandoahGCStateResetter
  • 5262d95: 8263855: Use the blessed modifier order in java.management/naming
  • 6f1bcb0: 8263593: Fix multiple typos in hsdis README
  • a9d2267: 8260589: Crash in JfrTraceIdLoadBarrier::load(_jclass*)
  • 42104e5: 8263488: Verify CWarningWindow works with metal rendering pipeline
  • 5a7f22a: 8263579: ZGC: Concurrent mark hangs with debug loglevel
  • ... and 17 more: https://git.openjdk.java.net/jdk/compare/d41f75120ddbce4573a3fda1a7085941a61387f3...master

Your commit was automatically rebased without conflicts.

Pushed as commit f08bf4b.

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

@vnkozlov vnkozlov deleted the JDK-8263891 branch March 22, 2021 16:46
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
2 participants