def register_graalvm_vms(): graalvm_hostvm_name = mx_vm.graalvm_dist_name().lower().replace('_', '-') for config_name, java_args, launcher_args, priority in mx_sdk.graalvm_hostvm_configs: mx_benchmark.java_vm_registry.add_vm( GraalVm(graalvm_hostvm_name, config_name, java_args, launcher_args), _suite, priority) if mx_vm.has_component('svm', fatalIfMissing=False): _native_image_vm_registry.add_vm( NativeImageVm(graalvm_hostvm_name, 'default', [], []), _suite, 10) _gu_vm_registry.add_vm(GuVm(graalvm_hostvm_name, 'default', [], []), _suite, 10) # Add VMs for libgraal if mx_vm.has_component('LibGraal', fatalIfMissing=False): libgraal_location = mx_vm.get_native_image_locations( 'LibGraal', 'jvmcicompiler') if libgraal_location is not None: import mx_graal_benchmark mx_graal_benchmark.build_jvmci_vm_variants( 'server', 'graal-core-libgraal', [ '-server', '-XX:+EnableJVMCI', '-Dgraal.CompilerConfiguration=community', '-Djvmci.Compiler=graal', '-XX:+UseJVMCINativeLibrary', '-XX:JVMCILibPath=' + dirname(libgraal_location) ], mx_graal_benchmark._graal_variants, suite=_suite, priority=15, hosted=False)
def register_graalvm_vms(): default_host_vm_name = mx_vm.graalvm_dist_name().lower().replace('_', '-') host_vm_names = [default_host_vm_name ] + ([default_host_vm_name.replace('-java8', '')] if '-java8' in default_host_vm_name else []) for host_vm_name in host_vm_names: for config_name, java_args, launcher_args, priority in mx_sdk.graalvm_hostvm_configs: mx_benchmark.java_vm_registry.add_vm( GraalVm(host_vm_name, config_name, java_args, launcher_args), _suite, priority) if mx_vm.has_component('svm'): _native_image_vm_registry.add_vm( NativeImageBuildVm(host_vm_name, 'default', [], []), _suite, 10) _gu_vm_registry.add_vm(GuVm(host_vm_name, 'default', [], []), _suite, 10) # We support only EE and CE configuration for native-image benchmarks for short_name, config_suffix in [('niee', 'ee'), ('ni', 'ce')]: if any(component.short_name == short_name for component in mx_vm.registered_graalvm_components( stage1=False)): mx_benchmark.add_java_vm( NativeImageVM('native-image', 'default-' + config_suffix, None, None, 0, False, False), _suite, 10) mx_benchmark.add_java_vm( NativeImageVM('native-image', 'pgo-' + config_suffix, None, None, 1, False, False), _suite, 10) mx_benchmark.add_java_vm( NativeImageVM('native-image', 'pgo-hotspot-' + config_suffix, None, None, 0, True, False), _suite, 10) mx_benchmark.add_java_vm( NativeImageVM('native-image', 'gate-' + config_suffix, None, None, 0, True, True), _suite, 10) mx_benchmark.add_java_vm( NativeImageVM('native-image', 'llvm-' + config_suffix, None, None, 0, False, False, True), _suite, 10) mx_benchmark.add_java_vm( NativeImageVM('native-image', 'llvm-pgo-' + config_suffix, None, None, 1, False, False, True), _suite, 10) break # Add VMs for libgraal if mx_vm.has_component('LibGraal'): libgraal_location = mx_vm.get_native_image_locations( 'LibGraal', 'jvmcicompiler') if libgraal_location is not None: import mx_graal_benchmark mx_graal_benchmark.build_jvmci_vm_variants( 'server', 'graal-core-libgraal', [ '-server', '-XX:+EnableJVMCI', '-Dgraal.CompilerConfiguration=community', '-Djvmci.Compiler=graal', '-XX:+UseJVMCINativeLibrary', '-XX:JVMCILibPath=' + dirname(libgraal_location) ], mx_graal_benchmark._graal_variants, suite=_suite, priority=15, hosted=False)
def register_graalvm_vms(): graalvm_hostvm_name = mx_vm.graalvm_dist_name().lower().replace('_', '-') for config_name, java_args, launcher_args, priority in mx_sdk.graalvm_hostvm_configs: mx_benchmark.java_vm_registry.add_vm( GraalVm(graalvm_hostvm_name, config_name, java_args, launcher_args), _suite, priority) if mx_vm.has_component('svm', fatalIfMissing=False): _native_image_vm_registry.add_vm( NativeImageVm(graalvm_hostvm_name, 'default', [], []), _suite, 10) _gu_vm_registry.add_vm(GuVm(graalvm_hostvm_name, 'default', [], []), _suite, 10)
def graalvm_svm(): """ Gives access to image building withing the GraalVM release. Requires dynamic import of substratevm. """ native_image_cmd = join(mx_vm.graalvm_output(), 'bin', 'native-image') svm = mx.suite('substratevm') if not exists(native_image_cmd) or not svm: mx.abort( "Image building not accessible in GraalVM {}. Build GraalVM with native-image support" .format(mx_vm.graalvm_dist_name())) @contextmanager def native_image_context(common_args=None, hosted_assertions=True): with svm.extensions.native_image_context( common_args, hosted_assertions, native_image_cmd=native_image_cmd) as native_image: yield native_image return native_image_context, svm.extensions
def graalvm_svm(): """ Gives access to image building withing the GraalVM release. Requires dynamic import of substratevm. """ native_image_cmd = join(mx_vm.graalvm_output(), 'bin', 'native-image') svm = mx.suite('substratevm') if not exists(native_image_cmd) or not svm: mx.abort("Image building not accessible in GraalVM {}. Build GraalVM with native-image support".format(mx_vm.graalvm_dist_name())) @contextmanager def native_image_context(common_args=None, hosted_assertions=True): with svm.extensions.native_image_context(common_args, hosted_assertions, native_image_cmd=native_image_cmd) as native_image: yield native_image return native_image_context, svm.extensions
def register_graalvm_vms(): graalvm_hostvm_name = mx_vm.graalvm_dist_name().lower().replace('_', '-') for name, java_args, lang_args, priority in mx_sdk.graalvm_hostvm_configs: mx_benchmark.java_vm_registry.add_vm( GraalVm(graalvm_hostvm_name, name, java_args, lang_args), _suite, priority)