comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java @ 13685:29a6cb0783de

Allow TruffleOptions to be set using system properties.
author Chris Seaton <chris.seaton@oracle.com>
date Sun, 19 Jan 2014 18:18:42 +0000
parents 494b818b527c
children c35d86f53ace
comparison
equal deleted inserted replaced
13684:72f85504e79e 13685:29a6cb0783de
30 /** 30 /**
31 * Class containing general Truffle options. 31 * Class containing general Truffle options.
32 */ 32 */
33 public class TruffleOptions { 33 public class TruffleOptions {
34 34
35 /** Enables/disables the rewriting of traces in the truffle runtime to stdout. */ 35 /**
36 public static boolean TraceRewrites = false; 36 * Enables/disables the rewriting of traces in the truffle runtime to stdout.
37 * <p>
38 * Can be set with {@code -Dtruffle.TraceRewrites=true}.
39 */
40 public static boolean TraceRewrites = Boolean.getBoolean("truffle.TraceRewrites");
37 41
38 /** 42 /**
39 * Enables the generation of detailed rewrite reasons. Enabling this may introduce some overhead 43 * Enables the generation of detailed rewrite reasons. Enabling this may introduce some overhead
40 * for rewriting nodes. 44 * for rewriting nodes.
45 * <p>
46 * Can be set with {@code -Dtruffle.DetailedRewriteReasons=true}.
41 */ 47 */
42 public static final boolean DetailedRewriteReasons = false; 48 public static final boolean DetailedRewriteReasons = Boolean.getBoolean("truffle.DetailedRewriteReasons");
43 49
44 /** 50 /**
45 * Filters rewrites that do not contain the given string in the qualified name of the source or 51 * Filters rewrites that do not contain the given string in the qualified name of the source or
46 * target class hierarchy. 52 * target class hierarchy.
53 * <p>
54 * Can be set with {@code -Dtruffle.TraceRewritesFilterClass=name}.
47 */ 55 */
48 public static String TraceRewritesFilterClass = null; 56 public static String TraceRewritesFilterClass = System.getProperty("truffle.TraceRewritesFilterClass");
49 57
50 /** 58 /**
51 * Filters rewrites which does not contain the {@link Kind} in its source {@link NodeInfo}. If 59 * Filters rewrites which does not contain the {@link Kind} in its source {@link NodeInfo}. If
52 * no {@link NodeInfo} is defined the element is filtered if the filter value is set. 60 * no {@link NodeInfo} is defined the element is filtered if the filter value is set.
61 * <p>
62 * Can be set with
63 * {@code -Dtruffle.TraceRewritesFilterFromKind=UNINITIALIZED|SPECIALIZED|POLYMORPHIC|GENERIC}.
53 */ 64 */
54 public static NodeInfo.Kind TraceRewritesFilterFromKind = null; 65 public static NodeInfo.Kind TraceRewritesFilterFromKind = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterFromKind"));
55 66
56 /** 67 /**
57 * Filters rewrites which does not contain the {@link Kind} in its target {@link NodeInfo}. If 68 * Filters rewrites which does not contain the {@link Kind} in its target {@link NodeInfo}. If
58 * no {@link NodeInfo} is defined the element is filtered if the filter value is set. 69 * no {@link NodeInfo} is defined the element is filtered if the filter value is set.
70 * <p>
71 * Can be set with
72 * {@code -Dtruffle.TraceRewritesFilterToKind=UNINITIALIZED|SPECIALIZED|POLYMORPHIC|GENERIC}.
59 */ 73 */
60 public static NodeInfo.Kind TraceRewritesFilterToKind = null; 74 public static NodeInfo.Kind TraceRewritesFilterToKind = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterToKind"));
75
76 private static NodeInfo.Kind parseNodeInfoKind(String kind) {
77 if (kind == null) {
78 return null;
79 }
80
81 return NodeInfo.Kind.valueOf(kind);
82 }
61 83
62 } 84 }