53
53
import java .util .stream .Collectors ;
54
54
import java .util .stream .Stream ;
55
55
56
+ import com .oracle .svm .core .RuntimeAssertionsSupport ;
56
57
import org .graalvm .nativeimage .ImageSingletons ;
57
58
import org .graalvm .nativeimage .hosted .Feature ;
58
59
import org .graalvm .nativeimage .impl .ImageSingletonsSupport ;
@@ -242,35 +243,51 @@ public void printInitializeEnd(List<Feature> features, ImageClassLoader classLoa
242
243
recordJsonMetric (GeneralInfo .JAVA_VERSION , vm .version );
243
244
recordJsonMetric (GeneralInfo .VENDOR_VERSION , vm .vendorVersion );
244
245
recordJsonMetric (GeneralInfo .GRAALVM_VERSION , vm .vendorVersion ); // deprecated
245
- l ().a (" " ).doclink ("Java version" , "#glossary-java-info" ).a (": " ).a (vm .version ).a (", " ).doclink ("vendor version" , "#glossary-java-info" ).a (": " ).a (vm .vendorVersion ).println ();
246
+
247
+ // Builder Configuration section
248
+ l ().a (" " ).a ("Builder configuration:" ).println ();
249
+ l ().a (" - " ).doclink ("Java version" , "#glossary-java-info" ).a (": " ).a (vm .version ).a (", " ).doclink ("vendor version" , "#glossary-java-info" ).a (": " ).a (vm .vendorVersion ).println ();
246
250
String optimizationLevel = SubstrateOptions .Optimize .getValue ();
247
251
recordJsonMetric (GeneralInfo .GRAAL_COMPILER_OPTIMIZATION_LEVEL , optimizationLevel );
248
252
String march = CPUType .getSelectedOrDefaultMArch ();
249
253
recordJsonMetric (GeneralInfo .GRAAL_COMPILER_MARCH , march );
250
- DirectPrinter graalLine = l ().a (" " ).doclink ("Graal compiler" , "#glossary-graal-compiler" ).a (": optimization level: %s, target machine: %s" , optimizationLevel , march );
254
+ DirectPrinter graalLine = l ().a (" - " ).doclink ("Graal compiler" , "#glossary-graal-compiler" ).a (": optimization level: %s, target machine: %s" , optimizationLevel , march );
251
255
ImageSingletons .lookup (ProgressReporterFeature .class ).appendGraalSuffix (graalLine );
252
256
graalLine .println ();
253
257
String cCompilerShort = null ;
254
258
if (ImageSingletons .contains (CCompilerInvoker .class )) {
255
259
cCompilerShort = ImageSingletons .lookup (CCompilerInvoker .class ).compilerInfo .getShortDescription ();
256
- l ().a (" " ).doclink ("C compiler" , "#glossary-ccompiler" ).a (": " ).a (cCompilerShort ).println ();
260
+ l ().a (" - " ).doclink ("C compiler" , "#glossary-ccompiler" ).a (": " ).a (cCompilerShort ).println ();
257
261
}
258
262
recordJsonMetric (GeneralInfo .CC , cCompilerShort );
259
263
String gcName = Heap .getHeap ().getGC ().getName ();
260
264
recordJsonMetric (GeneralInfo .GC , gcName );
261
265
long maxHeapSize = SubstrateGCOptions .MaxHeapSize .getValue ();
262
266
String maxHeapValue = maxHeapSize == 0 ? Heap .getHeap ().getGC ().getDefaultMaxHeapSize () : ByteFormattingUtil .bytesToHuman (maxHeapSize );
263
- l ().a (" " ).doclink ("Garbage collector" , "#glossary-gc" ).a (": " ).a (gcName ).a (" (" ).doclink ("max heap size" , "#glossary-gc-max-heap-size" ).a (": " ).a (maxHeapValue ).a (")" ).println ();
267
+
268
+ l ().a (" - " ).a ("Assertions: " ).a (SubstrateUtil .assertionsEnabled () ? "enabled" : "disabled" ).a (", system assertions: " ).a (getSystemAssertionStatus () ? "enabled" : "disabled" )
269
+ .println ();
264
270
265
271
printFeatures (features );
272
+
273
+ // Image Configuration section
274
+ l ().a (" " ).a ("Image configuration:" ).println ();
275
+ l ().a (" - " ).doclink ("Garbage collector" , "#glossary-gc" ).a (": " ).a (gcName ).a (" (" ).doclink ("max heap size" , "#glossary-gc-max-heap-size" ).a (": " ).a (maxHeapValue ).a (")" ).println ();
276
+ l ().a (" - " ).a ("Assertions: " ).a (RuntimeAssertionsSupport .singleton ().getDefaultAssertionStatus () ? "enabled" : "disabled" ).a (" (class-specific config may apply), system assertions: " )
277
+ .a (RuntimeAssertionsSupport .singleton ().getDefaultSystemAssertionStatus () ? "enabled" : "disabled" ).println ();
278
+
266
279
printExperimentalOptions (classLoader );
267
280
printResourceInfo ();
268
281
}
269
282
283
+ private boolean getSystemAssertionStatus () {
284
+ return java .util .ArrayList .class .desiredAssertionStatus ();
285
+ }
286
+
270
287
private void printFeatures (List <Feature > features ) {
271
288
int numFeatures = features .size ();
272
289
if (numFeatures > 0 ) {
273
- l ().a (" " ).a (numFeatures ).a (" " ).doclink ("user-specific feature(s)" , "#glossary-user-specific-features" ).a (":" ).println ();
290
+ l ().a (" - " ).a (numFeatures ).a (" " ).doclink ("user-specific feature(s)" , "#glossary-user-specific-features" ).a (":" ).println ();
274
291
features .sort (Comparator .comparing (a -> a .getClass ().getName ()));
275
292
for (Feature feature : features ) {
276
293
printFeature (l (), feature );
@@ -279,7 +296,7 @@ private void printFeatures(List<Feature> features) {
279
296
}
280
297
281
298
private static void printFeature (DirectPrinter printer , Feature feature ) {
282
- printer .a (" - " );
299
+ printer .a (" - " );
283
300
String name = feature .getClass ().getName ();
284
301
String url = feature .getURL ();
285
302
if (url != null ) {
0 commit comments