def __init__(self, args, project): # We choose 8 as a rough approximation of the best parallelism level required. 8 is convenient because: # (1) laptops don't have more than 8 cores so developers will only have 1 process running # (2) small-to-mid-sized images exhibit roughly that parallelism level (JIT not taken into account) # (3) on 32 core machines it shows best results in terms of image build time in GraalVM super(SVMImageBuildTask, self).__init__(args, min(8, mx.cpu_count()), project) self._newestOutput = None
def __init__(self, args, project): super(NativeImageBootstrapTask, self).__init__(args, min(8, mx.cpu_count()), project) self._newestOutput = None
from distutils.dir_util import mkpath, copy_tree, remove_tree # pylint: disable=no-name-in-module from os.path import join, exists, basename, dirname, islink import functools import mx import mx_compiler import mx_gate import mx_unittest import mx_urlrewrites from mx_compiler import GraalArchiveParticipant from mx_compiler import run_java from mx_gate import Task from mx_substratevm_benchmark import run_js, host_vm_tuple, output_processors, rule_snippets # pylint: disable=unused-import from mx_unittest import _run_tests, _VMLauncher JVM_COMPILER_THREADS = 2 if mx.cpu_count() <= 4 else 4 GRAAL_COMPILER_FLAGS = [ '-XX:-UseJVMCIClassLoader', '-XX:+UseJVMCICompiler', '-Dgraal.CompileGraalWithC1Only=false', '-XX:CICompilerCount=' + str(JVM_COMPILER_THREADS), '-Dtruffle.TrustAllTruffleRuntimeProviders=true', # GR-7046 '-Dgraal.VerifyGraalGraphs=false', '-Dgraal.VerifyGraalGraphEdges=false', '-Dgraal.VerifyGraalPhasesSize=false', '-Dgraal.VerifyPhases=false' ] IMAGE_ASSERTION_FLAGS = [ '-H:+VerifyGraalGraphs', '-H:+VerifyGraalGraphEdges', '-H:+VerifyPhases' ]
def machineCpuCores(self): return mx.cpu_count()
from xml.dom.minidom import parse from argparse import ArgumentParser import mx import mx_compiler import mx_gate import mx_unittest import mx_urlrewrites import mx_sdk from mx_compiler import GraalArchiveParticipant from mx_compiler import run_java from mx_gate import Task from mx_substratevm_benchmark import run_js, host_vm_tuple, output_processors, rule_snippets # pylint: disable=unused-import from mx_unittest import _run_tests, _VMLauncher JVM_COMPILER_THREADS = 2 if mx.cpu_count() <= 4 else 4 GRAAL_COMPILER_FLAGS = ['-XX:+UseJVMCICompiler', '-Dgraal.CompileGraalWithC1Only=false', '-XX:CICompilerCount=' + str(JVM_COMPILER_THREADS), '-Dtruffle.TrustAllTruffleRuntimeProviders=true', # GR-7046 '-Dgraal.VerifyGraalGraphs=false', '-Dgraal.VerifyGraalGraphEdges=false', '-Dgraal.VerifyGraalPhasesSize=false', '-Dgraal.VerifyPhases=false'] if mx.get_jdk(tag='default').javaCompliance <= mx.JavaCompliance('1.8'): GRAAL_COMPILER_FLAGS += ['-XX:-UseJVMCIClassLoader'] else: # JVMCI access GRAAL_COMPILER_FLAGS += ['--add-exports', 'jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED'] GRAAL_COMPILER_FLAGS += ['--add-exports', 'jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED'] GRAAL_COMPILER_FLAGS += ['--add-exports', 'jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED'] # Reflective access GRAAL_COMPILER_FLAGS += ['--add-exports', 'jdk.unsupported/sun.reflect=ALL-UNNAMED'] # Reflective access to private fields of java.lang.Class. GRAAL_COMPILER_FLAGS += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED']