comparison mx.jvmci/mx_jvmci.py @ 22561:ba4ef98ae535

Add mx_jvmci API to prepend ClasspathDependencies to the bootclasspath of the jvmci JDK
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 15 Sep 2015 18:01:46 +0200
parents bab91f9ae795
children 0dcb75831004
comparison
equal deleted inserted replaced
22560:9665bbd976c8 22561:ba4ef98ae535
1734 if _untilVersion: 1734 if _untilVersion:
1735 versionDesc += " and <=" + str(_untilVersion) 1735 versionDesc += " and <=" + str(_untilVersion)
1736 _jvmci_bootstrap_jdk = mx.get_jdk(_versionCheck, versionDescription=versionDesc, tag='default') 1736 _jvmci_bootstrap_jdk = mx.get_jdk(_versionCheck, versionDescription=versionDesc, tag='default')
1737 return _jvmci_bootstrap_jdk 1737 return _jvmci_bootstrap_jdk
1738 1738
1739 _jvmci_bootclasspath_prepends = []
1740
1741 def add_bootclasspath_prepend(dep):
1742 assert isinstance(dep, mx.ClasspathDependency)
1743 _jvmci_bootclasspath_prepends.append(dep)
1744
1739 class JVMCIJDKConfig(mx.JDKConfig): 1745 class JVMCIJDKConfig(mx.JDKConfig):
1740 def __init__(self, vmbuild): 1746 def __init__(self, vmbuild):
1741 # Ignore the deployable distributions here - they are only deployed during building. 1747 # Ignore the deployable distributions here - they are only deployed during building.
1742 # This significantly reduces the latency of the "mx java" command. 1748 # This significantly reduces the latency of the "mx java" command.
1743 self.vmbuild = vmbuild 1749 self.vmbuild = vmbuild
1766 if jvmciArgs: 1772 if jvmciArgs:
1767 if existingJvmciOptionsProperty: 1773 if existingJvmciOptionsProperty:
1768 mx.abort('defining jvmci.option property is incompatible with defining one or more -G: options: ' + existingJvmciOptionsProperty) 1774 mx.abort('defining jvmci.option property is incompatible with defining one or more -G: options: ' + existingJvmciOptionsProperty)
1769 args = ['-Djvmci.options=' + ' '.join(jvmciArgs)] + nonJvmciArgs 1775 args = ['-Djvmci.options=' + ' '.join(jvmciArgs)] + nonJvmciArgs
1770 1776
1777 args = ['-Xbootclasspath/p:' + dep.classpath_repr() for dep in _jvmci_bootclasspath_prepends] + args
1778
1771 if '-version' in args: 1779 if '-version' in args:
1772 ignoredArgs = args[args.index('-version') + 1:] 1780 ignoredArgs = args[args.index('-version') + 1:]
1773 if len(ignoredArgs) > 0: 1781 if len(ignoredArgs) > 0:
1774 mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs)) 1782 mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs))
1775 return self.processArgs(args, addDefaultArgs=addDefaultArgs) 1783 return self.processArgs(args, addDefaultArgs=addDefaultArgs)