@@ -242,6 +242,8 @@ def __init__(self, vm: NativeImageVM, bm_suite: BenchmarkSuite | NativeImageBenc
242
242
base_image_build_args += ['-H:Preserve=all' ]
243
243
if vm .preserve_classpath :
244
244
base_image_build_args += ['-H:Preserve=module=ALL-UNNAMED' ]
245
+ if vm .future_defaults :
246
+ base_image_build_args += ['--future-defaults=all' ]
245
247
if vm .analysis_context_sensitivity :
246
248
base_image_build_args += ['-H:AnalysisContextSensitivity=' + vm .analysis_context_sensitivity , '-H:-RemoveSaturatedTypeFlows' , '-H:+AliasArrayTypeFlows' ]
247
249
if vm .optimization_level :
@@ -534,6 +536,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
534
536
self .native_architecture = False
535
537
self .preserve_all = False
536
538
self .preserve_classpath = False
539
+ self .future_defaults = False
537
540
self .use_upx = False
538
541
self .use_open_type_world = False
539
542
self .use_compacting_gc = False
@@ -567,19 +570,22 @@ def canonical_config_name(config_name):
567
570
def config_name (self ):
568
571
# Generates the unique vm config name based on how the VM is actually configured.
569
572
# It concatenates the config options in the correct order to match the expected format.
573
+ # Note: the order of entries here must match the order of entries in _configure_from_name
570
574
config = []
571
575
if self .native_architecture is True :
572
576
config += ["native-architecture" ]
573
- if self .preserve_all is True :
574
- config += ["preserve-all" ]
575
- if self .preserve_classpath is True :
576
- config += ["preserve-classpath" ]
577
577
if self .use_string_inlining is True :
578
578
config += ["string-inlining" ]
579
579
if self .use_open_type_world is True :
580
580
config += ["otw" ]
581
581
if self .use_compacting_gc is True :
582
582
config += ["compacting-gc" ]
583
+ if self .preserve_all is True :
584
+ config += ["preserve-all" ]
585
+ if self .preserve_classpath is True :
586
+ config += ["preserve-classpath" ]
587
+ if self .future_defaults is True :
588
+ config += ["future-defaults" ]
583
589
if self .is_gate is True :
584
590
config += ["gate" ]
585
591
if self .use_upx is True :
@@ -643,8 +649,9 @@ def _configure_from_name(self, config_name):
643
649
mx .abort (f"config_name must be set. Use 'default' for the default { self .__class__ .__name__ } configuration." )
644
650
645
651
# This defines the allowed config names for NativeImageVM. The ones registered will be available via --jvm-config
652
+ # Note: the order of entries here must match the order of statements in config_name
646
653
rule = r'^(?P<native_architecture>native-architecture-)?(?P<string_inlining>string-inlining-)?(?P<otw>otw-)?(?P<compacting_gc>compacting-gc-)?(?P<preserve_all>preserve-all-)?(?P<preserve_classpath>preserve-classpath-)?' \
647
- r'(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<gc>g1gc-)?' \
654
+ r'(?P<future_defaults>future-defaults-)?(?P< gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<gc>g1gc-)?' \
648
655
r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
649
656
r'(?P<analysis_context_sensitivity>insens-|allocsens-|1obj-|2obj1h-|3obj2h-|4obj3h-)?(?P<no_inlining_before_analysis>no-inline-)?(?P<jdk_profiles>jdk-profiles-collect-|adopted-jdk-pgo-)?' \
650
657
r'(?P<profile_inference>profile-inference-feature-extraction-|profile-inference-pgo-|profile-inference-debug-)?(?P<sampler>safepoint-sampler-|async-sampler-)?(?P<optimization_level>O0-|O1-|O2-|O3-|Os-)?(default-)?(?P<edition>ce-|ee-)?$'
@@ -667,6 +674,10 @@ def _configure_from_name(self, config_name):
667
674
mx .logv (f"'preserve-classpath' is enabled for { config_name } " )
668
675
self .preserve_classpath = True
669
676
677
+ if matching .group ("future_defaults" ) is not None :
678
+ mx .logv (f"'future-defaults' is enabled for { config_name } " )
679
+ self .future_defaults = True
680
+
670
681
if matching .group ("string_inlining" ) is not None :
671
682
mx .logv (f"'string-inlining' is enabled for { config_name } " )
672
683
self .use_string_inlining = True
0 commit comments