Skip to content

Commit 795663f

Browse files
Andrija KolichamzaGhaissi
authored andcommitted
[GR-64083] Add graalos vm config
PullRequest: graal/20927
2 parents 0c778f9 + 53778ff commit 795663f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

sdk/mx.sdk/mx_sdk_benchmark.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ def __init__(self, vm: NativeImageVM, bm_suite: BenchmarkSuite | NativeImageBenc
381381

382382
if vm.is_quickbuild:
383383
base_image_build_args += ['-Ob']
384+
if vm.graalos:
385+
base_image_build_args += ['-H:+GraalOS']
384386
if vm.use_string_inlining:
385387
base_image_build_args += ['-H:+UseStringInlining']
386388
if vm.use_open_type_world:
@@ -716,6 +718,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
716718
self.is_gate = False
717719
self.is_quickbuild = False
718720
self.layered = False
721+
self.graalos = False
719722
self.use_string_inlining = False
720723
self.is_llvm = False
721724
self.gc = None
@@ -780,6 +783,8 @@ def config_name(self):
780783
config += ["quickbuild"]
781784
if self.layered is True:
782785
config += ["layered"]
786+
if self.graalos is True:
787+
config += ["graalos"]
783788
if self.gc == "G1":
784789
config += ["g1gc"]
785790
if self.is_llvm is True:
@@ -839,7 +844,7 @@ def _configure_from_name(self, config_name):
839844
# This defines the allowed config names for NativeImageVM. The ones registered will be available via --jvm-config
840845
# Note: the order of entries here must match the order of statements in NativeImageVM.config_name()
841846
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-)?' \
842-
r'(?P<future_defaults_all>future-defaults-all-)?(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<layered>layered-)?(?P<gc>g1gc-)?' \
847+
r'(?P<future_defaults_all>future-defaults-all-)?(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<layered>layered-)?(?P<graalos>graalos-)?(?P<gc>g1gc-)?' \
843848
r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
844849
r'(?P<analysis_context_sensitivity>insens-|allocsens-|1obj-|2obj1h-|3obj2h-|4obj3h-)?(?P<jdk_profiles>jdk-profiles-collect-|adopted-jdk-pgo-)?' \
845850
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-)?$'
@@ -894,6 +899,10 @@ def _configure_from_name(self, config_name):
894899
mx.logv(f"'layered' is enabled for {config_name}")
895900
self.layered = True
896901

902+
if matching.group("graalos") is not None:
903+
mx.logv(f"'graalos' is enabled for {config_name}")
904+
self.graalos = True
905+
897906
if matching.group("gc") is not None:
898907
gc = matching.group("gc")[:-1]
899908
if gc == "g1gc":

vm/mx.vm/mx_vm_benchmark.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def register_graalvm_vms():
533533
for short_name, config_suffix in [('niee', 'ee'), ('ni', 'ce')]:
534534
if any(component.short_name == short_name for component in mx_sdk_vm_impl.registered_graalvm_components(stage1=False)):
535535
config_names = list()
536-
for main_config in ['default', 'gate', 'llvm', 'native-architecture', 'future-defaults-all', 'preserve-all', 'preserve-classpath', 'layered'] + analysis_context_sensitivity:
536+
for main_config in ['default', 'gate', 'llvm', 'native-architecture', 'future-defaults-all', 'preserve-all', 'preserve-classpath', 'layered', 'graalos'] + analysis_context_sensitivity:
537537
config_names.append(f'{main_config}-{config_suffix}')
538538

539539
for optimization_level in optimization_levels:
@@ -545,7 +545,7 @@ def register_graalvm_vms():
545545
mx_benchmark.add_java_vm(NativeImageVM('native-image', config_name, ['--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED']), _suite, 10)
546546

547547
# Adding JAVA_HOME VMs to be able to run benchmarks on GraalVM binaries without the need of building it first
548-
for java_home_config in ['default', 'pgo', 'g1gc', 'g1gc-pgo', 'upx', 'upx-g1gc', 'quickbuild', 'quickbuild-g1gc', 'layered']:
548+
for java_home_config in ['default', 'pgo', 'g1gc', 'g1gc-pgo', 'upx', 'upx-g1gc', 'quickbuild', 'quickbuild-g1gc', 'layered', 'graalos']:
549549
mx_benchmark.add_java_vm(NativeImageVM('native-image-java-home', java_home_config), _suite, 5)
550550

551551

0 commit comments

Comments
 (0)