Skip to content

Commit 8a4953a

Browse files
committedMar 31, 2025
8343607: C2: Shenandoah crashes during barrier expansion in Continuation::enter
Backport-of: 45c914c3ad8fbc406af9ba9dec97f11c28c91299
1 parent 13e1932 commit 8a4953a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,9 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
11491149
}
11501150
}
11511151
}
1152+
// Load barrier on the control output of a call
11521153
if ((ctrl->is_Proj() && ctrl->in(0)->is_CallJava()) || ctrl->is_CallJava()) {
1153-
CallNode* call = ctrl->is_Proj() ? ctrl->in(0)->as_CallJava() : ctrl->as_CallJava();
1154+
CallJavaNode* call = ctrl->is_Proj() ? ctrl->in(0)->as_CallJava() : ctrl->as_CallJava();
11541155
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
11551156
// The rethrow call may have too many projections to be
11561157
// properly handled here. Given there's no reason for a
@@ -1186,6 +1187,14 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
11861187
CallProjections projs;
11871188
call->extract_projections(&projs, false, false);
11881189

1190+
// If this is a runtime call, it doesn't have an exception handling path
1191+
if (projs.fallthrough_catchproj == nullptr) {
1192+
assert(call->method() == nullptr, "should be runtime call");
1193+
assert(projs.catchall_catchproj == nullptr, "runtime call should not have catch all projection");
1194+
continue;
1195+
}
1196+
1197+
// Otherwise, clone the barrier so there's one for the fallthrough and one for the exception handling path
11891198
#ifdef ASSERT
11901199
VectorSet cloned;
11911200
#endif

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Mar 31, 2025

@openjdk-notifier[bot]
Please sign in to comment.