Skip to content

Commit 96e2ddf

Browse files
committed
Merge tag 'jdk-26+2'
2 parents f18de41 + 50f4de8 commit 96e2ddf

File tree

7 files changed

+12
-169
lines changed

7 files changed

+12
-169
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-83", "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 },

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SunMiscSubstitutions.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ private Class<?> defineClass0(String name, byte[] b, int off, int len, ClassLoad
198198

199199
@TargetClass(jdk.internal.access.SharedSecrets.class)
200200
final class Target_jdk_internal_access_SharedSecrets {
201-
@Substitute
202-
private static Target_jdk_internal_access_JavaAWTAccess getJavaAWTAccess() {
203-
return null;
204-
}
205-
206201
/**
207202
* The JavaIOAccess implementation installed by the class initializer of java.io.Console
208203
* captures state like "is a tty". The only way to remove such state is by resetting the field.
@@ -215,10 +210,6 @@ private static Target_jdk_internal_access_JavaAWTAccess getJavaAWTAccess() {
215210
final class Target_jdk_internal_access_JavaIOAccess {
216211
}
217212

218-
@TargetClass(jdk.internal.access.JavaAWTAccess.class)
219-
final class Target_jdk_internal_access_JavaAWTAccess {
220-
}
221-
222213
@TargetClass(className = "sun.reflect.misc.MethodUtil")
223214
final class Target_sun_reflect_misc_MethodUtil {
224215
@Substitute

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/BundleContentSubstitutedLocalizationSupport.java

Lines changed: 2 additions & 3 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
@@ -52,7 +52,6 @@
5252

5353
import jdk.graal.compiler.debug.GraalError;
5454
import sun.util.resources.OpenListResourceBundle;
55-
import sun.util.resources.ParallelListResourceBundle;
5655

5756
public class BundleContentSubstitutedLocalizationSupport extends LocalizationSupport {
5857

@@ -135,7 +134,7 @@ private static boolean isBundleSupported(ResourceBundle bundle) {
135134

136135
@Platforms(Platform.HOSTED_ONLY.class)
137136
private static boolean isBundleSupported(Class<?> bundleClass) {
138-
return ListResourceBundle.class.isAssignableFrom(bundleClass) || OpenListResourceBundle.class.isAssignableFrom(bundleClass) || ParallelListResourceBundle.class.isAssignableFrom(bundleClass);
137+
return ListResourceBundle.class.isAssignableFrom(bundleClass) || OpenListResourceBundle.class.isAssignableFrom(bundleClass);
139138
}
140139

141140
@Platforms(Platform.HOSTED_ONLY.class)

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.

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

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

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 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
@@ -102,7 +102,6 @@
102102
import sun.util.locale.provider.LocaleProviderAdapter;
103103
import sun.util.locale.provider.ResourceBundleBasedAdapter;
104104
import sun.util.resources.LocaleData;
105-
import sun.util.resources.ParallelListResourceBundle;
106105

107106
/**
108107
* LocalizationFeature is the core class of SVM localization support. It contains all the options
@@ -159,10 +158,7 @@ public class LocalizationFeature implements InternalFeature {
159158

160159
private Function<String, Class<?>> findClassByName;
161160

162-
private Field baseLocaleCacheField;
163-
private Field localeCacheField;
164161
private Field candidatesCacheField;
165-
private Field localeObjectCacheMapField;
166162
private Field langAliasesCacheField;
167163
private Field parentLocalesMapField;
168164
@Platforms(Platform.HOSTED_ONLY.class) private ImageClassLoader imageClassLoader;
@@ -291,9 +287,6 @@ public void duringSetup(DuringSetupAccess a) {
291287
}
292288
langAliasesCacheField = access.findField(CLDRLocaleProviderAdapter.class, "langAliasesCache");
293289
parentLocalesMapField = access.findField(CLDRLocaleProviderAdapter.class, "parentLocalesMap");
294-
baseLocaleCacheField = access.findField("sun.util.locale.BaseLocale$1InterningCache", "CACHE");
295-
localeCacheField = access.findField("java.util.Locale$LocaleCache", "LOCALE_CACHE");
296-
localeObjectCacheMapField = null;
297290
candidatesCacheField = access.findField("java.util.ResourceBundle$Control", "CANDIDATES_CACHE");
298291

299292
String reason = "All ResourceBundleControlProvider that are registered as services end up as objects in the image heap, and are therefore registered to be initialized at image build time";
@@ -346,27 +339,11 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
346339
@Override
347340
public void duringAnalysis(DuringAnalysisAccess a) {
348341
DuringAnalysisAccessImpl access = (DuringAnalysisAccessImpl) a;
349-
scanLocaleCache(access, baseLocaleCacheField);
350-
scanLocaleCache(access, localeCacheField);
351-
scanLocaleCache(access, candidatesCacheField);
342+
access.rescanRoot(candidatesCacheField);
352343
access.rescanRoot(langAliasesCacheField);
353344
access.rescanRoot(parentLocalesMapField);
354345
}
355346

356-
private void scanLocaleCache(DuringAnalysisAccessImpl access, Field cacheFieldField) {
357-
access.rescanRoot(cacheFieldField);
358-
359-
Object localeCache;
360-
try {
361-
localeCache = cacheFieldField.get(null);
362-
} catch (ReflectiveOperationException ex) {
363-
throw VMError.shouldNotReachHere(ex);
364-
}
365-
if (localeCache != null && localeObjectCacheMapField != null) {
366-
access.rescanField(localeCache, localeObjectCacheMapField);
367-
}
368-
}
369-
370347
@Platforms(Platform.HOSTED_ONLY.class)
371348
private static Set<Locale> processLocalesOption() {
372349
Set<Locale> locales = new HashSet<>();
@@ -507,10 +484,6 @@ protected void addResourceBundles() {
507484
prepareNegativeBundle(ConfigurationCondition.alwaysTrue(), baseName, locale, true);
508485
continue; /* No bundle for this `locale`. */
509486
}
510-
if (bundle instanceof ParallelListResourceBundle) {
511-
/* Make sure the `bundle` content is complete. */
512-
localeData.setSupplementary((ParallelListResourceBundle) bundle);
513-
}
514487
prepareJDKBundle(bundle, locale);
515488
}
516489
}

0 commit comments

Comments
 (0)