Mercurial > hg > graal-compiler
comparison mx/mx_graal.py @ 21645:7eb156f30b61
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 01 Jun 2015 22:13:10 +0200 |
parents | 57912478d94d |
children | 8d0c2aabfc2d |
comparison
equal
deleted
inserted
replaced
21644:2c6802ac343c | 21645:7eb156f30b61 |
---|---|
52 'client' : None, # normal compilation with client compiler, explicit compilation (e.g., by Truffle) with Graal | 52 'client' : None, # normal compilation with client compiler, explicit compilation (e.g., by Truffle) with Graal |
53 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted | 53 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted |
54 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted | 54 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted |
55 'original' : None, # default VM copied from bootstrap JDK | 55 'original' : None, # default VM copied from bootstrap JDK |
56 'graal' : None, # alias for jvmci | 56 'graal' : None, # alias for jvmci |
57 'server-nograal' : None, # alias for server-nojvmci | |
58 'client-nograal' : None, # alias for client-nojvmci | |
57 } | 59 } |
58 | 60 |
59 """ The VM that will be run by the 'vm' command and built by default by the 'build' command. | 61 """ The VM that will be run by the 'vm' command and built by default by the 'build' command. |
60 This can be set via the global '--vm' option or the DEFAULT_VM environment variable. | 62 This can be set via the global '--vm' option or the DEFAULT_VM environment variable. |
61 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ | 63 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ |
119 global _vm | 121 global _vm |
120 if _vm: | 122 if _vm: |
121 return _vm | 123 return _vm |
122 vm = mx.get_env('DEFAULT_VM') | 124 vm = mx.get_env('DEFAULT_VM') |
123 envPath = join(_graal_home, 'mx', 'env') | 125 envPath = join(_graal_home, 'mx', 'env') |
124 if vm == 'graal': | 126 if vm and 'graal' in vm: |
125 if exists(envPath): | 127 if exists(envPath): |
126 with open(envPath) as fp: | 128 with open(envPath) as fp: |
127 if 'DEFAULT_VM=graal' in fp.read(): | 129 if 'DEFAULT_VM=' + vm in fp.read(): |
128 mx.log('Please update the DEFAULT_VM entry in ' + envPath + ' to use "jvmci" instead of "graal" as the value') | 130 mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "graal" with "jvmci"') |
129 vm = 'jvmci' | 131 vm = vm.replace('graal', 'jvmci') |
130 if vm is None: | 132 if vm is None: |
131 if not mx.is_interactive(): | 133 if not mx.is_interactive(): |
132 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') | 134 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') |
133 mx.log('Please select the VM to be executed from the following: ') | 135 mx.log('Please select the VM to be executed from the following: ') |
134 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] | 136 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] |
553 types available in 'classpath' implementing or extending | 555 types available in 'classpath' implementing or extending |
554 com.oracle.jvmci.service.Service. | 556 com.oracle.jvmci.service.Service. |
555 """ | 557 """ |
556 _, binDir = mx._compile_mx_class('FilterTypes', os.pathsep.join(classpath), myDir=dirname(__file__)) | 558 _, binDir = mx._compile_mx_class('FilterTypes', os.pathsep.join(classpath), myDir=dirname(__file__)) |
557 cmd = [mx.java().java, '-cp', mx._cygpathU2W(os.pathsep.join([binDir] + classpath)), 'FilterTypes', 'com.oracle.jvmci.service.Service'] + serviceImplNames | 559 cmd = [mx.java().java, '-cp', mx._cygpathU2W(os.pathsep.join([binDir] + classpath)), 'FilterTypes', 'com.oracle.jvmci.service.Service'] + serviceImplNames |
558 services = subprocess.check_output(cmd, stderr=subprocess.PIPE) | 560 services = subprocess.check_output(cmd) |
559 if len(services) == 0: | 561 if len(services) == 0: |
560 return [] | 562 return [] |
561 return services.split('|') | 563 return services.split('|') |
562 | 564 |
563 def _extractJVMCIFiles(jdkJars, jvmciJars, servicesDir, optionsDir, cleanDestination=True): | 565 def _extractJVMCIFiles(jdkJars, jvmciJars, servicesDir, optionsDir, cleanDestination=True): |
1294 | 1296 |
1295 def harness(projectsCp, vmArgs): | 1297 def harness(projectsCp, vmArgs): |
1296 if _get_vm() != 'jvmci': | 1298 if _get_vm() != 'jvmci': |
1297 prefixArgs = ['-esa', '-ea'] | 1299 prefixArgs = ['-esa', '-ea'] |
1298 else: | 1300 else: |
1299 prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea'] | 1301 prefixArgs = ['-XX:-BootstrapJVMCI', '-esa', '-ea'] |
1300 if gc_after_test: | 1302 if gc_after_test: |
1301 prefixArgs.append('-XX:-DisableExplicitGC') | 1303 prefixArgs.append('-XX:-DisableExplicitGC') |
1302 with open(testfile) as fp: | 1304 with open(testfile) as fp: |
1303 testclasses = [l.rstrip() for l in fp.readlines()] | 1305 testclasses = [l.rstrip() for l in fp.readlines()] |
1304 | 1306 |
1521 # None or a list of strings. If not None, only tasks whose title | 1523 # None or a list of strings. If not None, only tasks whose title |
1522 # matches at least one of the substrings in this list will return | 1524 # matches at least one of the substrings in this list will return |
1523 # a non-None value from __enter__. The body of a 'with Task(...) as t' | 1525 # a non-None value from __enter__. The body of a 'with Task(...) as t' |
1524 # statement should check 't' and exit immediately if it is None. | 1526 # statement should check 't' and exit immediately if it is None. |
1525 filters = None | 1527 filters = None |
1528 filtersExclude = False | |
1526 | 1529 |
1527 def __init__(self, title, tasks=None): | 1530 def __init__(self, title, tasks=None): |
1528 self.tasks = tasks | 1531 self.tasks = tasks |
1529 self.title = title | 1532 self.title = title |
1530 self.skipped = tasks is not None and Task.filters is not None and not any([f in title for f in Task.filters]) | 1533 if tasks is not None and Task.filters is not None: |
1534 if Task.filtersExclude: | |
1535 self.skipped = any([f in title for f in Task.filters]) | |
1536 else: | |
1537 self.skipped = not any([f in title for f in Task.filters]) | |
1538 else: | |
1539 self.skipped = False | |
1531 if not self.skipped: | 1540 if not self.skipped: |
1532 self.start = time.time() | 1541 self.start = time.time() |
1533 self.end = None | 1542 self.end = None |
1534 self.duration = None | 1543 self.duration = None |
1535 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title) | 1544 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title) |
1708 parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code') | 1717 parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code') |
1709 parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code') | 1718 parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code') |
1710 parser.add_argument('-i', '--omit-ide-clean', action='store_false', dest='cleanIde', help='omit cleaning the ide project files') | 1719 parser.add_argument('-i', '--omit-ide-clean', action='store_false', dest='cleanIde', help='omit cleaning the ide project files') |
1711 parser.add_argument('-g', '--only-build-jvmci', action='store_false', dest='buildNonJVMCI', help='only build the JVMCI VM') | 1720 parser.add_argument('-g', '--only-build-jvmci', action='store_false', dest='buildNonJVMCI', help='only build the JVMCI VM') |
1712 parser.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run') | 1721 parser.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run') |
1722 parser.add_argument('-x', action='store_true', help='makes --task-filter an exclusion instead of inclusion filter') | |
1713 parser.add_argument('--jacocout', help='specify the output directory for jacoco report') | 1723 parser.add_argument('--jacocout', help='specify the output directory for jacoco report') |
1714 | 1724 |
1715 args = parser.parse_args(args) | 1725 args = parser.parse_args(args) |
1716 | 1726 |
1717 global _jacoco | 1727 global _jacoco |
1718 if args.task_filter: | 1728 if args.task_filter: |
1719 Task.filters = args.task_filter.split(',') | 1729 Task.filters = args.task_filter.split(',') |
1730 Task.filtersExclude = args.x | |
1731 elif args.x: | |
1732 mx.abort('-x option cannot be used without --task-filter option') | |
1720 | 1733 |
1721 # Force | 1734 # Force |
1722 if not mx._opts.strict_compliance: | 1735 if not mx._opts.strict_compliance: |
1723 mx.log("[gate] forcing strict compliance") | 1736 mx.log("[gate] forcing strict compliance") |
1724 mx._opts.strict_compliance = True | 1737 mx._opts.strict_compliance = True |
2649 | 2662 |
2650 if _vmSourcesAvailable: | 2663 if _vmSourcesAvailable: |
2651 if hasattr(opts, 'vm') and opts.vm is not None: | 2664 if hasattr(opts, 'vm') and opts.vm is not None: |
2652 global _vm | 2665 global _vm |
2653 _vm = opts.vm | 2666 _vm = opts.vm |
2654 if _vm == 'graal': | 2667 _vm = _vm.replace('graal', 'jvmci') |
2655 _vm = 'jvmci' | |
2656 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: | 2668 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: |
2657 global _vmbuild | 2669 global _vmbuild |
2658 _vmbuild = opts.vmbuild | 2670 _vmbuild = opts.vmbuild |
2659 global _make_eclipse_launch | 2671 global _make_eclipse_launch |
2660 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) | 2672 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) |