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

8257423: [PPC64] Support -XX:-UseInlineCaches #1521

Conversation

TheRealMDoerr
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr commented Nov 30, 2020

The JVM currently runs into Unimplemented() when using -XX:-UseInlineCaches in C2 code (postalloc_expand_java_dynamic_call_sched).
I'd like to enable the existing code in postalloc_expand_java_dynamic_call_sched and fix MachCallDynamicJavaNode::ret_addr_offset() and MacroAssembler::instr_size_for_decode_klass_not_null().
I suggest to use scratch emit to determine the size, because there are too many cases and emitting it once is fast.


Progress

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

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1521/head:pull/1521
$ git checkout pull/1521

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 30, 2020

👋 Welcome back mdoerr! 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 label Nov 30, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Nov 30, 2020

@TheRealMDoerr 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 30, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 30, 2020

Webrevs

tstuefe
tstuefe approved these changes Dec 1, 2020
Copy link
Member

@tstuefe tstuefe left a comment

Hi Martin,

this looks good to my non-compiler-eyes.

Cheers, Thomas

} else {
// Determine by scratch emit.
ResourceMark rm;
int code_size = 8 * BytesPerInstWord;
Copy link
Member

@tstuefe tstuefe Dec 1, 2020

Choose a reason for hiding this comment

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

Is this enough? Can CodeBuffers expand?

Copy link
Contributor Author

@TheRealMDoerr TheRealMDoerr Dec 1, 2020

Choose a reason for hiding this comment

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

Maximum size is 7 instructions.

ResourceMark rm;
int code_size = 8 * BytesPerInstWord;
CodeBuffer cb("decode_klass_not_null scratch buffer", code_size, 0);
MacroAssembler* a = new MacroAssembler(&cb);
Copy link
Member

@tstuefe tstuefe Dec 1, 2020

Choose a reason for hiding this comment

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

Idle thought: if this is done frequently, maybe MacroAssembler could have a "dry run" mode with no attached CodeBuffer, just counting instructions.

Copy link
Contributor Author

@TheRealMDoerr TheRealMDoerr Dec 1, 2020

Choose a reason for hiding this comment

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

The scratch emit is only executed during the first call. Afterwards, the computed_size is just returned and we don't call the CodeBuffer constructor any more.

Copy link
Contributor

@reinrich reinrich Dec 4, 2020

Choose a reason for hiding this comment

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

I just asked myself how this is thread safe then. Well it is not. The scratch emit ist executed at most once /per thread/ ;)

Copy link
Contributor Author

@TheRealMDoerr TheRealMDoerr Dec 4, 2020

Choose a reason for hiding this comment

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

Interesting point. Right, it doesn't have to be thread safe. All threads which compute it concurrently will compute the same result.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2020

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

8257423: [PPC64] Support -XX:-UseInlineCaches

Reviewed-by: stuefe, rrich

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

  • feabdde: 8251843: jfr/tool/TestPrintJSON.java fails intermittently
  • c6f93ec: 8257707: Fix incorrect format string in Http1HeaderParser
  • fbdc187: 8257624: C2: PhaseMacroExpand::eliminate_macro_nodes() crashes on out-of-bounds access into macro node array
  • fd6756e: 8257634: C2: Introduce IncrementalInliningForceCleanup diagnostic flag
  • af6b7f9: 8257743: Minimal build on AArch64 failed with --disable-precompiled-headers
  • d6dd440: 8256264: Printed GlyphVector outline with low DPI has bad quality on Windows
  • 2b4a423: 8255542: Attribute length of Module, ModulePackages and other attributes is ignored
  • ca40267: 8257509: Strengthen requirements to call G1HeapVerifier::verify(VerifyOption)
  • 4a85514: 8257182: JCK test failures in integer / long rotation tests
  • f33808f: 8257631: C2: Assertion failure in ArrayCopyNode::get_count() during late inlining
  • ... and 96 more: https://git.openjdk.java.net/jdk/compare/e3abe51a31a4dc544f26c9423c67d6f7b916e8a9...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 label Dec 1, 2020
@TheRealMDoerr
Copy link
Contributor Author

@TheRealMDoerr TheRealMDoerr commented Dec 1, 2020

Thanks for reviewing it!

Copy link
Contributor

@reinrich reinrich left a comment

Looks good to me.

Thanks, Richard.

ResourceMark rm;
int code_size = 8 * BytesPerInstWord;
CodeBuffer cb("decode_klass_not_null scratch buffer", code_size, 0);
MacroAssembler* a = new MacroAssembler(&cb);
Copy link
Contributor

@reinrich reinrich Dec 4, 2020

Choose a reason for hiding this comment

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

I just asked myself how this is thread safe then. Well it is not. The scratch emit ist executed at most once /per thread/ ;)

@TheRealMDoerr
Copy link
Contributor Author

@TheRealMDoerr TheRealMDoerr commented Dec 4, 2020

Thanks a lot for the reviews!
/integrate

@openjdk openjdk bot closed this Dec 4, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 4, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 4, 2020

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

  • feabdde: 8251843: jfr/tool/TestPrintJSON.java fails intermittently
  • c6f93ec: 8257707: Fix incorrect format string in Http1HeaderParser
  • fbdc187: 8257624: C2: PhaseMacroExpand::eliminate_macro_nodes() crashes on out-of-bounds access into macro node array
  • fd6756e: 8257634: C2: Introduce IncrementalInliningForceCleanup diagnostic flag
  • af6b7f9: 8257743: Minimal build on AArch64 failed with --disable-precompiled-headers
  • d6dd440: 8256264: Printed GlyphVector outline with low DPI has bad quality on Windows
  • 2b4a423: 8255542: Attribute length of Module, ModulePackages and other attributes is ignored
  • ca40267: 8257509: Strengthen requirements to call G1HeapVerifier::verify(VerifyOption)
  • 4a85514: 8257182: JCK test failures in integer / long rotation tests
  • f33808f: 8257631: C2: Assertion failure in ArrayCopyNode::get_count() during late inlining
  • ... and 96 more: https://git.openjdk.java.net/jdk/compare/e3abe51a31a4dc544f26c9423c67d6f7b916e8a9...master

Your commit was automatically rebased without conflicts.

Pushed as commit 1d2d981.

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

@TheRealMDoerr TheRealMDoerr deleted the 8257423_PPC64_no_UseInlineCaches branch Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot integrated
3 participants