Skip to content

Commit fe8f031

Browse files
committed
[GR-52539] Fix native-image detection if no --jvm argument was given
PullRequest: graal/17201
2 parents 9aca57a + d6e7973 commit fe8f031

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sdk/mx.sdk/mx_sdk_benchmark.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,13 @@ def run_stage(self, vm, stage, command, out, err, cwd, nonZeroIsFatal):
475475

476476
def is_native_mode(self, bm_suite_args: List[str]):
477477
"""Checks whether the given arguments request a Native Image benchmark"""
478-
return "native-image" in self.jvm(bm_suite_args)
478+
jvm_flag = self.jvm(bm_suite_args)
479+
if not jvm_flag:
480+
# In case the --jvm argument was not given explicitly, let the registry load the appropriate vm and extract
481+
# the name from there.
482+
# This is much more expensive, so it is only used as a fallback
483+
jvm_flag = self.get_vm_registry().get_vm_from_suite_args(bm_suite_args).name()
484+
return "native-image" in jvm_flag
479485

480486
def apply_command_mapper_hooks(self, cmd, vm):
481487
return mx.apply_command_mapper_hooks(cmd, vm.command_mapper_hooks)

0 commit comments

Comments
 (0)