Skip to content

Commit 6fcc7dc

Browse files
committed
[JDK-8358703] Adapt JDK-8358520: Improve lazy computation in BreakIteratorResourceBundle and related classes
PullRequest: graal/21028
2 parents 7733af3 + fea3ac9 commit 6fcc7dc

File tree

4 files changed

+9
-63
lines changed

4 files changed

+9
-63
lines changed

common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {
11-
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26-3319", "platformspecific": true, "extrabundles": ["static-libs"]},
11+
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-26+2-33", "platformspecific": true, "extrabundles": ["static-libs"]},
1212

1313
"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]},
1414
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ 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))) {
225225
return staticField;
226226
}
227227
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/compression/utils/BundleSerializationUtils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
2929
import java.util.List;
3030
import java.util.Map;
3131
import java.util.ResourceBundle;
32+
import java.util.function.Supplier;
3233

3334
import org.graalvm.nativeimage.Platform;
3435
import org.graalvm.nativeimage.Platforms;
@@ -53,7 +54,11 @@ public static Map<String, Object> extractContent(ResourceBundle bundle) {
5354
Class<?> clazz = bundle.getClass().getSuperclass();
5455
while (clazz != null && ResourceBundle.class.isAssignableFrom(clazz)) {
5556
try {
56-
return (Map<String, Object>) ReflectionUtil.lookupField(clazz, "lookup").get(bundle);
57+
Object lookup = ReflectionUtil.lookupField(clazz, "lookup").get(bundle);
58+
if (lookup instanceof Supplier) {
59+
return ((Supplier<Map<String, Object>>) lookup).get();
60+
}
61+
return (Map<String, Object>) lookup;
5762
} catch (ReflectionUtil.ReflectionUtilError | ReflectiveOperationException e) {
5863
clazz = clazz.getSuperclass();
5964
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_OpenListResourceBundle_SubstituteLoadLookup.java

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)