Skip to content

Commit 167a9e6

Browse files
committed
Synchronize a set in CheckGraalInvariants.
1 parent f0c8789 commit 167a9e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CheckGraalInvariants.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,10 @@ private static void loadVerifiers(List<VerifyPhase<CoreProviders>> verifiers) {
546546
}
547547

548548
/**
549-
* Initializes a map from a field annotated by {@link Option} to a set that will be used to
550-
* collect methods that accesses the option field.
551-
*
552-
* @param tool
549+
* Initializes a map from fields annotated with {@link Option} whose usages should be checked to
550+
* empty sets that will collect the methods accessing each field.
551+
* <p>
552+
* The sets are synchronized to support parallel processing of methods.
553553
*/
554554
private static Map<ResolvedJavaField, Set<ResolvedJavaMethod>> initOptionFieldUsagesMap(InvariantsTool tool, MetaAccessProvider metaAccess, List<String> errors) {
555555
Map<ResolvedJavaField, Set<ResolvedJavaMethod>> optionFields = new EconomicHashMap<>();
@@ -559,7 +559,7 @@ private static Map<ResolvedJavaField, Set<ResolvedJavaMethod>> initOptionFieldUs
559559
Class<?> declaringClass = option.getDeclaringClass();
560560
try {
561561
Field javaField = declaringClass.getDeclaredField(option.getFieldName());
562-
optionFields.put(metaAccess.lookupJavaField(javaField), new EconomicHashSet<>());
562+
optionFields.put(metaAccess.lookupJavaField(javaField), Collections.synchronizedSet(new EconomicHashSet<>()));
563563
} catch (NoSuchFieldException e) {
564564
errors.add(e.toString());
565565
}

0 commit comments

Comments
 (0)