本文整理汇总了Python中mx.update_commands函数的典型用法代码示例。如果您正苦于以下问题:Python update_commands函数的具体用法?Python update_commands怎么用?Python update_commands使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_commands函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mx_init
def mx_init(suite):
mx.add_argument('--vmdir', dest='vmdir', help='directory for VM executable, shared libraries boot image and related files', metavar='<path>')
commands = {
'c1x': [c1x, '[options] patterns...'],
'configs': [configs, ''],
'copycheck': [copycheck, ''],
'eclipse': [eclipse, '[VM options]'],
'gate': [gate, '[options]'],
'hcfdis': [hcfdis, '[options] files...'],
'helloworld': [helloworld, '[VM options]'],
'inspecthelloworld': [inspecthelloworld, '[VM options]'],
'image': [image, '[options] classes|packages...'],
'inspect': [inspect, '[options] [class | -jar jarfile] [args...]'],
'inspectoragent': [inspectoragent, '[-impl target] [-port port]'],
'jnigen': [jnigen, ''],
'jvmtigen': [jvmtigen, ''],
'optionsgen': [optionsgen, ''],
'jttgen': [jttgen, ''],
'loggen': [loggen, ''],
'makejdk': [makejdk, '[<destination directory>]'],
'methodtree': [methodtree, '[options]'],
'nm': [nm, '[options] [boot image file]', _vm_image],
'objecttree': [objecttree, '[options]'],
'olc': [olc, '[options] patterns...', _patternHelp],
'site' : [site, '[options]'],
't1x': [t1x, '[options] patterns...'],
't1xgen': [t1xgen, ''],
'test': [test, '[options]'],
'verify': [verify, '[options] patterns...', _patternHelp],
'view': [view, '[options]'],
'vm': [vm, '[options] [class | -jar jarfile] [args...]'],
'wikidoc': [wikidoc, '[options]']
}
mx.update_commands(suite, commands)
示例2: mx_init
def mx_init(suite):
commands = {
# new commands
'python' : [python, '[Python args|@VM options]'],
# core overrides
'bench' : [bench, ''],
}
mx.update_commands(suite, commands)
示例3:
mx.update_commands(_suite, {
'suoptbench' : [suOptBench, ''],
'subench' : [suBench, ''],
'clangbench' : [clangBench, ''],
'gccbench' : [gccBench, ''],
'build' : [sulongBuild, ''],
'su-options' : [printOptions, ''],
'su-pullbenchmarkgame' : [pullBenchmarkGame, ''],
'su-pulldeps' : [downloadDependencies, ''],
'su-pullllvmbinaries' : [pullLLVMBinaries, ''],
'su-pullnwccsuite' : [pullNWCCSuite, ''],
'su-pullgccsuite' : [pullGCCSuite, ''],
'su-pullllvmsuite' : [pullLLVMSuite, ''],
'su-pulltools' : [pullTools, ''],
'su-pulldragonegg' : [pullInstallDragonEgg, ''],
'su-run' : [runLLVM, ''],
'su-tests' : [runTests, ''],
'su-local-gate' : [localGate, ''],
'su-clang' : [compileWithClang, ''],
'su-clang++' : [compileWithClangPP, ''],
'su-opt' : [opt, ''],
'su-optimize' : [suOptimalOpt, ''],
'su-compile-optimize' : [suOptCompile, ''],
'su-link' : [link, ''],
'su-gcc' : [dragonEgg, ''],
'su-gfortran' : [dragonEggGFortran, ''],
'su-g++' : [dragonEggGPP, ''],
'su-travis1' : [travis1, ''],
'su-travis2' : [travis2, ''],
'su-travis3' : [travis3, ''],
'su-travis4' : [travis4, ''],
'su-travis-sulong' : [travisTestSulong, ''],
'su-travis-argon2' : [travisArgon2, ''],
'su-travis-tests' : [testsuites.travisRunSuite, ''],
'su-ecj-strict' : [compileWithEcjStrict, ''],
'su-basic-checkcode' : [runChecks, ''],
'su-gitlogcheck' : [logCheck, ''],
'su-mdlcheck' : [mdlCheck, ''],
'su-clangformatcheck' : [clangformatcheck, ''],
'su-httpcheck' : [checkNoHttp, ''],
'su-get-llvm-program' : [getLLVMProgramPath, ''],
'su-get-gcc-program' : [getGCCProgramPath, ''],
'su-compile-tests' : [testsuites.compileSuite, ''],
})
示例4: ArchiveProject
class ArchiveProject(mx.ArchivableProject):
def __init__(self, suite, name, deps, workingSets, theLicense, **args):
mx.ArchivableProject.__init__(self, suite, name, deps, workingSets, theLicense)
assert 'prefix' in args
assert 'outputDir' in args
def output_dir(self):
return join(self.dir, self.outputDir)
def archive_prefix(self):
return self.prefix
def getResults(self):
return mx.ArchivableProject.walk(self.output_dir())
class SulongDocsProject(ArchiveProject):
doc_files = (glob.glob(join(_suite.dir, 'LICENSE')) +
glob.glob(join(_suite.dir, '*.md')))
def getResults(self):
return [join(_suite.dir, f) for f in self.doc_files]
mx_benchmark.add_bm_suite(mx_sulong_benchmarks.SulongBenchmarkSuite())
mx.update_commands(_suite, {
'pulldragonegg' : [pullInstallDragonEgg, ''],
'lli' : [runLLVM, ''],
})
示例5: specjbb2015
def specjbb2015(args):
"""run the composite SPECjbb2015 benchmark"""
def launcher(bm, harnessArgs, extraVmOpts):
assert bm is None
return sanitycheck.getSPECjbb2015(harnessArgs).bench(mx_graal_core.get_vm(), extraVmOpts=extraVmOpts)
_run_benchmark(args, None, launcher)
def specjbb2005(args):
"""run the composite SPECjbb2005 benchmark"""
def launcher(bm, harnessArgs, extraVmOpts):
assert bm is None
return sanitycheck.getSPECjbb2005(harnessArgs).bench(mx_graal_core.get_vm(), extraVmOpts=extraVmOpts)
_run_benchmark(args, None, launcher)
mx.update_commands(mx.suite('graal-core'), {
'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo options]'],
'scaladacapo': [scaladacapo, '[VM options] benchmarks...|"all" [Scala DaCapo options]'],
'specjvm2008': [specjvm2008, '[VM options] benchmarks...|"all" [SPECjvm2008 options]'],
'specjbb2013': [specjbb2013, '[VM options] [-- [SPECjbb2013 options]]'],
'specjbb2015': [specjbb2015, '[VM options] [-- [SPECjbb2015 options]]'],
'specjbb2005': [specjbb2005, '[VM options] [-- [SPECjbb2005 options]]'],
'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
'deoptalot' : [deoptalot, '[n]'],
'longtests' : [longtests, ''],
})
示例6: JVMCI9JDKFactory
_jvmci_jdks[debugLevel] = jdk
return jdk
class JVMCI9JDKFactory(mx.JDKFactory):
def getJDKConfig(self):
jdk = get_jvmci_jdk(_vm.debugLevel)
return jdk
def description(self):
return "JVMCI JDK"
mx.update_commands(_suite, {
'make': [_runmake, '[args...]', _makehelp],
'multimake': [_runmultimake, '[options]'],
'c1visualizer' : [c1visualizer, ''],
'hsdis': [hsdis, '[att]'],
'hcfdis': [hcfdis, ''],
'igv' : [igv, ''],
'jol' : [jol, ''],
'vm': [run_vm, '[-options] class [args...]'],
})
mx.add_argument('-M', '--jvmci-mode', action='store', choices=sorted(_jvmciModes.viewkeys()), help='the JVM variant type to build/run (default: ' + _vm.jvmciMode + ')')
mx.add_argument('--jdk-jvm-variant', '--vm', action='store', choices=_jdkJvmVariants + sorted(_legacyVms.viewkeys()), help='the JVM variant type to build/run (default: ' + _vm.jvmVariant + ')')
mx.add_argument('--jdk-debug-level', '--vmbuild', action='store', choices=_jdkDebugLevels + sorted(_legacyVmbuilds.viewkeys()), help='the JDK debug level to build/run (default: ' + _vm.debugLevel + ')')
mx.add_argument('-I', '--use-jdk-image', action='store_true', help='build/run JDK image instead of exploded JDK')
mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCI9JDKFactory())
def mx_post_parse_cmd_line(opts):
mx.set_java_command_default_jdk_tag(_JVMCI_JDK_TAG)
示例7: build
def build(args, vm=None):
"""build the Java sources"""
opts2 = mx.build(['--source', '1.7'] + args)
assert len(opts2.remainder) == 0
def sl(args):
"""run an SL program"""
vmArgs, slArgs = mx.extract_VM_args(args)
mx.run_java(vmArgs + ['-cp', mx.classpath(["TRUFFLE_API", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs)
def sldebug(args):
"""run a simple command line debugger for the Simple Language"""
vmArgs, slArgs = mx.extract_VM_args(args, useDoubleDash=True)
mx.run_java(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPL"] + slArgs)
def _truffle_gate_runner(args, tasks):
with Task('Truffle Javadoc', tasks) as t:
if t: mx.javadoc(['--unified'])
with Task('Truffle UnitTests', tasks) as t:
if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
with Task('Truffle Signature Tests', tasks) as t:
if t: sigtest(['--check', 'binary'])
mx_gate.add_gate_runner(_suite, _truffle_gate_runner)
mx.update_commands(_suite, {
'sl' : [sl, '[SL args|@VM options]'],
'sldebug' : [sldebug, '[SL args|@VM options]'],
})
示例8: Task
with Task('Jackpot check', tasks) as t:
if t: jackpot(['--fail-on-warnings'], suite=None, nonZeroIsFatal=True)
if jdk.javaCompliance < '9':
with Task('Truffle Javadoc', tasks) as t:
if t: mx.javadoc(['--unified'])
with Task('Truffle UnitTests', tasks) as t:
if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
with Task('Truffle Signature Tests', tasks) as t:
if t: sigtest(['--check', 'binary'])
mx_gate.add_gate_runner(_suite, _truffle_gate_runner)
mx.update_commands(_suite, {
'javadoc' : [javadoc, '[SL args|@VM options]'],
'sl' : [sl, '[SL args|@VM options]'],
'repl' : [repl, '[REPL Debugger args|@VM options]'],
'testrubytruffle' : [testrubytruffle, ''],
'testgraal' : [testgraal, ''],
})
"""
Merges META-INF/truffle/language and META-INF/truffle/instrument files.
This code is tightly coupled with the file format generated by
LanguageRegistrationProcessor and InstrumentRegistrationProcessor.
"""
class TruffleArchiveParticipant:
PROPERTY_RE = re.compile(r'(language\d+|instrument\d+)(\..+)')
def _truffle_metainf_file(self, arcname):
if arcname == 'META-INF/truffle/language':
return 'language'
示例9: create_asm_parser
* with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Checkstyle: stop
//@formatter:off
{0}
"""
def create_asm_parser(args=None, out=None):
"""create the inline assembly parser using antlr"""
mx.suite("truffle").extensions.create_parser("com.oracle.truffle.llvm.asm.amd64", "com.oracle.truffle.llvm.asm.amd64", "InlineAssembly", COPYRIGHT_HEADER_BSD, args, out)
mx.update_commands(_suite, {
'lli' : [runLLVM, ''],
'test-llvm-image' : [_test_llvm_image, 'test a pre-built LLVM image'],
'create-asm-parser' : [create_asm_parser, 'create the inline assembly parser using antlr'],
})
示例10:
mx.update_commands(_suite, {
'suoptbench' : [suOptBench, ''],
'subench' : [suBench, ''],
'clangbench' : [clangBench, ''],
'gccbench' : [gccBench, ''],
'su-options' : [printOptions, ''],
'su-pullbenchmarkgame' : [pullBenchmarkGame, ''],
'su-pulldeps' : [downloadDependencies, ''],
'su-pullllvmbinaries' : [pullLLVMBinaries, ''],
'su-pullnwccsuite' : [pullNWCCSuite, ''],
'su-pullgccsuite' : [pullGCCSuite, ''],
'su-pullllvmsuite' : [pullLLVMSuite, ''],
'su-pulltools' : [pullTools, ''],
'su-pulldragonegg' : [pullInstallDragonEgg, ''],
'su-run' : [runLLVM, ''],
'su-tests' : [runTests, ''],
'su-tests-bench' : [runBenchmarkTestCases, ''],
'su-tests-gcc' : [runGCCTestCases, ''],
'su-tests-llvm' : [runLLVMTestCases, ''],
'su-tests-sulong' : [runTruffleTestCases, ''],
'su-tests-nwcc' : [runNWCCTestCases, ''],
'su-tests-types' : [runTypeTestCases, ''],
'su-tests-polyglot' : [runPolyglotTestCases, ''],
'su-tests-interop' : [runInteropTestCases, ''],
'su-tests-asm' : [runAsmTestCases, ''],
'su-tests-compile' : [runCompileTestCases, ''],
'su-tests-jruby' : [runTestJRuby, ''],
'su-local-gate' : [localGate, ''],
'su-clang' : [compileWithClang, ''],
'su-clang++' : [compileWithClangPP, ''],
'su-opt' : [opt, ''],
'su-link' : [link, ''],
'su-gcc' : [dragonEgg, ''],
'su-gfortran' : [dragonEggGFortran, ''],
'su-g++' : [dragonEggGPP, ''],
'su-travis1' : [travis1, ''],
'su-travis2' : [travis2, ''],
'su-travis3' : [travis3, ''],
'su-travis-jruby' : [travisJRuby, ''],
'su-gitlogcheck' : [logCheck, ''],
'su-mdlcheck' : [mdlCheck, ''],
'su-clangformatcheck' : [clangformatcheck, '']
})
示例11: setup_jruby_home
# Give precedence to graal classpath and VM options
classpath = user_classpath + classpath
vmArgs = vmArgs + [
# '-Xss2048k',
'-Xbootclasspath/a:' + truffle_api,
'-cp', ':'.join(classpath),
'org.jruby.truffle.Main'
]
allArgs = vmArgs + ['-X+T'] + rubyArgs
env = setup_jruby_home()
if print_command:
if mx.get_opts().verbose:
log('Environment variables:')
for key in sorted(env.keys()):
log(key + '=' + env[key])
log(java + ' ' + ' '.join(map(pipes.quote, allArgs)))
return os.execve(java, [argv0] + allArgs, env)
def ruby_tck(args):
env = setup_jruby_home()
os.environ["JRUBY_HOME"] = env["JRUBY_HOME"]
mx_unittest.unittest(['--verbose', '--suite', 'jruby'])
mx.update_commands(_suite, {
'ruby' : [ruby_command, '[ruby args|@VM options]'],
'rubytck': [ruby_tck, ''],
'deploy-binary-if-truffle-head': [deploy_binary_if_truffle_head, ''],
})
示例12: __addsrc__
def __addsrc__(self, arcname, contents):
return False
def __closing__(self):
pass
mx.add_argument('--vmprefix', action='store', dest='vm_prefix', help='prefix for running the VM (e.g. "gdb --args")', metavar='<prefix>')
mx.add_argument('--gdb', action='store_const', const='gdb --args', dest='vm_prefix', help='alias for --vmprefix "gdb --args"')
mx.add_argument('--lldb', action='store_const', const='lldb --', dest='vm_prefix', help='alias for --vmprefix "lldb --"')
def sl(args):
"""run an SL program"""
mx.get_opts().jdk = 'jvmci'
mx_truffle.sl(args)
mx.update_commands(_suite, {
'sl' : [sl, '[SL args|@VM options]'],
'vm': [run_vm, '[-options] class [args...]'],
'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'],
'nodecostdump' : [_nodeCostDump, ''],
'verify_jvmci_ci_versions': [verify_jvmci_ci_versions, ''],
})
def mx_post_parse_cmd_line(opts):
mx.add_ide_envvar('JVMCI_VERSION_CHECK')
for dist in _suite.dists:
dist.set_archiveparticipant(GraalArchiveParticipant(dist, isTest=dist.name.endswith('_TEST')))
add_bootclasspath_append(mx.distribution('truffle:TRUFFLE_API'))
global _vm_prefix
_vm_prefix = opts.vm_prefix
示例13:
))
mx_sdk.register_graalvm_component(mx_sdk.GraalVmTool(
suite=_suite,
name='GraalVM Profiler',
short_name='pro',
dir_name='profiler',
license_files=[],
third_party_license_files=[],
truffle_jars=['tools:TRUFFLE_PROFILER'],
support_distributions=['tools:TRUFFLE_PROFILER_GRAALVM_SUPPORT'],
include_by_default=True,
))
mx_sdk.register_graalvm_component(mx_sdk.GraalVmJdkComponent(
suite=_suite,
name='VisualVM',
short_name='vvm',
dir_name='visualvm',
license_files=[],
third_party_license_files=[],
support_distributions=['tools:VISUALVM_GRAALVM_SUPPORT'],
provided_executables=['bin/jvisualvm']
))
mx.update_commands(_suite, {
'javadoc' : [javadoc, ''],
'gate' : [mx_gate.gate, ''],
})
示例14: ArchiveProject
class ArchiveProject(mx.ArchivableProject):
def __init__(self, suite, name, deps, workingSets, theLicense, **args):
mx.ArchivableProject.__init__(self, suite, name, deps, workingSets, theLicense)
assert 'prefix' in args
assert 'outputDir' in args
def output_dir(self):
return join(self.dir, self.outputDir)
def archive_prefix(self):
return self.prefix
def getResults(self):
return mx.ArchivableProject.walk(self.output_dir())
class SulongDocsProject(ArchiveProject):
doc_files = (glob.glob(join(_suite.dir, 'LICENSE')) +
glob.glob(join(_suite.dir, '*.md')))
def getResults(self):
return [join(_suite.dir, f) for f in self.doc_files]
mx_benchmark.add_bm_suite(mx_sulong_benchmarks.SulongBenchmarkSuite())
mx.update_commands(_suite, {
'lli' : [runLLVM, ''],
})
示例15:
"substratevm:POLYGLOT_NATIVE_API_HEADERS"
],
has_polyglot_lib_entrypoints=True,
))
if os.environ.has_key('NATIVE_IMAGE_TESTING'):
mx_sdk.register_graalvm_component(mx_sdk.GraalVmTool(
suite=suite,
name='Native Image JUnit',
short_name='nju',
dir_name='junit',
license_files=[],
third_party_license_files=[],
truffle_jars=[],
builder_jar_distributions=['mx:JUNIT_TOOL', 'mx:JUNIT', 'mx:HAMCREST'],
support_distributions=['substratevm:NATIVE_IMAGE_JUNIT_SUPPORT'],
include_in_polyglot=False,
))
mx.update_commands(suite, {
'gate': [gate, '[options]'],
'build': [build, ''],
'helloworld' : [lambda args: native_image_context_run(helloworld, args), ''],
'cinterfacetutorial' : [lambda args: native_image_context_run(cinterfacetutorial, args), ''],
'fetch-languages': [lambda args: fetch_languages(args, early_exit=False), ''],
'benchmark': [benchmark, '--vmargs [vmargs] --runargs [runargs] suite:benchname'],
'native-image': [native_image_on_jvm, ''],
'maven-plugin-install': [maven_plugin_install, ''],
'native-unittest' : [lambda args: native_image_context_run(native_unittest, args), ''],
})