comparison mx/commands.py @ 5596:e4b1bc5e29e0

hsdis library is downloaded into newly created Graal JDK
author Doug Simon <doug.simon@oracle.com>
date Thu, 14 Jun 2012 12:28:20 +0200
parents e09a1efdeafd
children 14505f3e6b4c
comparison
equal deleted inserted replaced
5595:ea9ac81f5645 5596:e4b1bc5e29e0
336 336
337 with open(jvmCfg, 'w') as f: 337 with open(jvmCfg, 'w') as f:
338 for line in lines: 338 for line in lines:
339 f.write(line) 339 f.write(line)
340 340
341 # Install a copy of the disassembler library
342 try:
343 hsdis([], copyToDir=_vmLibDirInJdk(jdk))
344 except SystemExit:
345 pass
341 else: 346 else:
342 if not exists(jdk): 347 if not exists(jdk):
343 mx.abort('The ' + build + ' VM has not been created - run \'mx clean; mx build ' + build + '\'') 348 mx.abort('The ' + build + ' VM has not been created - run \'mx clean; mx build ' + build + '\'')
344 return jdk 349 return jdk
345 350
551 556
552 if vm is None: 557 if vm is None:
553 vm = _vm 558 vm = _vm
554 559
555 build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product' 560 build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product'
561 jdk = _jdk(build)
556 mx.expand_project_in_args(args) 562 mx.expand_project_in_args(args)
557 if _make_eclipse_launch: 563 if _make_eclipse_launch:
558 mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True)) 564 mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True))
559 if len([a for a in args if 'PrintAssembly' in a]) != 0: 565 if len([a for a in args if 'PrintAssembly' in a]) != 0:
560 hsdis([]) 566 hsdis([], copyToDir=_vmLibDirInJdk(jdk))
561 if mx.java().debug_port is not None: 567 if mx.java().debug_port is not None:
562 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(mx.java().debug_port)] + args 568 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(mx.java().debug_port)] + args
563 if _jacoco == 'on' or _jacoco == 'append': 569 if _jacoco == 'on' or _jacoco == 'append':
564 jacocoagent = mx.library("JACOCOAGENT", True) 570 jacocoagent = mx.library("JACOCOAGENT", True)
565 # Exclude all compiler tests and snippets 571 # Exclude all compiler tests and snippets
571 'bootclasspath' : 'true', 577 'bootclasspath' : 'true',
572 'includes' : 'com.oracle.*', 578 'includes' : 'com.oracle.*',
573 'excludes' : ':'.join(excludes) 579 'excludes' : ':'.join(excludes)
574 } 580 }
575 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args 581 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args
576 exe = join(_jdk(build), 'bin', mx.exe_suffix('java')) 582 exe = join(jdk, 'bin', mx.exe_suffix('java'))
577 return mx.run([exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) 583 return mx.run([exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)
578 584
579 def _find_classes_with_annotations(classes, p, pkgRoot, annotations, includeInnerClasses=False): 585 def _find_classes_with_annotations(classes, p, pkgRoot, annotations, includeInnerClasses=False):
580 """ 586 """
581 Scan the sources of project 'p' for Java source files containing a line starting with 'annotation' 587 Scan the sources of project 'p' for Java source files containing a line starting with 'annotation'
965 vmArgs.remove('-it') 971 vmArgs.remove('-it')
966 benchArgs.remove(args[itIdx+1]) 972 benchArgs.remove(args[itIdx+1])
967 vm = _vm; 973 vm = _vm;
968 sanitycheck.getSPECjvm2008(benchArgs, skipValid, wt, it).bench(vm, opts=vmArgs) 974 sanitycheck.getSPECjvm2008(benchArgs, skipValid, wt, it).bench(vm, opts=vmArgs)
969 975
970 def hsdis(args): 976 def hsdis(args, copyToDir=None):
971 """install the hsdis library 977 """downloads the hsdis library
972 978
973 This is needed to support HotSpot's assembly dumping features. 979 This is needed to support HotSpot's assembly dumping features.
974 By default it installs the Intel syntax version, use the 'att' argument to install AT&T syntax.""" 980 By default it downloads the Intel syntax version, use the 'att' argument to install AT&T syntax."""
975 flavor = 'intel' 981 flavor = 'intel'
976 if 'att' in args: 982 if 'att' in args:
977 flavor = 'att' 983 flavor = 'att'
978 build = _vmbuild if _vmSourcesAvailable else 'product'
979 lib = mx.lib_suffix('hsdis-amd64') 984 lib = mx.lib_suffix('hsdis-amd64')
980 path = join(_vmLibDirInJdk(_jdk(build)), lib) 985 path = join(_graal_home, 'lib', lib)
981 if not exists(path): 986 if not exists(path):
982 mx.download(path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavor + "/" + lib]) 987 mx.download(path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavor + "/" + lib])
988 if copyToDir is not None and exists(copyToDir):
989 shutil.copy(path, copyToDir)
983 990
984 def hcfdis(args): 991 def hcfdis(args):
985 """disassembles HexCodeFiles embedded in text files 992 """disassembles HexCodeFiles embedded in text files
986 993
987 Run a tool over the input files to convert all embedded HexCodeFiles 994 Run a tool over the input files to convert all embedded HexCodeFiles