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
8253525: Implement getInstanceSize/sizeOf intrinsics #650
Conversation
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
@shipilev The following labels will be automatically applied to this pull request:
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. |
Webrevs
|
be722d4
to
d744a91
Compare
d744a91
to
6160f6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always run graalunit testing with new intrinsics.
You need to adjust Graal test:
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
I just ran |
/label remove core-libs |
@AlanBateman |
@vnkozlov I added the new block in |
...raalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
@shipilev 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:
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 30 new commits pushed to the
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 |
Thanks for review, @kvn! I would also like a review from someone from serviceability. /reviewers 2 |
@shipilev |
Friendly reminder. |
Hi Aleksey, I've not looked at the compiler generated code. Thanks, |
The test verifies the answer does not change if we hit JIT compilers in that code. Since we are doing C1/C2 intrinsics, we need to execute the loops more than compilation-threshold times. Since the current threshold is about 100K, doing 1M iterations seems good: it is well past the compilation threshold times, and there is time to re-enter the newly compiled method. The test run time is still sane, 1 minute on my Linux x86_64 fastdebug. I can do 200K iterations and -Xbatch instead, though, see new change. This drops the test run time to 30 seconds.
Renamed to
Old code calls into
I know that test is sensitive to compiler intrinsics bugs, as I used these tests to develop the intrinsics. If you inject simple off-by-one bugs into current C1/C2 intrinsics, new test catches that. The additional safety comes from the somewhat loose API requirement: it is specified to return the guess, and that guess might as well be wrong (not overly wrong though, for a quality implementation). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aleksey,
Thank you for the update!
It looks good to me.
One more nit, I forgot to list in my previous comment, is uneeded '()' around comparisons:
+ static final int REF_SIZE = ((compressedOops == null) || (compressedOops == true)) ? 4 : 8;
Thanks,
Serguei
Right. Fixed that. Thanks! |
@shipilev Since your change was applied there have been 61 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit b4d0186. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is fork off the SizeOf JEP, JDK-8249196. There is already the entry point in JDK that can use the intrinsic like this:
Instrumentation.getInstanceSize
. Therefore, we can implement the C1/C2 intrinsic now, hook it up toInstrumentation
, and let the tools use that fast path today.With this patch, JOL is able to be close to
deepSizeOf
implementation from SizeOf JEP.Example performance improvements for sizing up a custom linked list:
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/650/head:pull/650
$ git checkout pull/650