File tree Expand file tree Collapse file tree 2 files changed +5
-22
lines changed
compiler/src/jdk.graal.compiler/src/jdk/graal/compiler Expand file tree Collapse file tree 2 files changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -188,20 +188,11 @@ public void duringSetup(DuringSetupAccess access) {
188188 * Collects all instances of the LibGraalLoader loaded {@link OptionKey} class reached by the
189189 * static analysis.
190190 */
191- private class OptionCollector implements Consumer <OptionKey <?>> {
191+ private final class OptionCollector implements Consumer <OptionKey <?>> {
192192 private final Set <OptionKey <?>> options = Collections .newSetFromMap (new ConcurrentHashMap <>());
193193
194- /**
195- * Libgraal compiler options info.
196- */
197- private final OptionsParser .LibGraalOptionsInfo compilerOptionsInfo ;
198-
199194 private boolean sealed ;
200195
201- OptionCollector () {
202- compilerOptionsInfo = OptionsParser .setLibgraalOptions (OptionsParser .LibGraalOptionsInfo .create ());
203- }
204-
205196 @ Override
206197 public void accept (OptionKey <?> option ) {
207198 if (sealed ) {
@@ -221,11 +212,11 @@ void afterAnalysis(AfterAnalysisAccess access) {
221212 GraalError .guarantee (access .isReachable (descriptor .getClass ()), "%s" , descriptor .getClass ());
222213
223214 String name = option .getName ();
224- compilerOptionsInfo .descriptors ().put (name , descriptor );
215+ OptionsParser . libgraalOptions .descriptors ().put (name , descriptor );
225216
226217 String module = modules .get (descriptor .getDeclaringClass ().getName ());
227218 if (module .contains ("enterprise" )) {
228- compilerOptionsInfo .enterpriseOptions ().add (name );
219+ OptionsParser . libgraalOptions .enterpriseOptions ().add (name );
229220 }
230221 }
231222 }
Original file line number Diff line number Diff line change 3838import java .util .Set ;
3939import java .util .regex .Pattern ;
4040
41- import jdk .graal .compiler . debug . GraalError ;
41+ import jdk .graal .nativeimage . LibGraalLoader ;
4242import org .graalvm .collections .EconomicMap ;
4343import org .graalvm .collections .EconomicSet ;
4444import org .graalvm .collections .MapCursor ;
@@ -68,7 +68,7 @@ public static LibGraalOptionsInfo create() {
6868 * Compiler options info available in libgraal. This field is only non-null when
6969 * {@link OptionsParser} is loaded by a {@link jdk.graal.nativeimage.LibGraalLoader}.
7070 */
71- private static LibGraalOptionsInfo libgraalOptions ;
71+ public static final LibGraalOptionsInfo libgraalOptions = OptionsParser . class . getClassLoader () instanceof LibGraalLoader ? LibGraalOptionsInfo . create () : null ;
7272
7373 /**
7474 * Gets an iterable of available {@link OptionDescriptors}.
@@ -97,14 +97,6 @@ public static Iterable<OptionDescriptors> getOptionsLoader() {
9797 }
9898 }
9999
100- @ ExcludeFromJacocoGeneratedReport ("only called when building libgraal" )
101- public static LibGraalOptionsInfo setLibgraalOptions (LibGraalOptionsInfo info ) {
102- GraalError .guarantee (inImageBuildtimeCode (), "Can only set libgraal compiler options when building libgraal" );
103- GraalError .guarantee (libgraalOptions == null , "Libgraal compiler options must be set exactly once" );
104- OptionsParser .libgraalOptions = info ;
105- return info ;
106- }
107-
108100 /**
109101 * Parses a map representing assignments of values to options.
110102 *
You can’t perform that action at this time.
0 commit comments