28 from os.path import join, exists, dirname, isdir
29 from argparse import ArgumentParser, REMAINDER
30 import StringIO
31 import xml.dom.minidom
32 import subprocess
33
34 import mx
35 import mx_gate
36 import mx_unittest
37
38 from mx_gate import Task
39 from mx_unittest import unittest
40
41 _suite = mx.suite('jvmci')
42
43 JVMCI_VERSION = 9
44
45 """
46 Top level directory of the JDK source workspace.
47 """
48 _jdkSourceRoot = dirname(_suite.dir)
49
50 _JVMCI_JDK_TAG = 'jvmci'
51
52 _minVersion = mx.VersionSpec('1.9')
53
54 # max version (first _unsupported_ version)
55 _untilVersion = None
56
57 _jvmciModes = {
58 'hosted' : ['-XX:+UnlockExperimentalVMOptions', '-XX:+EnableJVMCI'],
59 'jit' : ['-XX:+UnlockExperimentalVMOptions', '-XX:+EnableJVMCI', '-XX:+UseJVMCICompiler'],
60 'disabled' : []
61 }
62
63 # TODO: can optimized be built without overriding release build?
64 _jdkDebugLevels = ['release', 'fastdebug', 'slowdebug']
65
66 # TODO: add client once/if it can be built on 64-bit platforms
67 _jdkJvmVariants = ['server', 'client']
68
138 return join('lib')
139 if mxos == 'windows' or mxos == 'cygwin':
140 return join('bin')
141 return join('lib', mx.get_arch())
142
143 def isJVMCIEnabled(vm):
144 assert vm in _jdkJvmVariants
145 return True
146
147 def _makehelp():
148 return subprocess.check_output([mx.gmake_cmd(), 'help'], cwd=_jdkSourceRoot)
149
150 def _runmake(args):
151 """run the JDK make process
152
153 To build hotspot and import it into the JDK: "mx make hotspot import-hotspot"
154 {0}"""
155
156 jdkBuildDir = _get_jdk_build_dir()
157 if not exists(jdkBuildDir):
158 # JDK9 must be bootstrapped with a JDK8
159 compliance = mx.JavaCompliance('8')
160 jdk8 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value)
161 cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', '--with-jvm-features=graal',
162 '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home, '--with-jvm-features=graal']
163 mx.run(cmd, cwd=_jdkSourceRoot)
164 cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel]
165 if mx.get_opts().verbose:
166 cmd.append('LOG=debug')
167 cmd.extend(args)
168 if mx.get_opts().use_jdk_image and 'images' not in args:
169 cmd.append('images')
170
171 if not mx.get_opts().verbose:
172 mx.log('--------------- make execution ----------------------')
173 mx.log('Working directory: ' + _jdkSourceRoot)
174 mx.log('Command line: ' + ' '.join(cmd))
175 mx.log('-----------------------------------------------------')
176
177 mx.run(cmd, cwd=_jdkSourceRoot)
178
179 def _runmultimake(args):
180 """run the JDK make process for one or more configurations"""
181
182 jvmVariantsDefault = ','.join(_jdkJvmVariants)
|
28 from os.path import join, exists, dirname, isdir
29 from argparse import ArgumentParser, REMAINDER
30 import StringIO
31 import xml.dom.minidom
32 import subprocess
33
34 import mx
35 import mx_gate
36 import mx_unittest
37
38 from mx_gate import Task
39 from mx_unittest import unittest
40
41 _suite = mx.suite('jvmci')
42
43 JVMCI_VERSION = 9
44
45 """
46 Top level directory of the JDK source workspace.
47 """
48 _jdkSourceRoot = dirname(dirname(_suite.dir))
49
50 _JVMCI_JDK_TAG = 'jvmci'
51
52 _minVersion = mx.VersionSpec('1.9')
53
54 # max version (first _unsupported_ version)
55 _untilVersion = None
56
57 _jvmciModes = {
58 'hosted' : ['-XX:+UnlockExperimentalVMOptions', '-XX:+EnableJVMCI'],
59 'jit' : ['-XX:+UnlockExperimentalVMOptions', '-XX:+EnableJVMCI', '-XX:+UseJVMCICompiler'],
60 'disabled' : []
61 }
62
63 # TODO: can optimized be built without overriding release build?
64 _jdkDebugLevels = ['release', 'fastdebug', 'slowdebug']
65
66 # TODO: add client once/if it can be built on 64-bit platforms
67 _jdkJvmVariants = ['server', 'client']
68
138 return join('lib')
139 if mxos == 'windows' or mxos == 'cygwin':
140 return join('bin')
141 return join('lib', mx.get_arch())
142
143 def isJVMCIEnabled(vm):
144 assert vm in _jdkJvmVariants
145 return True
146
147 def _makehelp():
148 return subprocess.check_output([mx.gmake_cmd(), 'help'], cwd=_jdkSourceRoot)
149
150 def _runmake(args):
151 """run the JDK make process
152
153 To build hotspot and import it into the JDK: "mx make hotspot import-hotspot"
154 {0}"""
155
156 jdkBuildDir = _get_jdk_build_dir()
157 if not exists(jdkBuildDir):
158 # JDK10 must be bootstrapped with a JDK9
159 compliance = mx.JavaCompliance('9')
160 jdk9 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value)
161 cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', '--with-jvm-features=graal',
162 '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk9.home, '--with-jvm-features=graal']
163 mx.run(cmd, cwd=_jdkSourceRoot)
164 cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel]
165 if mx.get_opts().verbose:
166 cmd.append('LOG=debug')
167 cmd.extend(args)
168 if mx.get_opts().use_jdk_image and 'images' not in args:
169 cmd.append('images')
170
171 if not mx.get_opts().verbose:
172 mx.log('--------------- make execution ----------------------')
173 mx.log('Working directory: ' + _jdkSourceRoot)
174 mx.log('Command line: ' + ' '.join(cmd))
175 mx.log('-----------------------------------------------------')
176
177 mx.run(cmd, cwd=_jdkSourceRoot)
178
179 def _runmultimake(args):
180 """run the JDK make process for one or more configurations"""
181
182 jvmVariantsDefault = ','.join(_jdkJvmVariants)
|