# HG changeset patch # User Chris Seaton # Date 1390155522 0 # Node ID 29a6cb0783de5a108ecdc701f6a6b49b2e608ff2 # Parent 72f85504e79e5b9fc022a73c08c5d1c959f0b772 Allow TruffleOptions to be set using system properties. diff -r 72f85504e79e -r 29a6cb0783de graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Fri Jan 17 23:16:59 2014 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Sun Jan 19 18:18:42 2014 +0000 @@ -32,31 +32,53 @@ */ public class TruffleOptions { - /** Enables/disables the rewriting of traces in the truffle runtime to stdout. */ - public static boolean TraceRewrites = false; + /** + * Enables/disables the rewriting of traces in the truffle runtime to stdout. + *

+ * Can be set with {@code -Dtruffle.TraceRewrites=true}. + */ + public static boolean TraceRewrites = Boolean.getBoolean("truffle.TraceRewrites"); /** * Enables the generation of detailed rewrite reasons. Enabling this may introduce some overhead * for rewriting nodes. + *

+ * Can be set with {@code -Dtruffle.DetailedRewriteReasons=true}. */ - public static final boolean DetailedRewriteReasons = false; + public static final boolean DetailedRewriteReasons = Boolean.getBoolean("truffle.DetailedRewriteReasons"); /** * Filters rewrites that do not contain the given string in the qualified name of the source or * target class hierarchy. + *

+ * Can be set with {@code -Dtruffle.TraceRewritesFilterClass=name}. */ - public static String TraceRewritesFilterClass = null; + public static String TraceRewritesFilterClass = System.getProperty("truffle.TraceRewritesFilterClass"); /** * Filters rewrites which does not contain the {@link Kind} in its source {@link NodeInfo}. If * no {@link NodeInfo} is defined the element is filtered if the filter value is set. + *

+ * Can be set with + * {@code -Dtruffle.TraceRewritesFilterFromKind=UNINITIALIZED|SPECIALIZED|POLYMORPHIC|GENERIC}. */ - public static NodeInfo.Kind TraceRewritesFilterFromKind = null; + public static NodeInfo.Kind TraceRewritesFilterFromKind = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterFromKind")); /** * Filters rewrites which does not contain the {@link Kind} in its target {@link NodeInfo}. If * no {@link NodeInfo} is defined the element is filtered if the filter value is set. + *

+ * Can be set with + * {@code -Dtruffle.TraceRewritesFilterToKind=UNINITIALIZED|SPECIALIZED|POLYMORPHIC|GENERIC}. */ - public static NodeInfo.Kind TraceRewritesFilterToKind = null; + public static NodeInfo.Kind TraceRewritesFilterToKind = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterToKind")); + + private static NodeInfo.Kind parseNodeInfoKind(String kind) { + if (kind == null) { + return null; + } + + return NodeInfo.Kind.valueOf(kind); + } }