2424 */
2525package com .oracle .svm .hosted .code ;
2626
27- import java .util .HashMap ;
28- import java .util .HashSet ;
2927import java .util .List ;
3028import java .util .Map ;
3129import java .util .Set ;
30+ import java .util .concurrent .ConcurrentHashMap ;
3231import java .util .stream .Collectors ;
3332
3433import org .graalvm .compiler .nodeinfo .Verbosity ;
@@ -122,10 +121,10 @@ public DeoptSourceFrameInfo mergeStateInfo(FrameState state) {
122121
123122 protected boolean sealed ;
124123
125- private final Set <AnalysisMethod > forcedCompilations = new HashSet <> ();
126- private final Set <AnalysisMethod > frameInformationRequired = new HashSet <> ();
127- private final Map <AnalysisMethod , Map <Long , DeoptSourceFrameInfo >> deoptEntries = new HashMap <>();
128- private final Set <AnalysisMethod > deoptInliningExcludes = new HashSet <> ();
124+ private final Set <AnalysisMethod > forcedCompilations = ConcurrentHashMap . newKeySet ();
125+ private final Set <AnalysisMethod > frameInformationRequired = ConcurrentHashMap . newKeySet ();
126+ private final Map <AnalysisMethod , Map <Long , DeoptSourceFrameInfo >> deoptEntries = new ConcurrentHashMap <>();
127+ private final Set <AnalysisMethod > deoptInliningExcludes = ConcurrentHashMap . newKeySet ();
129128
130129 public static CompilationInfoSupport singleton () {
131130 return ImageSingletons .lookup (CompilationInfoSupport .class );
@@ -150,7 +149,7 @@ public void registerFrameInformationRequired(AnalysisMethod method) {
150149 * deoptimization target. No bci needs to be registered, it is enough to have a non-null
151150 * value in the map.
152151 */
153- deoptEntries .computeIfAbsent (method , m -> new HashMap <>());
152+ deoptEntries .computeIfAbsent (method , m -> new ConcurrentHashMap <>());
154153 }
155154
156155 public boolean isFrameInformationRequired (ResolvedJavaMethod method ) {
@@ -163,7 +162,7 @@ public void registerDeoptEntry(FrameState state) {
163162 assert state .bci >= 0 ;
164163 long encodedBci = FrameInfoEncoder .encodeBci (state .bci , state .duringCall (), state .rethrowException ());
165164
166- Map <Long , DeoptSourceFrameInfo > sourceFrameInfoMap = deoptEntries .computeIfAbsent (toAnalysisMethod (state .getMethod ()), m -> new HashMap <>());
165+ Map <Long , DeoptSourceFrameInfo > sourceFrameInfoMap = deoptEntries .computeIfAbsent (toAnalysisMethod (state .getMethod ()), m -> new ConcurrentHashMap <>());
167166 sourceFrameInfoMap .compute (encodedBci , (k , v ) -> v == null ? DeoptSourceFrameInfo .create (state ) : v .mergeStateInfo (state ));
168167 }
169168
0 commit comments