Skip to content

Commit f4f66d6

Browse files
committed
Lift volatile constraint if JDK > 25
1 parent bd3008c commit f4f66d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/KnownTruffleTypes.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,12 @@ private static ResolvedJavaField getThrowableJFRTracingField(MetaAccessProvider
221221
ResolvedJavaType throwableType = metaAccess.lookupJavaType(Throwable.class);
222222
for (ResolvedJavaField staticField : throwableType.getStaticFields()) {
223223
if (staticField.getName().equals("jfrTracing") &&
224-
staticField.getType().equals(metaAccess.lookupJavaType(boolean.class)) && staticField.isVolatile()) {
224+
staticField.getType().equals(metaAccess.lookupJavaType(boolean.class)) &&
225+
(JavaVersionUtil.JAVA_SPEC > 25 || staticField.isVolatile())) {
225226
return staticField;
226227
}
227228
}
228-
throw GraalError.shouldNotReachHere("Field Throwable.jfrTracing not found. This field was added in JDK-22+24 and must be present. " +
229+
throw GraalError.shouldNotReachHere("Field Throwable.jfrTracing not found. This field was added in JDK-22+24 (as volatile and later changed in JDK26 to not volatile) and must be present." +
229230
"This either means this field was removed in which case this code needs to be adapted or the meta access lookup above failed which should never happen.");
230231
}
231232

0 commit comments

Comments
 (0)