-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8356075: Support Shenandoah GC in JVMCI #25001
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
Conversation
👋 Welcome back rkennke! A progress list of the required criteria for merging this PR into |
@rkennke 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 77 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 |
@rkennke 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. |
/label remove build |
/label remove core-libs |
@rkennke |
@rkennke |
Webrevs
|
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.
LGTM
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.
A few questions:
static void pre_barrier(JavaThread* thread, oopDesc* orig) { | ||
write_ref_field_pre(orig, thread); | ||
} |
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.
So, why not export write_ref_field_pre
, instead of introducing this new method? Style/cleanliness, or something else? I am asking, because every time we add a new stub here, we would need to record it in AOTCache
tables for Leyden benefit.
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.
It's about the argument ordering. Graal expects the Thread* to be prependend, while other JITs call it with the Thread* appended. I guess we could change other JIT calls to also prepend the thread, or change the interface to not pass the Thread* at all. I chose to follow G1 and export both variants.
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.
Oh, so this matches JVMCIRuntime::write_barrier_pre
for G1 (weird place to have it, but oh well).
Does Graal need the Thread*
argument?
I think this method is only called when SATB buffer is full. So the performance of this method is likely not affected by getting the current thread down in caller. So I think it would be more straight-forward to sharpen ShenandoahRuntime::write_ref_field_pre
by dropping Thread*
and then exporting that. Maybe also under the SR::write_barrier_pre
name to be even more consistent for everything else.
Maybe @JohnTortugo wants to clean up more mess in C2 related to this :)
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.
Graal does not need the Thread* argument, but the runtime code behind write_ref_pre() currently uses it. I agree, it does not look performance critical to pass it through. However, getting rid of it seems to blow the scope of this PR. I'd rather do this as a follow-up.
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.
Actually, I'd probably add the new entry for Graal without the Thread* argument now, and fix the others in a follow-up. Otherwise we need to deal with it on the Graal side again later once we change the entry points.
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.
OK, but that follow-up risks changing the JVMCI interface again? How about we introduce:
static void write_barrier_pre(oopDesc* pre_val) {
write_ref_field_pre(pre_val, JavaThread::current());
}
...and then the follow-up purges the old write_ref_field_pre
? The implementation might need to be in .cpp
.
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.
LGTM. Thanks.
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.
All right, this works, thanks!
Thanks! /integrate |
Going to push as commit 614ba9f.
Your commit was automatically rebased without conflicts. |
@@ -227,12 +236,22 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { | |||
assert(base != nullptr, "unexpected byte_map_base"); | |||
cardtable_start_address = base; | |||
cardtable_shift = CardTable::card_shift(); | |||
} else if (bs->is_a(BarrierSet::ShenandoahBarrierSet)) { |
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.
This change is causing a failure in mach5 tier 1:
[2025-05-06T11:34:44,742Z] /workspace/open/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp:239:35: error: no member named 'ShenandoahBarrierSet' in 'BarrierSet'
[2025-05-06T11:34:44,742Z] } else if (bs->is_a(BarrierSet::ShenandoahBarrierSet)) {
[2025-05-06T11:34:44,742Z] ~~~~~~~~~~~~^
[2025-05-06T11:34:45,729Z] 1 error generated.
I assume it's missing #if INCLUDE_SHENANDOAHGC
.
In order to support Shenandoah GC in Graal, some changes are required in JVMCI, namely, export Shenandoah relevant symbols.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25001/head:pull/25001
$ git checkout pull/25001
Update a local copy of the PR:
$ git checkout pull/25001
$ git pull https://git.openjdk.org/jdk.git pull/25001/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25001
View PR using the GUI difftool:
$ git pr show -t 25001
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25001.diff
Using Webrev
Link to Webrev Comment