comparison mx/mx_graal.py @ 13952:b076b5c13c3f

mx: factor out JavaConfig.processArgs and use it in mx vm. remove default -J arguments.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 14 Feb 2014 15:09:57 +0100
parents 392b6ac8da36
children 4cd7c6629841
comparison
equal deleted inserted replaced
13951:392b6ac8da36 13952:b076b5c13c3f
727 jdk = _jdk(build, vmToCheck=vm, installGraalJar=False) 727 jdk = _jdk(build, vmToCheck=vm, installGraalJar=False)
728 _updateInstalledGraalOptionsFile(jdk) 728 _updateInstalledGraalOptionsFile(jdk)
729 mx.expand_project_in_args(args) 729 mx.expand_project_in_args(args)
730 if _make_eclipse_launch: 730 if _make_eclipse_launch:
731 mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True)) 731 mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True))
732 if len([a for a in args if 'PrintAssembly' in a]) != 0:
733 hsdis([], copyToDir=_vmLibDirInJdk(jdk))
734 if mx.java().debug_port is not None:
735 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=' + str(mx.java().debug_port)] + args
736 if _jacoco == 'on' or _jacoco == 'append': 732 if _jacoco == 'on' or _jacoco == 'append':
737 jacocoagent = mx.library("JACOCOAGENT", True) 733 jacocoagent = mx.library("JACOCOAGENT", True)
738 # Exclude all compiler tests and snippets 734 # Exclude all compiler tests and snippets
739 excludes = ['com.oracle.graal.compiler.tests.*', 'com.oracle.graal.jtt.*'] 735 excludes = ['com.oracle.graal.compiler.tests.*', 'com.oracle.graal.jtt.*']
740 for p in mx.projects(): 736 for p in mx.projects():
748 'includes' : ':'.join(includes), 744 'includes' : ':'.join(includes),
749 'excludes' : ':'.join(excludes), 745 'excludes' : ':'.join(excludes),
750 'destfile' : 'jacoco.exec' 746 'destfile' : 'jacoco.exec'
751 } 747 }
752 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args 748 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args
753 if '-d64' not in args:
754 args = ['-d64'] + args
755
756 exe = join(jdk, 'bin', mx.exe_suffix('java')) 749 exe = join(jdk, 'bin', mx.exe_suffix('java'))
757 pfx = _vm_prefix.split() if _vm_prefix is not None else [] 750 pfx = _vm_prefix.split() if _vm_prefix is not None else []
758 751
759 if '-version' in args: 752 if '-version' in args:
760 ignoredArgs = args[args.index('-version') + 1:] 753 ignoredArgs = args[args.index('-version') + 1:]
761 if len(ignoredArgs) > 0: 754 if len(ignoredArgs) > 0:
762 mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs)) 755 mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs))
763 756
757 args = mx.java().processArgs(args)
764 return (pfx, exe, vm, args, cwd) 758 return (pfx, exe, vm, args, cwd)
765 759
766 def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): 760 def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None):
767 (pfx_, exe_, vm_, args_, cwd) = _parseVmArgs(args, vm, cwd, vmbuild) 761 (pfx_, exe_, vm_, args_, cwd) = _parseVmArgs(args, vm, cwd, vmbuild)
768 return mx.run(pfx_ + [exe_, '-' + vm_] + args_, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) 762 return mx.run(pfx_ + [exe_, '-' + vm_] + args_, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)