Mercurial > hg > graal-compiler
comparison mx/commands.py @ 9167:e49300a46e88
removed unused and long deprecated 'example' command
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 16 Apr 2013 22:37:30 +0200 |
parents | 0f3fe35513a0 |
children | 50161aa21af2 |
comparison
equal
deleted
inserted
replaced
9166:0f3fe35513a0 | 9167:e49300a46e88 |
---|---|
124 # clean up temp directory | 124 # clean up temp directory |
125 mx.log('Cleaning up...') | 125 mx.log('Cleaning up...') |
126 shutil.rmtree(tmp) | 126 shutil.rmtree(tmp) |
127 | 127 |
128 mx.log('Created distribution in ' + zfName) | 128 mx.log('Created distribution in ' + zfName) |
129 | |
130 def example(args): | |
131 """run some or all Graal examples""" | |
132 examples = { | |
133 'safeadd': ['com.oracle.graal.examples.safeadd', 'com.oracle.graal.examples.safeadd.Main'], | |
134 'vectorlib': ['com.oracle.graal.examples.vectorlib', 'com.oracle.graal.examples.vectorlib.Main'], | |
135 } | |
136 | |
137 def run_example(verbose, project, mainClass): | |
138 cp = mx.classpath(project) | |
139 sharedArgs = ['-Xcomp', '-XX:CompileOnly=Main', mainClass] | |
140 | |
141 res = [] | |
142 mx.log("=== Server VM ===") | |
143 printArg = '-XX:+PrintCompilation' if verbose else '-XX:-PrintCompilation' | |
144 res.append(vm(['-cp', cp, printArg] + sharedArgs, vm='server')) | |
145 mx.log("=== Graal VM ===") | |
146 printArg = '-G:+PrintCompilation' if verbose else '-G:-PrintCompilation' | |
147 res.append(vm(['-cp', cp, printArg, '-G:-Extend', '-G:-Inline'] + sharedArgs)) | |
148 mx.log("=== Graal VM with extensions ===") | |
149 res.append(vm(['-cp', cp, printArg, '-G:+Extend', '-G:-Inline'] + sharedArgs)) | |
150 | |
151 if len([x for x in res if x != 0]) != 0: | |
152 return 1 | |
153 return 0 | |
154 | |
155 verbose = False | |
156 if '-v' in args: | |
157 verbose = True | |
158 args = [a for a in args if a != '-v'] | |
159 | |
160 if len(args) == 0: | |
161 args = examples.keys() | |
162 for a in args: | |
163 config = examples.get(a) | |
164 if config is None: | |
165 mx.log('unknown example: ' + a + ' {available examples = ' + str(examples.keys()) + '}') | |
166 else: | |
167 mx.log('--------- ' + a + ' ------------') | |
168 project, mainClass = config | |
169 run_example(verbose, project, mainClass) | |
170 | 129 |
171 def dacapo(args): | 130 def dacapo(args): |
172 """run one or all DaCapo benchmarks | 131 """run one or all DaCapo benchmarks |
173 | 132 |
174 DaCapo options are distinguished from VM options by a '@' prefix. | 133 DaCapo options are distinguished from VM options by a '@' prefix. |
1375 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'], | 1334 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'], |
1376 'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'], | 1335 'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'], |
1377 'specjvm2008': [specjvm2008, '[VM options|specjvm2008 options (-v, -ikv, -ict, -wt, -it)]'], | 1336 'specjvm2008': [specjvm2008, '[VM options|specjvm2008 options (-v, -ikv, -ict, -wt, -it)]'], |
1378 'specjbb2013': [specjbb2013, '[VM options]'], | 1337 'specjbb2013': [specjbb2013, '[VM options]'], |
1379 'specjbb2005': [specjbb2005, '[VM options]'], | 1338 'specjbb2005': [specjbb2005, '[VM options]'], |
1380 #'example': [example, '[-v] example names...'], | |
1381 'gate' : [gate, '[-options]'], | 1339 'gate' : [gate, '[-options]'], |
1382 'gv' : [gv, ''], | 1340 'gv' : [gv, ''], |
1383 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], | 1341 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], |
1384 'unittest' : [unittest, '[filters...]'], | 1342 'unittest' : [unittest, '[filters...]'], |
1385 'longunittest' : [longunittest, '[filters...]'], | 1343 'longunittest' : [longunittest, '[filters...]'], |