File tree 2 files changed +5
-22
lines changed
compiler/src/jdk.graal.compiler/src/jdk/graal/compiler 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) {
188
188
* Collects all instances of the LibGraalLoader loaded {@link OptionKey} class reached by the
189
189
* static analysis.
190
190
*/
191
- private class OptionCollector implements Consumer <OptionKey <?>> {
191
+ private final class OptionCollector implements Consumer <OptionKey <?>> {
192
192
private final Set <OptionKey <?>> options = Collections .newSetFromMap (new ConcurrentHashMap <>());
193
193
194
- /**
195
- * Libgraal compiler options info.
196
- */
197
- private final OptionsParser .LibGraalOptionsInfo compilerOptionsInfo ;
198
-
199
194
private boolean sealed ;
200
195
201
- OptionCollector () {
202
- compilerOptionsInfo = OptionsParser .setLibgraalOptions (OptionsParser .LibGraalOptionsInfo .create ());
203
- }
204
-
205
196
@ Override
206
197
public void accept (OptionKey <?> option ) {
207
198
if (sealed ) {
@@ -221,11 +212,11 @@ void afterAnalysis(AfterAnalysisAccess access) {
221
212
GraalError .guarantee (access .isReachable (descriptor .getClass ()), "%s" , descriptor .getClass ());
222
213
223
214
String name = option .getName ();
224
- compilerOptionsInfo .descriptors ().put (name , descriptor );
215
+ OptionsParser . libgraalOptions .descriptors ().put (name , descriptor );
225
216
226
217
String module = modules .get (descriptor .getDeclaringClass ().getName ());
227
218
if (module .contains ("enterprise" )) {
228
- compilerOptionsInfo .enterpriseOptions ().add (name );
219
+ OptionsParser . libgraalOptions .enterpriseOptions ().add (name );
229
220
}
230
221
}
231
222
}
Original file line number Diff line number Diff line change 38
38
import java .util .Set ;
39
39
import java .util .regex .Pattern ;
40
40
41
- import jdk .graal .compiler . debug . GraalError ;
41
+ import jdk .graal .nativeimage . LibGraalLoader ;
42
42
import org .graalvm .collections .EconomicMap ;
43
43
import org .graalvm .collections .EconomicSet ;
44
44
import org .graalvm .collections .MapCursor ;
@@ -68,7 +68,7 @@ public static LibGraalOptionsInfo create() {
68
68
* Compiler options info available in libgraal. This field is only non-null when
69
69
* {@link OptionsParser} is loaded by a {@link jdk.graal.nativeimage.LibGraalLoader}.
70
70
*/
71
- private static LibGraalOptionsInfo libgraalOptions ;
71
+ public static final LibGraalOptionsInfo libgraalOptions = OptionsParser . class . getClassLoader () instanceof LibGraalLoader ? LibGraalOptionsInfo . create () : null ;
72
72
73
73
/**
74
74
* Gets an iterable of available {@link OptionDescriptors}.
@@ -97,14 +97,6 @@ public static Iterable<OptionDescriptors> getOptionsLoader() {
97
97
}
98
98
}
99
99
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
-
108
100
/**
109
101
* Parses a map representing assignments of values to options.
110
102
*
You can’t perform that action at this time.
0 commit comments