Skip to content

[GR-64083] Add graalos vm config #11305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sdk/mx.sdk/mx_sdk_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ def __init__(self, vm: NativeImageVM, bm_suite: BenchmarkSuite | NativeImageBenc

if vm.is_quickbuild:
base_image_build_args += ['-Ob']
if vm.graalos:
base_image_build_args += ['-H:+GraalOS']
if vm.use_string_inlining:
base_image_build_args += ['-H:+UseStringInlining']
if vm.use_open_type_world:
Expand Down Expand Up @@ -716,6 +718,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
self.is_gate = False
self.is_quickbuild = False
self.layered = False
self.graalos = False
self.use_string_inlining = False
self.is_llvm = False
self.gc = None
Expand Down Expand Up @@ -780,6 +783,8 @@ def config_name(self):
config += ["quickbuild"]
if self.layered is True:
config += ["layered"]
if self.graalos is True:
config += ["graalos"]
if self.gc == "G1":
config += ["g1gc"]
if self.is_llvm is True:
Expand Down Expand Up @@ -839,7 +844,7 @@ def _configure_from_name(self, config_name):
# This defines the allowed config names for NativeImageVM. The ones registered will be available via --jvm-config
# Note: the order of entries here must match the order of statements in NativeImageVM.config_name()
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-)?' \
r'(?P<future_defaults_all>future-defaults-all-)?(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<layered>layered-)?(?P<gc>g1gc-)?' \
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-)?' \
r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
r'(?P<analysis_context_sensitivity>insens-|allocsens-|1obj-|2obj1h-|3obj2h-|4obj3h-)?(?P<jdk_profiles>jdk-profiles-collect-|adopted-jdk-pgo-)?' \
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-)?$'
Expand Down Expand Up @@ -894,6 +899,10 @@ def _configure_from_name(self, config_name):
mx.logv(f"'layered' is enabled for {config_name}")
self.layered = True

if matching.group("graalos") is not None:
mx.logv(f"'graalos' is enabled for {config_name}")
self.graalos = True

if matching.group("gc") is not None:
gc = matching.group("gc")[:-1]
if gc == "g1gc":
Expand Down
4 changes: 2 additions & 2 deletions vm/mx.vm/mx_vm_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def register_graalvm_vms():
for short_name, config_suffix in [('niee', 'ee'), ('ni', 'ce')]:
if any(component.short_name == short_name for component in mx_sdk_vm_impl.registered_graalvm_components(stage1=False)):
config_names = list()
for main_config in ['default', 'gate', 'llvm', 'native-architecture', 'future-defaults-all', 'preserve-all', 'preserve-classpath', 'layered'] + analysis_context_sensitivity:
for main_config in ['default', 'gate', 'llvm', 'native-architecture', 'future-defaults-all', 'preserve-all', 'preserve-classpath', 'layered', 'graalos'] + analysis_context_sensitivity:
config_names.append(f'{main_config}-{config_suffix}')

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

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


Expand Down
Loading