@@ -408,6 +408,8 @@ def __init__(self, vm: NativeImageVM, bm_suite: BenchmarkSuite | NativeImageBenc
408
408
base_image_build_args += ['-H:Preserve=all' ]
409
409
if vm .preserve_classpath :
410
410
base_image_build_args += ['-H:Preserve=module=ALL-UNNAMED' ]
411
+ if vm .future_defaults_all :
412
+ base_image_build_args += ['--future-defaults=all' ]
411
413
if vm .analysis_context_sensitivity :
412
414
base_image_build_args += ['-H:AnalysisContextSensitivity=' + vm .analysis_context_sensitivity ,
413
415
'-H:-RemoveSaturatedTypeFlows' , '-H:+AliasArrayTypeFlows' ]
@@ -719,6 +721,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
719
721
self .native_architecture = False
720
722
self .preserve_all = False
721
723
self .preserve_classpath = False
724
+ self .future_defaults_all = False
722
725
self .use_upx = False
723
726
self .use_open_type_world = False
724
727
self .use_compacting_gc = False
@@ -752,19 +755,22 @@ def canonical_config_name(config_name):
752
755
def config_name (self ):
753
756
# Generates the unique vm config name based on how the VM is actually configured.
754
757
# It concatenates the config options in the correct order to match the expected format.
758
+ # Note: the order of entries here must match the order of entries in _configure_from_name
755
759
config = []
756
760
if self .native_architecture is True :
757
761
config += ["native-architecture" ]
758
- if self .preserve_all is True :
759
- config += ["preserve-all" ]
760
- if self .preserve_classpath is True :
761
- config += ["preserve-classpath" ]
762
762
if self .use_string_inlining is True :
763
763
config += ["string-inlining" ]
764
764
if self .use_open_type_world is True :
765
765
config += ["otw" ]
766
766
if self .use_compacting_gc is True :
767
767
config += ["compacting-gc" ]
768
+ if self .preserve_all is True :
769
+ config += ["preserve-all" ]
770
+ if self .preserve_classpath is True :
771
+ config += ["preserve-classpath" ]
772
+ if self .future_defaults_all is True :
773
+ config += ["future-defaults-all" ]
768
774
if self .is_gate is True :
769
775
config += ["gate" ]
770
776
if self .use_upx is True :
@@ -828,8 +834,9 @@ def _configure_from_name(self, config_name):
828
834
mx .abort (f"config_name must be set. Use 'default' for the default { self .__class__ .__name__ } configuration." )
829
835
830
836
# This defines the allowed config names for NativeImageVM. The ones registered will be available via --jvm-config
837
+ # Note: the order of entries here must match the order of statements in NativeImageVM.config_name()
831
838
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-)?' \
832
- r'(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<gc>g1gc-)?' \
839
+ r'(?P<future_defaults_all>future-defaults-all-)?(?P< gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<gc>g1gc-)?' \
833
840
r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
834
841
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-)?' \
835
842
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-)?$'
@@ -852,6 +859,10 @@ def _configure_from_name(self, config_name):
852
859
mx .logv (f"'preserve-classpath' is enabled for { config_name } " )
853
860
self .preserve_classpath = True
854
861
862
+ if matching .group ("future_defaults_all" ) is not None :
863
+ mx .logv (f"'future-defaults-all' is enabled for { config_name } " )
864
+ self .future_defaults_all = True
865
+
855
866
if matching .group ("string_inlining" ) is not None :
856
867
mx .logv (f"'string-inlining' is enabled for { config_name } " )
857
868
self .use_string_inlining = True
0 commit comments