annotate mx.graal/mx_graal_8.py @ 23184:ad619505dbd1

Update graal import.
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 14 Dec 2015 13:15:59 -0800
parents 274037591da2
children f35e653aa876
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 # ----------------------------------------------------------------------------------------------------
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 # This code is free software; you can redistribute it and/or modify it
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 # under the terms of the GNU General Public License version 2 only, as
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 # published by the Free Software Foundation.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 # This code is distributed in the hope that it will be useful, but WITHOUT
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 # version 2 for more details (a copy is included in the LICENSE file that
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 # accompanied this code).
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License version
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 # 2 along with this work; if not, write to the Free Software Foundation,
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 # or visit www.oracle.com if you need additional information or have any
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 # questions.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24 #
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 # ----------------------------------------------------------------------------------------------------
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 import os
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 from os.path import join, exists, basename
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 from argparse import ArgumentParser
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 import sanitycheck
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import re
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 import mx
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 from mx_jvmci import JvmciJDKDeployedDist, jdkDeployedDists, add_bootclasspath_prepend, buildvms, get_jvmci_jdk, run_vm, VM, relativeVmLibDirInJdk, isJVMCIEnabled
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 from mx_jvmci import get_vm as _jvmci_get_vm
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 from mx_gate import Task
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 from sanitycheck import _noneAsEmptyList
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 from mx_unittest import unittest
22952
1ba34f16d176 Factor out benchmarks from mx_graal_n.py and add specjbb2015
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22882
diff changeset
40 from mx_graal_bench import dacapo
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41 import mx_gate
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43 _suite = mx.suite('graal')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 def get_vm():
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 """
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 Gets the name of the currently selected JVM variant.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 """
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49 vm = _jvmci_get_vm()
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50 if isinstance(vm, VM):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
51 # mx_jvmci:9
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
52 return vm.jvmVariant
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54 # mx_jvmci:8
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
55 assert isinstance(vm, str)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56 return vm
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 class GraalJDKDeployedDist(JvmciJDKDeployedDist):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59 def __init__(self):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 JvmciJDKDeployedDist.__init__(self, 'GRAAL_HOTSPOT', compilers=['graal-economy', 'graal'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62 def deploy(self, jdkDir):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 JvmciJDKDeployedDist.deploy(self, jdkDir)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 self._updateGraalPropertiesFile(join(jdkDir, 'jre', 'lib'))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 def _updateGraalPropertiesFile(self, jreLibDir):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67 """
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
68 Updates (or creates) 'jreLibDir'/jvmci/graal.properties to set/modify the
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
69 graal.version property.
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
70 """
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 version = _suite.release_version()
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72 graalProperties = join(jreLibDir, 'jvmci', 'graal.properties')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 if not exists(graalProperties):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74 with open(graalProperties, 'w') as fp:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 print >> fp, 'graal.version=' + version
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
76 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
77 content = []
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78 with open(graalProperties) as fp:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
79 for line in fp:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
80 if line.startswith('graal.version='):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
81 content.append('graal.version=' + version)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
82 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
83 content.append(line.rstrip(os.linesep))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
84 with open(graalProperties, 'w') as fp:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
85 fp.write(os.linesep.join(content))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
86
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
87 jdkDeployedDists += [
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
88 JvmciJDKDeployedDist('GRAAL_NODEINFO'),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
89 JvmciJDKDeployedDist('GRAAL_API'),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
90 JvmciJDKDeployedDist('GRAAL_COMPILER'),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
91 JvmciJDKDeployedDist('GRAAL'),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
92 GraalJDKDeployedDist(),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
93 JvmciJDKDeployedDist('GRAAL_TRUFFLE'),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
94 JvmciJDKDeployedDist('GRAAL_TRUFFLE_HOTSPOT'),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
95 ]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
96
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
97 mx_gate.add_jacoco_includes(['com.oracle.graal.*'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
98 mx_gate.add_jacoco_excluded_annotations(['@Snippet', '@ClassSubstitution'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
99
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
100 # This is different than the 'jmh' commmand in that it
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
101 # looks for internal JMH benchmarks (i.e. those that
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
102 # depend on the JMH library).
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
103 def microbench(args):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
104 """run JMH microbenchmark projects"""
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
105 parser = ArgumentParser(prog='mx microbench', description=microbench.__doc__,
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
106 usage="%(prog)s [command options|VM options] [-- [JMH options]]")
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
107 parser.add_argument('--jar', help='Explicitly specify micro-benchmark location')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
108 known_args, args = parser.parse_known_args(args)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
109
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
110 vmArgs, jmhArgs = mx.extract_VM_args(args, useDoubleDash=True)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
111 if get_jvmci_jdk().javaCompliance < '9':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
112 if isJVMCIEnabled(get_vm()) and '-XX:-UseJVMCIClassLoader' not in vmArgs:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
113 vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
114
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
115 # look for -f in JMH arguments
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
116 forking = True
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
117 for i in range(len(jmhArgs)):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
118 arg = jmhArgs[i]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
119 if arg.startswith('-f'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
120 if arg == '-f' and (i+1) < len(jmhArgs):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
121 arg += jmhArgs[i+1]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
122 try:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
123 if int(arg[2:]) == 0:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
124 forking = False
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
125 except ValueError:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
126 pass
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
127
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
128 if known_args.jar:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
129 # use the specified jar
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
130 args = ['-jar', known_args.jar]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
131 if not forking:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
132 args += vmArgs
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
133 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
134 # find all projects with a direct JMH dependency
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
135 jmhProjects = []
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
136 for p in mx.projects_opt_limit_to_suites():
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
137 if 'JMH' in [x.name for x in p.deps]:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
138 jmhProjects.append(p.name)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
139 cp = mx.classpath(jmhProjects)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
140
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
141 # execute JMH runner
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
142 args = ['-cp', cp]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
143 if not forking:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
144 args += vmArgs
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
145 args += ['org.openjdk.jmh.Main']
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
146
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
147 if forking:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
148 jdk = get_jvmci_jdk()
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
149 jvm = get_vm()
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
150 def quoteSpace(s):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
151 if " " in s:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
152 return '"' + s + '"'
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
153 return s
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
154
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
155 forkedVmArgs = map(quoteSpace, jdk.parseVmArgs(vmArgs))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
156 args += ['--jvmArgsPrepend', ' '.join(['-' + jvm] + forkedVmArgs)]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
157 run_vm(args + jmhArgs)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
158
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
159 def ctw(args, extraVMarguments=None):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
160 """run CompileTheWorld"""
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
161
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
162 defaultCtwopts = '-Inline'
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
163
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
164 parser = ArgumentParser(prog='mx ctw')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
165 parser.add_argument('--ctwopts', action='store', help='space separated JVMCI options used for CTW compilations (default: --ctwopts="' + defaultCtwopts + '")', default=defaultCtwopts, metavar='<options>')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
166 parser.add_argument('--cp', '--jar', action='store', help='jar or class path denoting classes to compile', metavar='<path>')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
167
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
168 args, vmargs = parser.parse_known_args(args)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
169
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
170 if args.ctwopts:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
171 # Replace spaces with '#' since -G: options cannot contain spaces
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
172 # when they are collated in the "jvmci.options" system property
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
173 vmargs.append('-G:CompileTheWorldConfig=' + re.sub(r'\s+', '#', args.ctwopts))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
174
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
175 if args.cp:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
176 cp = os.path.abspath(args.cp)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
177 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
178 if get_jvmci_jdk().javaCompliance < '9':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
179 cp = join(get_jvmci_jdk().home, 'jre', 'lib', 'rt.jar')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
180 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
181 cp = join(get_jvmci_jdk().home, 'modules', 'java.base') + os.pathsep + \
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
182 join(get_jvmci_jdk().home, 'lib', 'modules', 'bootmodules.jimage')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
183 vmargs.append('-G:CompileTheWorldExcludeMethodFilter=sun.awt.X11.*.*')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
184
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
185 # suppress menubar and dock when running on Mac; exclude x11 classes as they may cause vm crashes (on Solaris)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
186 vmargs = ['-Djava.awt.headless=true'] + vmargs
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
187
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
188 vm = get_vm()
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
189 if get_jvmci_jdk().javaCompliance >= '9':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
190 jvmciMode = _jvmci_get_vm().jvmciMode
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
191 if jvmciMode == 'disabled':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
192 vmargs += ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + cp]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
193 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
194 if jvmciMode == 'jit':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
195 vmargs += ['-XX:+BootstrapJVMCI']
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
196 vmargs += ['-G:CompileTheWorldClasspath=' + cp, 'com.oracle.graal.hotspot.CompileTheWorld']
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
197 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
198 if isJVMCIEnabled(vm):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
199 if vm == 'jvmci':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
200 vmargs += ['-XX:+BootstrapJVMCI']
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
201 vmargs += ['-G:CompileTheWorldClasspath=' + cp, '-XX:-UseJVMCIClassLoader', 'com.oracle.graal.hotspot.CompileTheWorld']
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
202 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
203 vmargs += ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + cp]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
204
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
205 run_vm(vmargs + _noneAsEmptyList(extraVMarguments))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
206
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
207 class UnitTestRun:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
208 def __init__(self, name, args):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
209 self.name = name
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
210 self.args = args
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
211
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
212 def run(self, suites, tasks, extraVMarguments=None):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
213 for suite in suites:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
214 with Task(self.name + ': hosted-product ' + suite, tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
215 if t: unittest(['--suite', suite, '--enable-timing', '--verbose', '--fail-fast'] + self.args + _noneAsEmptyList(extraVMarguments))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
216
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
217 class BootstrapTest:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
218 def __init__(self, name, vmbuild, args, suppress=None):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
219 self.name = name
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
220 self.vmbuild = vmbuild
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
221 self.args = args
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
222 self.suppress = suppress
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
223
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
224 def run(self, tasks, extraVMarguments=None):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
225 with VM('jvmci', self.vmbuild):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
226 with Task(self.name + ':' + self.vmbuild, tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
227 if t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
228 if self.suppress:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
229 out = mx.DuplicateSuppressingStream(self.suppress).write
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
230 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
231 out = None
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
232 run_vm(self.args + _noneAsEmptyList(extraVMarguments) + ['-XX:-TieredCompilation', '-XX:+BootstrapJVMCI', '-version'], out=out)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
233
23095
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
234 class MicrobenchRun:
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
235 def __init__(self, name, args):
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
236 self.name = name
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
237 self.args = args
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
238
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
239 def run(self, tasks, extraVMarguments=None):
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
240 with Task(self.name + ': hosted-product ', tasks) as t:
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
241 if t: microbench(_noneAsEmptyList(extraVMarguments) + ['--'] + self.args)
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
242
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
243 def compiler_gate_runner(suites, unit_test_runs, bootstrap_tests, tasks, extraVMarguments=None):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
244
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
245 # Build server-hosted-jvmci now so we can run the unit tests
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
246 with Task('BuildHotSpotGraalHosted: product', tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
247 if t: buildvms(['--vms', 'server', '--builds', 'product'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
248
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
249 # Run unit tests on server-hosted-jvmci
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
250 with VM('server', 'product'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
251 for r in unit_test_runs:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
252 r.run(suites, tasks, extraVMarguments)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
253
23095
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
254 # Run microbench on server-hosted-jvmci (only for testing the JMH setup)
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
255 with VM('server', 'product'):
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
256 for r in [MicrobenchRun('Microbench', ['TestJMH'])]:
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
257 r.run(tasks, extraVMarguments)
cfb4dae8d566 gate: add check for verifying the jmh-runner setup.
Josef Eisl <josef.eisl@jku.at>
parents: 23074
diff changeset
258
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
259 # Run ctw against rt.jar on server-hosted-jvmci
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
260 with VM('server', 'product'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
261 with Task('CTW:hosted-product', tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
262 if t: ctw(['--ctwopts', '-Inline +ExitVMOnException', '-esa', '-G:+CompileTheWorldMultiThreaded', '-G:-InlineDuringParsing', '-G:-CompileTheWorldVerbose', '-XX:ReservedCodeCacheSize=300m'], _noneAsEmptyList(extraVMarguments))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
263
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
264 # Build the jvmci VMs so we can run the other tests
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
265 with Task('BuildHotSpotGraalOthers: fastdebug,product', tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
266 if t: buildvms(['--vms', 'jvmci', '--builds', 'fastdebug,product'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
267
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
268 # bootstrap tests
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
269 for b in bootstrap_tests:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
270 b.run(tasks, extraVMarguments)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
271
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
272 # run dacapo sanitychecks
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
273 for vmbuild in ['fastdebug', 'product']:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
274 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild, extraVmArguments=extraVMarguments) \
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
275 + sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild, extraVmArguments=extraVMarguments):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
276 with Task(str(test) + ':' + vmbuild, tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
277 if t and not test.test('jvmci'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
278 t.abort(test.name + ' Failed')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
279
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
280 # ensure -Xbatch still works
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
281 with VM('jvmci', 'product'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
282 with Task('DaCapo_pmd:BatchMode:product', tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
283 if t: dacapo(_noneAsEmptyList(extraVMarguments) + ['-Xbatch', 'pmd'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
284
23157
274037591da2 gate: test benchmark counters.
Josef Eisl <josef.eisl@jku.at>
parents: 23108
diff changeset
285 # ensure benchmark counters still work
274037591da2 gate: test benchmark counters.
Josef Eisl <josef.eisl@jku.at>
parents: 23108
diff changeset
286 with VM('jvmci', 'product'):
274037591da2 gate: test benchmark counters.
Josef Eisl <josef.eisl@jku.at>
parents: 23108
diff changeset
287 with Task('DaCapo_pmd:BenchmarkCounters:product', tasks) as t:
274037591da2 gate: test benchmark counters.
Josef Eisl <josef.eisl@jku.at>
parents: 23108
diff changeset
288 if t: dacapo(_noneAsEmptyList(extraVMarguments) + ['-G:+LIRProfileMoves', '-G:+GenericDynamicCounters', '-XX:JVMCICounterSize=10', 'pmd'])
274037591da2 gate: test benchmark counters.
Josef Eisl <josef.eisl@jku.at>
parents: 23108
diff changeset
289
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
290 # ensure -Xcomp still works
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
291 with VM('jvmci', 'product'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
292 with Task('XCompMode:product', tasks) as t:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
293 if t: run_vm(_noneAsEmptyList(extraVMarguments) + ['-Xcomp', '-version'])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
294
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
295
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
296 graal_unit_test_runs = [
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
297 UnitTestRun('UnitTests', []),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
298 ]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
299
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
300 _registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if mx.get_arch() == 'sparcv9' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14'
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
301
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
302 graal_bootstrap_tests = [
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
303 BootstrapTest('BootstrapWithSystemAssertions', 'fastdebug', ['-esa']),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
304 BootstrapTest('BootstrapWithSystemAssertionsNoCoop', 'fastdebug', ['-esa', '-XX:-UseCompressedOops', '-G:+ExitVMOnException']),
23108
319230b97faf fixed spelling
Doug Simon <doug.simon@oracle.com>
parents: 23095
diff changeset
305 BootstrapTest('BootstrapWithGCVerification', 'product', ['-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-G:+ExitVMOnException'], suppress=['VerifyAfterGC:', 'VerifyBeforeGC:']),
319230b97faf fixed spelling
Doug Simon <doug.simon@oracle.com>
parents: 23095
diff changeset
306 BootstrapTest('BootstrapWithG1GCVerification', 'product', ['-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-G:+ExitVMOnException'], suppress=['VerifyAfterGC:', 'VerifyBeforeGC:']),
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
307 BootstrapTest('BootstrapEconomyWithSystemAssertions', 'fastdebug', ['-esa', '-Djvmci.compiler=graal-economy', '-G:+ExitVMOnException']),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
308 BootstrapTest('BootstrapWithExceptionEdges', 'fastdebug', ['-esa', '-G:+StressInvokeWithExceptionNode', '-G:+ExitVMOnException']),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
309 BootstrapTest('BootstrapWithRegisterPressure', 'product', ['-esa', '-G:RegisterPressure=' + _registers, '-G:+ExitVMOnException']),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
310 BootstrapTest('BootstrapTraceRAWithRegisterPressure', 'product', ['-esa', '-G:+TraceRA', '-G:RegisterPressure=' + _registers, '-G:+ExitVMOnException']),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
311 BootstrapTest('BootstrapWithImmutableCode', 'product', ['-esa', '-G:+ImmutableCode', '-G:+VerifyPhases', '-G:+ExitVMOnException']),
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
312 ]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
313
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
314 def _graal_gate_runner(args, tasks):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
315 compiler_gate_runner(['graal'], graal_unit_test_runs, graal_bootstrap_tests, tasks, args.extra_vm_argument)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
316
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
317 mx_gate.add_gate_runner(_suite, _graal_gate_runner)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
318 mx_gate.add_gate_argument('--extra-vm-argument', action='append', help='add extra vm argument to gate tasks if applicable (multiple occurrences allowed)')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
319
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
320 def jdkartifactstats(args):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
321 """show stats about JDK deployed Graal artifacts"""
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
322 artifacts = {}
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
323 jdkDir = get_jvmci_jdk().home
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
324 def _getDeployedJars():
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
325 if get_jvmci_jdk().javaCompliance < '9':
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
326 for root, _, filenames in os.walk(join(jdkDir, 'jre', 'lib')):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
327 for f in filenames:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
328 if f.endswith('.jar') and not f.endswith('.stripped.jar'):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
329 yield join(root, f)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
330 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
331 for jdkDist in jdkDeployedDists:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
332 dist = jdkDist.dist()
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
333 if isinstance(jdkDist, JvmciJDKDeployedDist):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
334 yield dist.path
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
335
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
336 for jar in _getDeployedJars():
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
337 f = basename(jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
338 if 'truffle' in f:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
339 if 'enterprise' in f:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
340 artifacts.setdefault('GraalEnterpriseTruffle', []).append(jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
341 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
342 artifacts.setdefault('GraalTruffle', []).append(jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
343 elif 'enterprise' in f:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
344 artifacts.setdefault('GraalEnterprise', []).append(jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
345 elif 'jvmci' in f:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
346 artifacts.setdefault('JVMCI', []).append(jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
347 elif 'graal' in f:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
348 artifacts.setdefault('Graal', []).append(jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
349 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
350 mx.logv('ignored: ' + jar)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
351
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
352 print '{:>10} {:>10} {:>10} {}'.format('All', 'NoVars', 'None', 'Jar')
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
353 for category in sorted(artifacts.viewkeys()):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
354 jars = artifacts[category]
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
355 if jars:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
356 totals = (0, 0, 0)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
357 print
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
358 for j in jars:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
359 gSize = os.path.getsize(j)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
360 stripped = j[:-len('.jar')] + '.stripped.jar'
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
361 mx.run([mx.get_jdk().pack200, '--repack', '--quiet', '-J-Djava.util.logging.config.file=', '-DLocalVariableTypeTable=strip', '-DLocalVariableTable=strip', stripped, j])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
362 gLinesSourceSize = os.path.getsize(stripped)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
363 mx.run([mx.get_jdk().pack200, '--repack', '--quiet', '-J-Djava.util.logging.config.file=', '-G', stripped, j])
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
364 gNoneSize = os.path.getsize(stripped)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
365 os.remove(stripped)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
366 print '{:10,} {:10,} {:10,} {}:{}'.format(gSize, gLinesSourceSize, gNoneSize, category, basename(j))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
367 t1, t2, t3 = totals
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
368 totals = (t1 + gSize, t2 + gLinesSourceSize, t3 + gNoneSize)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
369 t1, t2, t3 = totals
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
370 print '{:10,} {:10,} {:10,} {}'.format(t1, t2, t3, category)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
371
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
372 jvmLib = join(jdkDir, relativeVmLibDirInJdk(), get_vm(), mx.add_lib_suffix(mx.add_lib_prefix('jvm')))
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
373 print
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
374 if exists(jvmLib):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
375 print '{:10,} {}'.format(os.path.getsize(jvmLib), jvmLib)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
376 else:
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
377 print '{:>10} {}'.format('<missing>', jvmLib)
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
378
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
379 mx.update_commands(_suite, {
22952
1ba34f16d176 Factor out benchmarks from mx_graal_n.py and add specjbb2015
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22882
diff changeset
380 'jdkartifactstats' : [jdkartifactstats, ''],
22882
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
381 'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'],
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
382 'microbench' : [microbench, '[VM options] [-- [JMH options]]'],
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
383 })
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
384
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
385
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
386 def mx_post_parse_cmd_line(opts):
9fed99d7f32d made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
387 add_bootclasspath_prepend(mx.distribution('truffle:TRUFFLE_API'))