Beispiel #1
0
def run_jaotc(args, classpath=None, cwd=None):
    """run AOT compiler with classes in this repo instead of those in the JDK"""
    _check_jaotc_support()
    vm_args = [a for a in args if a.startswith('-J')]
    args = [a for a in args if not a.startswith('-J')]

    verbose = ['--verbose'] if mx._opts.very_verbose else []
    cp = ['-J--class-path=' + classpath] if classpath else []

    graaljdk_dir, _ = mx_compiler._update_graaljdk(mx_compiler.jdk)
    graaljdk = mx.JDKConfig(graaljdk_dir)
    jaotc_exe = graaljdk.exe_path('jaotc', 'bin')
    mx.run([jaotc_exe] + vm_args + cp + verbose + args, cwd=cwd)
Beispiel #2
0
def run_jaotc(args, classpath=None, cwd=None):
    """run AOT compiler with classes in this repo instead of those in the JDK"""
    if jdk.javaCompliance < '11':
        mx.abort(
            'jaotc command is only available if JAVA_HOME is JDK 11 or later')

    vm_args = [a for a in args if a.startswith('-J')]
    args = [a for a in args if not a.startswith('-J')]

    verbose = ['--verbose'] if mx._opts.very_verbose else []
    cp = ['-J--class-path=' + classpath] if classpath else []

    graaljdk_dir, _ = mx_compiler._update_graaljdk(mx_compiler.jdk)
    graaljdk = mx.JDKConfig(graaljdk_dir)
    jaotc_exe = graaljdk.exe_path('jaotc', 'bin')
    mx.run([jaotc_exe] + vm_args + cp + verbose + args, cwd=cwd)
Beispiel #3
0
def _getJdkHome():
    global _jdkHome
    if not _jdkHome:
        if mx.suite('compiler', fatalIfMissing=False):
            import mx_compiler
            if hasattr(mx_compiler, 'get_graaljdk'):
                _jdkHome = mx_compiler.get_graaljdk().home
            elif hasattr(mx_compiler, '_update_graaljdk'):
                jdk = mx.get_jdk(tag='default')
                _jdkHome, _ = mx_compiler._update_graaljdk(jdk)
            else:
                mx.abort(
                    'Cannot find a GraalJDK.\nAre you running with an old version of Graal?'
                )
        else:
            _jdkHome = mx.get_env('JAVA_HOME')
    return _jdkHome