Ejemplo n.º 1
0
def mx_post_parse_cmd_line(opts):
    mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCIJDKFactory())
    mx.set_java_command_default_jdk_tag(_JVMCI_JDK_TAG)

    jdkTag = mx.get_jdk_option().tag

    jvmVariant = None
    debugLevel = None
    jvmciMode = None

    if opts.jdk_jvm_variant is not None:
        jvmVariant = opts.jdk_jvm_variant
        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
            mx.warn(
                'Ignoring "--jdk-jvm-variant" option as "--jdk" tag is not "' +
                _JVMCI_JDK_TAG + '"')

    if opts.jdk_debug_level is not None:
        debugLevel = _translateLegacyDebugLevel(opts.jdk_debug_level)
        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
            mx.warn(
                'Ignoring "--jdk-debug-level" option as "--jdk" tag is not "' +
                _JVMCI_JDK_TAG + '"')

    if opts.jvmci_mode is not None:
        jvmciMode = opts.jvmci_mode
        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
            mx.warn('Ignoring "--jvmci-mode" option as "--jdk" tag is not "' +
                    _JVMCI_JDK_TAG + '"')

    _vm.update(jvmVariant, debugLevel, jvmciMode)

    for jdkDist in jdkDeployedDists:
        jdkDist.post_parse_cmd_line()
Ejemplo n.º 2
0
def mx_post_parse_cmd_line(opts):
    mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCIJDKFactory())
    mx.set_java_command_default_jdk_tag(_JVMCI_JDK_TAG)

    jdkTag = mx.get_jdk_option().tag

    jvmVariant = None
    debugLevel = None
    jvmciMode = None

    if opts.jdk_jvm_variant is not None:
        jvmVariant = opts.jdk_jvm_variant
        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
            mx.warn('Ignoring "--jdk-jvm-variant" option as "--jdk" tag is not "' + _JVMCI_JDK_TAG + '"')

    if opts.jdk_debug_level is not None:
        debugLevel = _translateLegacyDebugLevel(opts.jdk_debug_level)
        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
            mx.warn('Ignoring "--jdk-debug-level" option as "--jdk" tag is not "' + _JVMCI_JDK_TAG + '"')

    if opts.jvmci_mode is not None:
        jvmciMode = opts.jvmci_mode
        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
            mx.warn('Ignoring "--jvmci-mode" option as "--jdk" tag is not "' + _JVMCI_JDK_TAG + '"')

    _vm.update(jvmVariant, debugLevel, jvmciMode)

    for jdkDist in jdkDeployedDists:
        dist = jdkDist.dist()
        if isinstance(jdkDist, JvmciJDKDeployedDist):
            dist.set_archiveparticipant(JVMCIArchiveParticipant(dist))
Ejemplo n.º 3
0
        self._original = original
        mx.JDKConfig.__init__(self, original.home, tag=_JVMCI_JDK_TAG)

    def run_java(self, args, **kwArgs):
        run_java(self._original, args, **kwArgs)

class GraalJDKFactory(mx.JDKFactory):
    def getJDKConfig(self):
        return GraalJVMCI9JDKConfig(_jdk)

    def description(self):
        return "JVMCI JDK with Graal"

# This will override the 'generic' JVMCI JDK with a Graal JVMCI JDK that has
# support for -G style Graal options.
mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), GraalJDKFactory())

def run_vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, debugLevel=None, vmbuild=None):
    """run a Java program by executing the java executable in a JVMCI JDK"""

    return run_java(_jdk, args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)

class GraalArchiveParticipant:
    def __init__(self, dist):
        self.dist = dist

    def __opened__(self, arc, srcArc, services):
        self.services = services
        self.arc = arc

    def __add__(self, arcname, contents):
Ejemplo n.º 4
0
            jdk = GraalJDK8Config(vmbuild)
            _graal_jdks[vmbuild] = jdk
    else:
        jdk = _graal_jdks.get('default')
        if jdk is None:
            from mx_jvmci import JVMCI9JDKConfig # pylint: disable=no-name-in-module
            class GraalJDK9Config(JVMCI9JDKConfig):
                def __init__(self, debugLevel):
                    JVMCI9JDKConfig.__init__(self, debugLevel)

                def parseVmArgs(self, args, addDefaultArgs=True):
                    return JVMCI9JDKConfig.parseVmArgs(self, _buildGOptionsArgs(args), addDefaultArgs=addDefaultArgs)
            jdk = GraalJDK9Config(jvmci_jdk.debugLevel)
            _graal_jdks['default'] = jdk
    return jdk

class GraalJDKFactory(mx.JDKFactory):
    def getJDKConfig(self):
        return get_graal_jdk()

    def description(self):
        return "Graal JDK"

# This will override the 'generic' JVMCI JDK with a Graal JVMCI JDK that has
# support for -G style Graal options.
mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance(str(JVMCI_VERSION)), GraalJDKFactory())

def mx_post_parse_cmd_line(opts):
    add_bootclasspath_prepend(mx.distribution('truffle:TRUFFLE_API'))
Ejemplo n.º 5
0
                def __init__(self, debugLevel):
                    JVMCI9JDKConfig.__init__(self, debugLevel)

                def parseVmArgs(self, args, addDefaultArgs=True):
                    return JVMCI9JDKConfig.parseVmArgs(
                        self,
                        _buildGOptionsArgs(args),
                        addDefaultArgs=addDefaultArgs)

            jdk = GraalJDK9Config(jvmci_jdk.debugLevel)
            _graal_jdks['default'] = jdk
    return jdk


class GraalJDKFactory(mx.JDKFactory):
    def getJDKConfig(self):
        return get_graal_jdk()

    def description(self):
        return "Graal JDK"


# This will override the 'generic' JVMCI JDK with a Graal JVMCI JDK that has
# support for -G style Graal options.
mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance(str(JVMCI_VERSION)),
                 GraalJDKFactory())


def mx_post_parse_cmd_line(opts):
    add_bootclasspath_prepend(mx.distribution('truffle:TRUFFLE_API'))