Mercurial > hg > graal-jvmci-8
comparison mx/mx_graal.py @ 17372:d42e11af980d
mx: simplified ctw command
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 09 Oct 2014 00:20:30 +0200 |
parents | 4f9633b83a24 |
children | 9e5abd0e7916 |
comparison
equal
deleted
inserted
replaced
17371:58f45b63b802 | 17372:d42e11af980d |
---|---|
1356 mx.abort(codeOrMessage) | 1356 mx.abort(codeOrMessage) |
1357 return self | 1357 return self |
1358 | 1358 |
1359 def ctw(args): | 1359 def ctw(args): |
1360 """run CompileTheWorld""" | 1360 """run CompileTheWorld""" |
1361 from sanitycheck import CTWMode | 1361 |
1362 modes = { | 1362 parser = ArgumentParser(prog='mx ctw') |
1363 'noinline' : CTWMode.NoInline, | 1363 parser.add_argument('--ctwopts', action='store', help='space separated Graal options (without the -G: prefix) used for CTW compilations') |
1364 'nocomplex' : CTWMode.NoComplex, | 1364 parser.add_argument('--jar', action='store', help='jar of classes to compiled instead of rt.jar') |
1365 'full' : CTWMode.Full | 1365 parser.add_argument('vmargs', nargs=REMAINDER, metavar='VM options...') |
1366 } | 1366 |
1367 mode = sanitycheck.CTWMode.NoInline | 1367 args, vmargs = parser.parse_known_args(args) |
1368 vmargs = [] | 1368 |
1369 for a in args: | 1369 if args.ctwopts: |
1370 m = modes.get(a, None) | 1370 vmargs.append('-G:CompileTheWorldConfig=' + args.ctwopts) |
1371 if m: | 1371 |
1372 mode = m | 1372 if args.jar: |
1373 else: | 1373 jar = args.jar |
1374 vmargs.append(a) | 1374 else: |
1375 | 1375 jar = join(_jdk(installJars=False), 'jre', 'lib', 'rt.jar') |
1376 jdk = _jdk(installJars=False) | 1376 |
1377 rtjar = join(jdk, 'jre', 'lib', 'rt.jar') | 1377 vmargs += ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + jar] |
1378 | 1378 if _get_vm() == 'graal': |
1379 vm_ = _get_vm() | 1379 vmargs += ['-XX:+BootstrapGraal'] |
1380 | 1380 vm(vmargs) |
1381 args = vmargs + ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + rtjar] | |
1382 if vm_ == 'graal': | |
1383 args += ['-XX:+BootstrapGraal'] | |
1384 if mode >= CTWMode.NoInline: | |
1385 if not isGraalEnabled(vm_): | |
1386 args.append('-XX:-Inline') | |
1387 else: | |
1388 args.append('-G:-Inline') | |
1389 if mode >= CTWMode.NoComplex: | |
1390 if isGraalEnabled(vm_): | |
1391 args += ['-G:-OptLoopTransform', '-G:-OptTailDuplication', '-G:-FullUnroll', '-G:-MemoryAwareScheduling', '-G:-NewMemoryAwareScheduling', '-G:-PartialEscapeAnalysis'] | |
1392 vm(args) | |
1393 | 1381 |
1394 def _basic_gate_body(args, tasks): | 1382 def _basic_gate_body(args, tasks): |
1395 t = Task('BuildHotSpotGraal: fastdebug,product') | 1383 t = Task('BuildHotSpotGraal: fastdebug,product') |
1396 buildvms(['--vms', 'graal,server', '--builds', 'fastdebug,product']) | 1384 buildvms(['--vms', 'graal,server', '--builds', 'fastdebug,product']) |
1397 tasks.append(t.stop()) | 1385 tasks.append(t.stop()) |
1746 | 1734 |
1747 if 'ctw-full' in args: | 1735 if 'ctw-full' in args: |
1748 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.Full)) | 1736 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.Full)) |
1749 if 'ctw-noinline' in args: | 1737 if 'ctw-noinline' in args: |
1750 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline)) | 1738 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline)) |
1751 if 'ctw-nocomplex' in args: | |
1752 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoComplex)) | |
1753 | 1739 |
1754 for test in benchmarks: | 1740 for test in benchmarks: |
1755 for (groupName, res) in test.bench(vm, extraVmOpts=vmArgs).items(): | 1741 for (groupName, res) in test.bench(vm, extraVmOpts=vmArgs).items(): |
1756 group = results.setdefault(groupName, {}) | 1742 group = results.setdefault(groupName, {}) |
1757 group.update(res) | 1743 group.update(res) |