Mercurial > hg > graal-compiler
annotate mx.graal/mx_graal_8.py @ 22903:217a942e3603
Update graal version
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Thu, 29 Oct 2015 17:26:07 +0100 |
parents | 9fed99d7f32d |
children | 1ba34f16d176 |
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 itertools |
9fed99d7f32d
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 import json |
9fed99d7f32d
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 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
|
34 |
9fed99d7f32d
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 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
|
36 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
|
37 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
|
38 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
|
39 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
|
40 |
9fed99d7f32d
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 from mx_unittest import unittest |
9fed99d7f32d
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 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
|
43 |
9fed99d7f32d
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 _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
|
45 |
9fed99d7f32d
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 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
|
47 """ |
9fed99d7f32d
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 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
|
49 """ |
9fed99d7f32d
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 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
|
51 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
|
52 # 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
|
53 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
|
54 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
|
55 # 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
|
56 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
|
57 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
|
58 |
9fed99d7f32d
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 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
|
60 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
|
61 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
|
62 |
9fed99d7f32d
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 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
|
64 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
|
65 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
|
66 |
9fed99d7f32d
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 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
|
68 """ |
9fed99d7f32d
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 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
|
70 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
|
71 """ |
9fed99d7f32d
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 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 |
9fed99d7f32d
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 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
|
89 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 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
|
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 |
9fed99d7f32d
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_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
|
99 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
|
100 |
9fed99d7f32d
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 def _run_benchmark(args, availableBenchmarks, runBenchmark): |
9fed99d7f32d
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 |
9fed99d7f32d
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 vmOpts, benchmarksAndOptions = mx.extract_VM_args(args, useDoubleDash=availableBenchmarks is 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
|
104 |
9fed99d7f32d
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 if availableBenchmarks is 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
|
106 harnessArgs = benchmarksAndOptions |
9fed99d7f32d
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 return runBenchmark(None, harnessArgs, vmOpts) |
9fed99d7f32d
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 |
9fed99d7f32d
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 if len(benchmarksAndOptions) == 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
|
110 mx.abort('at least one benchmark name or "all" must be specified') |
9fed99d7f32d
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 benchmarks = list(itertools.takewhile(lambda x: not x.startswith('-'), benchmarksAndOptions)) |
9fed99d7f32d
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 harnessArgs = benchmarksAndOptions[len(benchmarks):] |
9fed99d7f32d
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 |
9fed99d7f32d
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 if 'all' in benchmarks: |
9fed99d7f32d
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 benchmarks = availableBenchmarks |
9fed99d7f32d
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 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
|
117 for bm in benchmarks: |
9fed99d7f32d
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 if bm not in availableBenchmarks: |
9fed99d7f32d
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 mx.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(availableBenchmarks)) |
9fed99d7f32d
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 |
9fed99d7f32d
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 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
|
122 for bm in benchmarks: |
9fed99d7f32d
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 not runBenchmark(bm, harnessArgs, vmOpts): |
9fed99d7f32d
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 failed.append(bm) |
9fed99d7f32d
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 |
9fed99d7f32d
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 if len(failed) != 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
|
127 mx.abort('Benchmark failures: ' + str(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
|
128 |
9fed99d7f32d
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 def dacapo(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
|
130 """run one or more DaCapo benchmarks""" |
9fed99d7f32d
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 |
9fed99d7f32d
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 def launcher(bm, harnessArgs, extraVmOpts): |
9fed99d7f32d
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 return sanitycheck.getDacapo(bm, harnessArgs).test(get_vm(), extraVmOpts=extraVmOpts) |
9fed99d7f32d
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 |
9fed99d7f32d
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 _run_benchmark(args, sanitycheck.dacapoSanityWarmup.keys(), launcher) |
9fed99d7f32d
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 |
9fed99d7f32d
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 def scaladacapo(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
|
138 """run one or more Scala DaCapo benchmarks""" |
9fed99d7f32d
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 |
9fed99d7f32d
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 def launcher(bm, harnessArgs, extraVmOpts): |
9fed99d7f32d
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 return sanitycheck.getScalaDacapo(bm, harnessArgs).test(get_vm(), extraVmOpts=extraVmOpts) |
9fed99d7f32d
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 |
9fed99d7f32d
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 _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher) |
9fed99d7f32d
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 |
9fed99d7f32d
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 # 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
|
146 # 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
|
147 # 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
|
148 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
|
149 """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
|
150 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
|
151 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
|
152 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
|
153 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
|
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 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
|
156 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
|
157 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
|
158 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
|
159 |
9fed99d7f32d
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 # 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
|
161 containsF = 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
|
162 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
|
163 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
|
164 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
|
165 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
|
166 containsF = 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
|
167 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
|
168 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
|
169 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
|
170 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
|
171 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
|
172 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
|
173 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
|
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 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
|
176 # 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
|
177 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
|
178 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
|
179 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
|
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 # default to -f1 if not specified otherwise |
9fed99d7f32d
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 if not containsF: |
9fed99d7f32d
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 jmhArgs += ['-f1'] |
9fed99d7f32d
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 # 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
|
186 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
|
187 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
|
188 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
|
189 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
|
190 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
|
191 |
9fed99d7f32d
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 # 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
|
193 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
|
194 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
|
195 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
|
196 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
|
197 |
9fed99d7f32d
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 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
|
199 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
|
200 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
|
201 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
|
202 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
|
203 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
|
204 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
|
205 |
9fed99d7f32d
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 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
|
207 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
|
208 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
|
209 |
9fed99d7f32d
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 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
|
211 """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
|
212 |
9fed99d7f32d
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 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
|
214 |
9fed99d7f32d
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 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
|
216 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
|
217 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
|
218 |
9fed99d7f32d
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 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
|
220 |
9fed99d7f32d
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 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
|
222 # 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
|
223 # 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
|
224 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
|
225 |
9fed99d7f32d
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 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
236 # 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
|
237 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
|
238 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
239 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
|
240 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
|
241 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
|
242 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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 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
|
249 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
|
250 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
|
251 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
|
252 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
|
253 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
|
254 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
|
255 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
256 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
|
257 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
258 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
|
259 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
|
260 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
|
261 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
|
262 |
9fed99d7f32d
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 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
|
264 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
|
265 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
|
266 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
|
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 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
|
269 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
|
270 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
|
271 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
|
272 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
|
273 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
|
274 |
9fed99d7f32d
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 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
|
276 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
|
277 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
|
278 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
|
279 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
|
280 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
|
281 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
|
282 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
|
283 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
|
284 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
285 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
|
286 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
287 # 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
|
288 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
|
289 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
|
290 |
9fed99d7f32d
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 # 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
|
292 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
|
293 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
|
294 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
|
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 # 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
|
297 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
|
298 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
|
299 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
|
300 |
9fed99d7f32d
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 # 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
|
302 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
|
303 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
|
304 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
305 # 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
|
306 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
|
307 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
|
308 |
9fed99d7f32d
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 # 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
|
310 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
|
311 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
|
312 + 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
|
313 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
|
314 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
|
315 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
|
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 # 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
|
318 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
|
319 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
|
320 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
|
321 |
9fed99d7f32d
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 # 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
|
323 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
|
324 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
|
325 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
|
326 |
9fed99d7f32d
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 |
9fed99d7f32d
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 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
|
329 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
|
330 ] |
9fed99d7f32d
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 |
9fed99d7f32d
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 _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
|
333 |
9fed99d7f32d
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 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
|
335 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
|
336 BootstrapTest('BootstrapWithSystemAssertionsNoCoop', 'fastdebug', ['-esa', '-XX:-UseCompressedOops', '-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
|
337 BootstrapTest('BootstrapWithGCVecification', 'product', ['-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-G:+ExitVMOnException'], suppress=['VerifyAfterGC:', 'VerifyBeforeGC:']), |
9fed99d7f32d
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 BootstrapTest('BootstrapWithG1GCVecification', 'product', ['-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-G:+ExitVMOnException'], suppress=['VerifyAfterGC:', 'VerifyBeforeGC:']), |
9fed99d7f32d
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 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
|
340 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
|
341 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
|
342 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
|
343 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
|
344 ] |
9fed99d7f32d
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 |
9fed99d7f32d
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 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
|
347 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
|
348 |
9fed99d7f32d
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 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
|
350 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
|
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 def deoptalot(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
|
353 """bootstrap a VM with DeoptimizeALot and VerifyOops on |
9fed99d7f32d
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 |
9fed99d7f32d
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 the first argument is a number, the process will be repeated |
9fed99d7f32d
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 this number of times. All other arguments are passed to the 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
|
357 count = 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
|
358 if len(args) > 0 and args[0].isdigit(): |
9fed99d7f32d
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 count = int(args[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
|
360 del args[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
|
361 |
9fed99d7f32d
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 for _ in range(count): |
9fed99d7f32d
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 if not run_vm(['-XX:-TieredCompilation', '-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version']) == 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
|
364 mx.abort("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
|
365 |
9fed99d7f32d
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 def longtests(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
|
367 |
9fed99d7f32d
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 deoptalot(['15', '-Xmx48m']) |
9fed99d7f32d
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 |
9fed99d7f32d
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 dacapo(['100', 'eclipse', '-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
|
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 """ |
9fed99d7f32d
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 Extra benchmarks to run from 'bench()'. |
9fed99d7f32d
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 """ |
9fed99d7f32d
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 extraBenchmarks = [] |
9fed99d7f32d
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 |
9fed99d7f32d
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 def bench(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
|
378 """run benchmarks and parse their output for results |
9fed99d7f32d
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 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
380 Results are JSON formated : {group : {benchmark : score}}.""" |
9fed99d7f32d
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 resultFile = 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
|
382 if '-resultfile' in 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
|
383 index = args.index('-resultfile') |
9fed99d7f32d
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 if index + 1 < len(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
|
385 resultFile = args[index + 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
|
386 del args[index] |
9fed99d7f32d
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 del args[index] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
388 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
|
389 mx.abort('-resultfile must be followed by a file 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
|
390 resultFileCSV = 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
|
391 if '-resultfilecsv' in 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
|
392 index = args.index('-resultfilecsv') |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
393 if index + 1 < len(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
|
394 resultFileCSV = args[index + 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
|
395 del args[index] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
396 del args[index] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
397 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
|
398 mx.abort('-resultfilecsv must be followed by a file 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
|
399 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
|
400 if len(args) is 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
|
401 args = ['all'] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
402 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
403 vmArgs = [arg for arg in args if arg.startswith('-')] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
404 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
405 def benchmarks_in_group(group): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
406 prefix = group + ':' |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
407 return [a[len(prefix):] for a in args if a.startswith(prefix)] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
408 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
409 results = {} |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
410 benchmarks = [] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
411 # DaCapo |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
412 if 'dacapo' in args or 'all' in 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
|
413 benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
414 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
|
415 dacapos = benchmarks_in_group('dacapo') |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
416 for dacapo in dacapos: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
417 if dacapo not in sanitycheck.dacapoSanityWarmup.keys(): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
418 mx.abort('Unknown DaCapo : ' + dacapo) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
419 iterations = sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
420 if iterations > 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
|
421 benchmarks += [sanitycheck.getDacapo(dacapo, ['-n', str(iterations)])] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
422 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
423 if 'scaladacapo' in args or 'all' in 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
|
424 benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
425 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
|
426 scaladacapos = benchmarks_in_group('scaladacapo') |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
427 for scaladacapo in scaladacapos: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
428 if scaladacapo not in sanitycheck.dacapoScalaSanityWarmup.keys(): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
429 mx.abort('Unknown Scala DaCapo : ' + scaladacapo) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
430 iterations = sanitycheck.dacapoScalaSanityWarmup[scaladacapo][sanitycheck.SanityCheckLevel.Benchmark] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
431 if iterations > 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
|
432 benchmarks += [sanitycheck.getScalaDacapo(scaladacapo, ['-n', str(iterations)])] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
433 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
434 # Bootstrap |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
435 if 'bootstrap' in args or 'all' in 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
|
436 benchmarks += sanitycheck.getBootstraps() |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
437 # SPECjvm2008 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
438 if 'specjvm2008' in args or 'all' in 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
|
439 benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120'])] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
440 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
|
441 specjvms = benchmarks_in_group('specjvm2008') |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
442 for specjvm in specjvms: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
443 benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120', specjvm])] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
444 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
445 if 'specjbb2005' in args or 'all' in 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
|
446 benchmarks += [sanitycheck.getSPECjbb2005()] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
447 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
448 if 'specjbb2013' in args: # or 'all' in args //currently not in default set |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
449 benchmarks += [sanitycheck.getSPECjbb2013()] |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
450 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
451 if 'ctw-full' in 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
|
452 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.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
|
453 if 'ctw-noinline' in 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
|
454 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline)) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
455 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
456 for f in extraBenchmarks: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
457 f(args, vm, benchmarks) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
458 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
459 for test in benchmarks: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
460 for (groupName, res) in test.bench(vm, extraVmOpts=vmArgs).items(): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
461 group = results.setdefault(groupName, {}) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
462 group.update(res) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
463 mx.log(json.dumps(results)) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
464 if resultFile: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
465 with open(resultFile, 'w') as 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
|
466 f.write(json.dumps(results)) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
467 if resultFileCSV: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
468 with open(resultFileCSV, 'w') as 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
|
469 for key1, value1 in results.iteritems(): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
470 f.write('%s;\n' % (str(key1))) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
471 for key2, value2 in sorted(value1.iteritems()): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
472 f.write('%s; %s;\n' % (str(key2), str(value2))) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
473 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
474 def specjvm2008(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
|
475 """run one or more SPECjvm2008 benchmarks""" |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
476 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
477 def launcher(bm, harnessArgs, extraVmOpts): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
478 return sanitycheck.getSPECjvm2008(harnessArgs + [bm]).bench(get_vm(), extraVmOpts=extraVmOpts) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
479 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
480 availableBenchmarks = set(sanitycheck.specjvm2008Names) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
481 if "all" not in 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
|
482 # only add benchmark groups if we are not running "all" |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
483 for name in sanitycheck.specjvm2008Names: |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
484 parts = name.rsplit('.', 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
|
485 if len(parts) > 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
|
486 assert len(parts) == 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
|
487 group = parts[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
|
488 availableBenchmarks.add(group) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
489 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
490 _run_benchmark(args, sorted(availableBenchmarks), launcher) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
491 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
492 def specjbb2013(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
|
493 """run the composite SPECjbb2013 benchmark""" |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
494 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
495 def launcher(bm, harnessArgs, extraVmOpts): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
496 assert bm is 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
|
497 return sanitycheck.getSPECjbb2013(harnessArgs).bench(get_vm(), extraVmOpts=extraVmOpts) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
498 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
499 _run_benchmark(args, None, launcher) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
500 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
501 def specjbb2005(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
|
502 """run the composite SPECjbb2005 benchmark""" |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
503 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
504 def launcher(bm, harnessArgs, extraVmOpts): |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
505 assert bm is 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
|
506 return sanitycheck.getSPECjbb2005(harnessArgs).bench(get_vm(), extraVmOpts=extraVmOpts) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
507 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
508 _run_benchmark(args, None, launcher) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
509 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
510 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
|
511 """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
|
512 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
|
513 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
|
514 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
|
515 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
|
516 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
|
517 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
|
518 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
|
519 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
|
520 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
|
521 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
|
522 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
|
523 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
|
524 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
|
525 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
526 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
|
527 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
|
528 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
|
529 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
|
530 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
|
531 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
|
532 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
|
533 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
|
534 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
|
535 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
|
536 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
|
537 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
|
538 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
|
539 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
|
540 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
|
541 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
542 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
|
543 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
|
544 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
|
545 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
|
546 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
|
547 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
|
548 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
|
549 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
|
550 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
|
551 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
|
552 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
|
553 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
|
554 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
|
555 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
|
556 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
|
557 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
|
558 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
|
559 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
|
560 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
|
561 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
562 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
|
563 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
|
564 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
|
565 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
|
566 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
|
567 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
|
568 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
569 mx.update_commands(_suite, { |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
570 '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
|
571 'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo 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
|
572 'jdkartifactstats' : [jdkartifactstats, ''], |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
573 'scaladacapo': [scaladacapo, '[VM options] benchmarks...|"all" [Scala DaCapo 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
|
574 'specjvm2008': [specjvm2008, '[VM options] benchmarks...|"all" [SPECjvm2008 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
|
575 'specjbb2013': [specjbb2013, '[VM options] [-- [SPECjbb2013 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
|
576 'specjbb2005': [specjbb2005, '[VM options] [-- [SPECjbb2005 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
|
577 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
578 '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
|
579 'deoptalot' : [deoptalot, '[n]'], |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
580 'longtests' : [longtests, ''], |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
581 }) |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
582 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
583 |
9fed99d7f32d
made Graal work on a JDK9 image without needing the jvmci mx suite or extensions
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
584 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
|
585 add_bootclasspath_prepend(mx.distribution('truffle:TRUFFLE_API')) |