annotate pytools/commands.py @ 3713:d6a0c46a73b2

Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 13 Dec 2011 21:16:50 -0800
parents 60d31b1fada5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
3693
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
41 def example(env, args):
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
42 """run some or all Graal examples"""
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
43 examples = {
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
44 'safeadd': ['com.oracle.max.graal.examples.safeadd', 'com.oracle.max.graal.examples.safeadd.Main'],
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
45 'vectorlib': ['com.oracle.max.graal.examples.vectorlib', 'com.oracle.max.graal.examples.vectorlib.Main'],
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
46 }
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
47
3693
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
48 def run_example(env, verbose, project, mainClass):
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
49 cp = env.mx().pdb().classpath(project)
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
50 sharedArgs = ['-Xcomp', '-XX:CompileOnly=Main', mainClass]
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
51
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
52 res = []
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
53 env.log("=== Server VM ===")
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
54 printArg = '-XX:+PrintCompilation' if verbose else '-XX:-PrintCompilation'
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
55 res.append(env.run_vm(['-cp', cp, printArg] + sharedArgs, vm="-server"))
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
56 env.log("=== Graal VM ===")
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
57 printArg = '-G:+PrintCompilation' if verbose else '-G:-PrintCompilation'
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
58 res.append(env.run_vm(['-cp', cp, printArg, '-G:-Extend', '-G:-Inline'] + sharedArgs))
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
59 env.log("=== Graal VM with extensions ===")
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
60 res.append(env.run_vm(['-cp', cp, printArg, '-G:+Extend', '-G:-Inline'] + sharedArgs))
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
61
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
62 if len([x for x in res if x != 0]) != 0:
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
63 return 1
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
64 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
65
3693
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
66 verbose = False
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
67 if '-v' in args:
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
68 verbose = True
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
69 args = [a for a in args if a != '-v']
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
70
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
71 if len(args) == 0:
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
72 args = examples.keys()
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
73 for a in args:
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
74 config = examples.get(a)
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
75 if config is None:
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
76 env.log('unknown example: ' + a + ' {available examples = ' + str(examples.keys()) + '}')
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
77 else:
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
78 env.log('--------- ' + a + ' ------------')
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
79 project, mainClass = config
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
80 run_example(env, verbose, project, mainClass)
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
81
3692
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
82 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
83 """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
84
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
85 benchmarks = {
3713
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
86 'avrora': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
87 'batik': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
88 'eclipse': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
89 'fop': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
90 'h2': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
91 'jython': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
92 'luindex': ['-n', '5'],
3692
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
93 'lusearch': ['-n', '5'],
3713
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
94 'pmd': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
95 'sunflow': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
96 'tomcat': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
97 'tradebeans': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
98 'tradesoap': ['-n', '5'],
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
99 'xalan': ['-n', '5'],
3692
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
100 }
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
101
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
102 if len(args) == 0:
3713
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
103 args = args[0:]
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
104 for bm in benchmarks:
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
105 env.run_dacapo(args + ['Harness', '-n', '2'] + [bm])
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
106 return
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
107 else:
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
108 bm = args[0]
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
109 config = benchmarks.get(bm)
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
110 if (config is None):
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
111 env.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(benchmarks.keys()))
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
112 args = args[1:]
d6a0c46a73b2 Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3693
diff changeset
113 return env.run_dacapo(args + ['Harness'] + config + [bm])
3692
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
114
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
115 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
116 """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
117
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 def jtt(name):
3623
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
119 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
120
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 return env.run_vm(args + ['-ea', '-esa', '-Xcomp', '-XX:+PrintCompilation', '-XX:CompileOnly=jtt'] + args +
3623
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
122 ['-Xbootclasspath/p:' + join(env.maxine, 'com.oracle.max.vm', 'bin'),
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
123 '-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
124 '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
125 '-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
126 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
127 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
128 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
129 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
130 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
131 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
132 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
133 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
134 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
135 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
136 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
137 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
138
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 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
140 """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
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 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
143
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 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
145 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
146 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
147 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
148
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
149 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
150 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
151 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
152
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
153 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
154 (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
155 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
156 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
157 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
158 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
159 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
160 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
161 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
162 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
163 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
164 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
165 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
166
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 def make(env, args):
3624
e81927755129 Removed targetting of JDK7G by gl.py.
Doug Simon <doug.simon@oracle.com>
parents: 3623
diff changeset
168 """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
169
3623
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
170 def fix_jvm_cfg(env, jdk):
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
171 jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg')
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
172 found = False
3627
c773cc740d4a Improved error messages in gl.py.
Doug Simon <doug.simon@oracle.com>
parents: 3625
diff changeset
173 if not exists(jvmCfg):
c773cc740d4a Improved error messages in gl.py.
Doug Simon <doug.simon@oracle.com>
parents: 3625
diff changeset
174 env.abort(jvmCfg + ' does not exist')
c773cc740d4a Improved error messages in gl.py.
Doug Simon <doug.simon@oracle.com>
parents: 3625
diff changeset
175
3623
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
176 with open(jvmCfg) as f:
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
177 for line in f:
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
178 if '-graal KNOWN' in line:
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
179 found = True
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
180 break
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
181 if not found:
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
182 env.log('Appending "-graal KNOWN" to ' + jvmCfg)
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
183 with open(jvmCfg, 'a') as f:
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
184 f.write('-graal KNOWN\n')
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
185
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
186 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
187
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 if env.get_os() != 'windows':
3625
019c1951cb04 fixes for build process
Michael Haupt <michael.haupt@oracle.com>
parents: 3624
diff changeset
189 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
190 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
191 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
192 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
193 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
194
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
195 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
196 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
197 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
198 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
199
3625
019c1951cb04 fixes for build process
Michael Haupt <michael.haupt@oracle.com>
parents: 3624
diff changeset
200 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
201 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
202
3623
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
203 def vm(env, args):
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
204 return env.run_vm(args)
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
205
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
206 # 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
207 # 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
208 # 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
209 # 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
210 # 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
211 table = {
3692
4a76e44544d9 Made the safeadd and vectorlib examples runnable from the gl script:
Doug Simon <doug.simon@oracle.com>
parents: 3691
diff changeset
212 'dacapo': [dacapo, 'benchmark [VM options]'],
3693
60d31b1fada5 Improved interface to the examples in the gl script.
Doug Simon <doug.simon@oracle.com>
parents: 3692
diff changeset
213 'example': [example, '[-v] example names...'],
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
214 '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
215 '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
216 '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
217 '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
218 'tests': [tests, ''],
3623
3b2ab8970aa4 Improved gl.py script.
Doug Simon <doug.simon@oracle.com>
parents: 3607
diff changeset
219 '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
220 }