5353import java .util .stream .Collectors ;
5454import java .util .stream .Stream ;
5555
56+ import com .oracle .svm .core .RuntimeAssertionsSupport ;
5657import org .graalvm .nativeimage .ImageSingletons ;
5758import org .graalvm .nativeimage .hosted .Feature ;
5859import org .graalvm .nativeimage .impl .ImageSingletonsSupport ;
@@ -242,35 +243,51 @@ public void printInitializeEnd(List<Feature> features, ImageClassLoader classLoa
242243 recordJsonMetric (GeneralInfo .JAVA_VERSION , vm .version );
243244 recordJsonMetric (GeneralInfo .VENDOR_VERSION , vm .vendorVersion );
244245 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 ();
246250 String optimizationLevel = SubstrateOptions .Optimize .getValue ();
247251 recordJsonMetric (GeneralInfo .GRAAL_COMPILER_OPTIMIZATION_LEVEL , optimizationLevel );
248252 String march = CPUType .getSelectedOrDefaultMArch ();
249253 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 );
251255 ImageSingletons .lookup (ProgressReporterFeature .class ).appendGraalSuffix (graalLine );
252256 graalLine .println ();
253257 String cCompilerShort = null ;
254258 if (ImageSingletons .contains (CCompilerInvoker .class )) {
255259 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 ();
257261 }
258262 recordJsonMetric (GeneralInfo .CC , cCompilerShort );
259263 String gcName = Heap .getHeap ().getGC ().getName ();
260264 recordJsonMetric (GeneralInfo .GC , gcName );
261265 long maxHeapSize = SubstrateGCOptions .MaxHeapSize .getValue ();
262266 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 ();
264270
265271 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+
266279 printExperimentalOptions (classLoader );
267280 printResourceInfo ();
268281 }
269282
283+ private boolean getSystemAssertionStatus () {
284+ return java .util .ArrayList .class .desiredAssertionStatus ();
285+ }
286+
270287 private void printFeatures (List <Feature > features ) {
271288 int numFeatures = features .size ();
272289 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 ();
274291 features .sort (Comparator .comparing (a -> a .getClass ().getName ()));
275292 for (Feature feature : features ) {
276293 printFeature (l (), feature );
@@ -279,7 +296,7 @@ private void printFeatures(List<Feature> features) {
279296 }
280297
281298 private static void printFeature (DirectPrinter printer , Feature feature ) {
282- printer .a (" - " );
299+ printer .a (" - " );
283300 String name = feature .getClass ().getName ();
284301 String url = feature .getURL ();
285302 if (url != null ) {
0 commit comments