Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java @ 14816:836d558c3a5f
Create Baseline version of doBlock in LIRGenerator.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 19 Mar 2014 15:14:37 +0100 |
parents | c35d86f53ace |
children | 5d1308c78ddc |
rev | line source |
---|---|
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
11279
494b818b527c
Adding "Classpath" exception to the classes in the com.oracle.truffle.api and the com.oracle.truffle.api.dsl package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10690
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
494b818b527c
Adding "Classpath" exception to the classes in the com.oracle.truffle.api and the com.oracle.truffle.api.dsl package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10690
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
494b818b527c
Adding "Classpath" exception to the classes in the com.oracle.truffle.api and the com.oracle.truffle.api.dsl package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10690
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * accompanied this code). |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 * questions. |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 */ |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api; |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
26 |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 import com.oracle.truffle.api.nodes.*; |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 import com.oracle.truffle.api.nodes.NodeInfo.Kind; |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
30 /** |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 * Class containing general Truffle options. |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
32 */ |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 public class TruffleOptions { |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
34 |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
35 /** |
13874
c35d86f53ace
fix Truffle JavaDoc
Christian Wirth <christian.wirth@oracle.com>
parents:
13685
diff
changeset
|
36 * Enables/disables the rewriting of traces in the Truffle runtime to stdout. |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
37 * <p> |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
38 * Can be set with {@code -Dtruffle.TraceRewrites=true}. |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
39 */ |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
40 public static boolean TraceRewrites = Boolean.getBoolean("truffle.TraceRewrites"); |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
41 |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 /** |
10690
a0309f88306c
Added truffle option to enable detailed rewrite messages. Disabled by default.
Christian Humer <christian.humer@gmail.com>
parents:
10676
diff
changeset
|
43 * Enables the generation of detailed rewrite reasons. Enabling this may introduce some overhead |
a0309f88306c
Added truffle option to enable detailed rewrite messages. Disabled by default.
Christian Humer <christian.humer@gmail.com>
parents:
10676
diff
changeset
|
44 * for rewriting nodes. |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
45 * <p> |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
46 * Can be set with {@code -Dtruffle.DetailedRewriteReasons=true}. |
10690
a0309f88306c
Added truffle option to enable detailed rewrite messages. Disabled by default.
Christian Humer <christian.humer@gmail.com>
parents:
10676
diff
changeset
|
47 */ |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
48 public static final boolean DetailedRewriteReasons = Boolean.getBoolean("truffle.DetailedRewriteReasons"); |
10690
a0309f88306c
Added truffle option to enable detailed rewrite messages. Disabled by default.
Christian Humer <christian.humer@gmail.com>
parents:
10676
diff
changeset
|
49 |
a0309f88306c
Added truffle option to enable detailed rewrite messages. Disabled by default.
Christian Humer <christian.humer@gmail.com>
parents:
10676
diff
changeset
|
50 /** |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 * Filters rewrites that do not contain the given string in the qualified name of the source or |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 * target class hierarchy. |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
53 * <p> |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
54 * Can be set with {@code -Dtruffle.TraceRewritesFilterClass=name}. |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 */ |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
56 public static String TraceRewritesFilterClass = System.getProperty("truffle.TraceRewritesFilterClass"); |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
57 |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
58 /** |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
59 * Filters rewrites which does not contain the {@link Kind} in its source {@link NodeInfo}. If |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
60 * no {@link NodeInfo} is defined the element is filtered if the filter value is set. |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
61 * <p> |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
62 * Can be set with |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
63 * {@code -Dtruffle.TraceRewritesFilterFromKind=UNINITIALIZED|SPECIALIZED|POLYMORPHIC|GENERIC}. |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
64 */ |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
65 public static NodeInfo.Kind TraceRewritesFilterFromKind = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterFromKind")); |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
66 |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
67 /** |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
68 * Filters rewrites which does not contain the {@link Kind} in its target {@link NodeInfo}. If |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
69 * no {@link NodeInfo} is defined the element is filtered if the filter value is set. |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
70 * <p> |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
71 * Can be set with |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
72 * {@code -Dtruffle.TraceRewritesFilterToKind=UNINITIALIZED|SPECIALIZED|POLYMORPHIC|GENERIC}. |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
73 */ |
13685
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
74 public static NodeInfo.Kind TraceRewritesFilterToKind = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterToKind")); |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
75 |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
76 private static NodeInfo.Kind parseNodeInfoKind(String kind) { |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
77 if (kind == null) { |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
78 return null; |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
79 } |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
80 |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
81 return NodeInfo.Kind.valueOf(kind); |
29a6cb0783de
Allow TruffleOptions to be set using system properties.
Chris Seaton <chris.seaton@oracle.com>
parents:
11279
diff
changeset
|
82 } |
10590
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
83 |
6eb8d63cea34
Added a feature to trace rewrites of truffle nodes.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
84 } |