Mercurial > hg > graal-compiler
comparison mx/commands.py @ 5197:e91f0761c56d
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 06 Apr 2012 14:26:33 +0200 |
parents | 8125c1f6472b a6eceb5efb0e |
children | ce6cb3a1eb44 c005ca943790 |
comparison
equal
deleted
inserted
replaced
5196:beb13d0326ba | 5197:e91f0761c56d |
---|---|
47 This can be set via the global '--fastdebug' and '--debug' options. """ | 47 This can be set via the global '--fastdebug' and '--debug' options. """ |
48 _vmbuild = 'product' | 48 _vmbuild = 'product' |
49 | 49 |
50 _jacoco = 'off' | 50 _jacoco = 'off' |
51 | 51 |
52 _make_eclipse_launch = False | |
53 | |
52 _jacocoExcludes = ['com.oracle.graal.hotspot.snippets.ArrayCopySnippets', | 54 _jacocoExcludes = ['com.oracle.graal.hotspot.snippets.ArrayCopySnippets', |
53 'com.oracle.graal.snippets.DoubleSnippets', | 55 'com.oracle.graal.snippets.DoubleSnippets', |
54 'com.oracle.graal.snippets.FloatSnippets', | 56 'com.oracle.graal.snippets.FloatSnippets', |
55 'com.oracle.graal.snippets.MathSnippetsX86', | 57 'com.oracle.graal.snippets.MathSnippetsX86', |
56 'com.oracle.graal.snippets.NodeClassSnippets', | 58 'com.oracle.graal.snippets.NodeClassSnippets', |
224 | 226 |
225 if len(failed) != 0: | 227 if len(failed) != 0: |
226 mx.abort('DaCapo failures: ' + str(failed)) | 228 mx.abort('DaCapo failures: ' + str(failed)) |
227 | 229 |
228 def intro(args): | 230 def intro(args): |
229 """"run a simple program and visualize its compilation in the Graal Visualizer""" | 231 """run a simple program and visualize its compilation in the Graal Visualizer""" |
230 # Start the visualizer in a separate thread | 232 # Start the visualizer in a separate thread |
231 t = Thread(target=gv, args=([[]])) | 233 t = Thread(target=gv, args=([[]])) |
232 t.start() | 234 t.start() |
233 | 235 |
234 # Give visualizer time to start | 236 # Give visualizer time to start |
510 mx.log('Appending "' + prefix + ' KNOWN" to ' + jvmCfg) | 512 mx.log('Appending "' + prefix + ' KNOWN" to ' + jvmCfg) |
511 lines.append(vmKnown) | 513 lines.append(vmKnown) |
512 with open(jvmCfg, 'w') as f: | 514 with open(jvmCfg, 'w') as f: |
513 for line in lines: | 515 for line in lines: |
514 f.write(line) | 516 f.write(line) |
515 | 517 |
516 def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): | 518 def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): |
517 """run the VM selected by the '--vm' option""" | 519 """run the VM selected by the '--vm' option""" |
518 | 520 |
519 if vm is None: | 521 if vm is None: |
520 vm = _vm | 522 vm = _vm |
521 | 523 |
522 build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product' | 524 build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product' |
523 mx.expand_project_in_args(args) | 525 mx.expand_project_in_args(args) |
526 if _make_eclipse_launch: | |
527 mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True)) | |
524 if len([a for a in args if 'PrintAssembly' in a]) != 0: | 528 if len([a for a in args if 'PrintAssembly' in a]) != 0: |
525 hsdis([]) | 529 hsdis([]) |
526 if mx.java().debug_port is not None: | 530 if mx.java().debug_port is not None: |
527 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(mx.java().debug_port)] + args | 531 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(mx.java().debug_port)] + args |
528 if _jacoco == 'on' or _jacoco == 'append': | 532 if _jacoco == 'on' or _jacoco == 'append': |
942 if (_vmSourcesAvailable): | 946 if (_vmSourcesAvailable): |
943 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)') | 947 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)') |
944 mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM') | 948 mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM') |
945 mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM') | 949 mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM') |
946 mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug build of the VM') | 950 mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug build of the VM') |
951 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') | |
947 | 952 |
948 commands.update({ | 953 commands.update({ |
949 'export': [export, '[-options] [zipfile]'], | 954 'export': [export, '[-options] [zipfile]'], |
950 'build': [build, '[-options] [product|debug|fastdebug]...'] | 955 'build': [build, '[-options] [product|debug|fastdebug]...'] |
951 }) | 956 }) |
966 global _vm | 971 global _vm |
967 _vm = opts.vm | 972 _vm = opts.vm |
968 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: | 973 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: |
969 global _vmbuild | 974 global _vmbuild |
970 _vmbuild = opts.vmbuild | 975 _vmbuild = opts.vmbuild |
976 global _make_eclipse_launch | |
977 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) | |
971 global _jacoco | 978 global _jacoco |
972 _jacoco = opts.jacoco | 979 _jacoco = opts.jacoco |