Mercurial > hg > truffle
annotate pytools/commands.py @ 3692:4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
gl safeadd
gl vectorlib
Consolidated individual DaCapo commands into one 'dacapo' command.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 24 Nov 2011 13:19:40 +0100 |
parents | b054dd61bfe1 |
children | 60d31b1fada5 |
rev | line source |
---|---|
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 # commands.py - the default commands available to gl.py |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 # ---------------------------------------------------------------------------------------------------- |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 # Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 # This code is free software; you can redistribute it and/or modify it |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 # under the terms of the GNU General Public License version 2 only, as |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 # published by the Free Software Foundation. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 # This code is distributed in the hope that it will be useful, but WITHOUT |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 # version 2 for more details (a copy is included in the LICENSE file that |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 # accompanied this code). |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 # You should have received a copy of the GNU General Public License version |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 # 2 along with this work; if not, write to the Free Software Foundation, |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 # or visit www.oracle.com if you need additional information or have any |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 # questions. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 # |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 # ---------------------------------------------------------------------------------------------------- |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import os |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 from os.path import join, exists |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 from collections import Callable |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 def clean(env, args): |
3624
e81927755129
Removed targetting of JDK7G by gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
3623
diff
changeset
|
34 """cleans the GraalVM source tree""" |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 os.environ.update(ARCH_DATA_MODEL='64', LANG='C', HOTSPOT_BUILD_JOBS='16') |
3628
61f10abeb25a
Removed more vestiges of JDK7G build support.
Doug Simon <doug.simon@oracle.com>
parents:
3627
diff
changeset
|
36 env.run([env.gmake_cmd(), 'clean'], cwd=join(env.graal_home, 'make')) |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
38 def bootstrap(env, args): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
39 return env.run_vm(args + ['-version']) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
41 def _example(env, args, project, mainClass): |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
42 cp = env.mx().pdb().classpath(project) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
43 sharedArgs = ['-Xcomp', '-XX:CompileOnly=Main', mainClass] |
3691
b054dd61bfe1
Made gl script able to import and use the mx script.
Doug Simon <doug.simon@oracle.com>
parents:
3628
diff
changeset
|
44 |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
45 res = [] |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
46 print "=== Server VM ===" |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
47 res.append(env.run_vm(['-cp', cp,] + sharedArgs, vm="-server")) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
48 print "=== Graal VM ===" |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
49 res.append(env.run_vm(['-cp', cp, '-G:+PrintCompilation', '-G:-Extend', '-G:-Inline'] + sharedArgs)) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
50 print "=== Graal VM with extensions ===" |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
51 res.append(env.run_vm(['-cp', cp, '-G:+PrintCompilation', '-G:+Extend', '-G:-Inline'] + sharedArgs)) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
52 |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
53 if len([x for x in res if x != 0]) != 0: |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
54 return 1 |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
55 return 0 |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
57 def safeadd(env, args): |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
58 """run the SafeAdd example""" |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
59 return _example(env, args, 'com.oracle.max.graal.examples.safeadd', 'com.oracle.max.graal.examples.safeadd.Main') |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
61 def vectorlib(env, args): |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
62 """run the VectorLib example""" |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
63 return _example(env, args, 'com.oracle.max.graal.examples.vectorlib', 'com.oracle.max.graal.examples.vectorlib.Main') |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
64 |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
65 def dacapo(env, args): |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
66 """run a DaCapo benchmark""" |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
67 |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
68 benchmarks = { |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
69 'avrora': ['--preserve', '-n', '20'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
70 'batik': ['-n', '20'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
71 'eclipse': ['-n', '20'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
72 'fop': ['-n', '100'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
73 'h2': ['-n', '10'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
74 'jython': ['-n', '10'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
75 'lusearch': ['-n', '5'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
76 'pmd': ['-n', '10'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
77 'tradebeans': ['-n', '20'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
78 'xalan': ['-n', '20'], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
79 } |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
80 |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
81 if len(args) == 0: |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
82 env.abort('which benchmark?\nselect one of: ' + str(benchmarks.keys())) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
83 bm = args[0] |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
84 config = benchmarks.get(bm) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
85 if (config is None): |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
86 env.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(benchmarks.keys())) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
87 args = args[1:] |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
88 return env.run_dacapo(args + ['Harness'] + config + [bm]) |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
89 |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
90 def tests(env, args): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
91 """run a selection of the Maxine JTT tests in Graal""" |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 def jtt(name): |
3623 | 94 return join(env.maxine, 'com.oracle.max.vm', 'test', 'jtt', name) |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
96 return env.run_vm(args + ['-ea', '-esa', '-Xcomp', '-XX:+PrintCompilation', '-XX:CompileOnly=jtt'] + args + |
3623 | 97 ['-Xbootclasspath/p:' + join(env.maxine, 'com.oracle.max.vm', 'bin'), |
98 '-Xbootclasspath/p:' + join(env.maxine, 'com.oracle.max.base', 'bin'), | |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 'test.com.sun.max.vm.compiler.JavaTester', |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 '-verbose=1', '-gen-run-scheme=false', '-run-scheme-package=all', |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 jtt('bytecode'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 jtt('except'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 jtt('jdk'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 jtt('hotpath'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
105 jtt('jdk'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
106 jtt('lang'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
107 jtt('loop'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
108 jtt('micro'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 jtt('optimize'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
110 jtt('reflect'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
111 jtt('threads'), |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
112 jtt('hotspot')]) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
113 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
114 def help_(env, args): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
115 """show help for a given command |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
116 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
117 With no arguments, print a list of commands and short help for each command. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
118 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
119 Given a command name, print help for that command.""" |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
120 if len(args) == 0: |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
121 env.print_help() |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
122 return |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
123 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
124 name = args[0] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
125 if not table.has_key(name): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
126 env.error('unknown command: ' + name) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
127 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
128 value = table[name] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
129 (func, usage) = value[:2] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
130 doc = func.__doc__ |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
131 if len(value) > 2: |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
132 docArgs = value[2:] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
133 fmtArgs = [] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
134 for d in docArgs: |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
135 if isinstance(d, Callable): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
136 fmtArgs += [d(env)] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
137 else: |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
138 fmtArgs += [str(d)] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
139 doc = doc.format(*fmtArgs) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
140 print 'gl {0} {1}\n\n{2}\n'.format(name, usage, doc) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
141 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
142 def make(env, args): |
3624
e81927755129
Removed targetting of JDK7G by gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
3623
diff
changeset
|
143 """builds the GraalVM binary""" |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
144 |
3623 | 145 def fix_jvm_cfg(env, jdk): |
146 jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg') | |
147 found = False | |
3627
c773cc740d4a
Improved error messages in gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
3625
diff
changeset
|
148 if not exists(jvmCfg): |
c773cc740d4a
Improved error messages in gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
3625
diff
changeset
|
149 env.abort(jvmCfg + ' does not exist') |
c773cc740d4a
Improved error messages in gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
3625
diff
changeset
|
150 |
3623 | 151 with open(jvmCfg) as f: |
152 for line in f: | |
153 if '-graal KNOWN' in line: | |
154 found = True | |
155 break | |
156 if not found: | |
157 env.log('Appending "-graal KNOWN" to ' + jvmCfg) | |
158 with open(jvmCfg, 'a') as f: | |
159 f.write('-graal KNOWN\n') | |
160 | |
161 fix_jvm_cfg(env, env.jdk7) | |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
162 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
163 if env.get_os() != 'windows': |
3625
019c1951cb04
fixes for build process
Michael Haupt <michael.haupt@oracle.com>
parents:
3624
diff
changeset
|
164 javaLink = join(env.graal_home, 'hotspot', 'java') |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
165 if not exists(javaLink): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
166 javaExe = join(env.jdk7, 'jre', 'bin', 'java') |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
167 env.log('Creating link: ' + javaLink + ' -> ' + javaExe) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
168 os.symlink(javaExe, javaLink) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
169 |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
170 graalVmDir = join(env.jdk7, 'jre', 'lib', 'amd64', 'graal') |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
171 if not exists(graalVmDir): |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
172 env.log('Creating Graal directory in JDK7: ' + graalVmDir) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
173 os.makedirs(graalVmDir) |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
174 |
3625
019c1951cb04
fixes for build process
Michael Haupt <michael.haupt@oracle.com>
parents:
3624
diff
changeset
|
175 os.environ.update(ARCH_DATA_MODEL='64', LANG='C', HOTSPOT_BUILD_JOBS='4', ALT_BOOTDIR=env.jdk7, INSTALL='y') |
3628
61f10abeb25a
Removed more vestiges of JDK7G build support.
Doug Simon <doug.simon@oracle.com>
parents:
3627
diff
changeset
|
176 env.run([env.gmake_cmd(), 'productgraal'], cwd=join(env.graal_home, 'make')) |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
177 |
3623 | 178 def vm(env, args): |
179 return env.run_vm(args) | |
180 | |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
181 # Table of commands in alphabetical order. |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
182 # Keys are command names, value are lists: [<function>, <usage msg>, <format args to doc string of function>...] |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
183 # If any of the format args are instances of Callable, then they are called with an 'env' are before being |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
184 # used in the call to str.format(). |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
185 # Extensions should update this table directly |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
186 table = { |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
187 'dacapo': [dacapo, 'benchmark [VM options]'], |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
188 'bootstrap': [bootstrap, ''], |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
189 'clean': [clean, ''], |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
190 'help': [help_, '[command]'], |
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
191 'make': [make, ''], |
3692
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
192 'safeadd': [safeadd, ''], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
193 'tests': [tests, ''], |
4a76e44544d9
Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents:
3691
diff
changeset
|
194 'vectorlib': [vectorlib, ''], |
3623 | 195 'vm': [vm, ''], |
3607
de066dcbf607
Added Python scripts in new 'shell' project. The shell/commands.py script should replace all the existing run*.sh scripts in the top level Graal directory and is where new commands should go.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
196 } |