# HG changeset patch # User Lukas Stadler # Date 1423845867 -3600 # Node ID 5ea169a3bf81ef9e714f8df187d6b2b10f4561cb # Parent 26777392b971321765dd11d97690949049f2a300 make various fields final diff -r 26777392b971 -r 5ea169a3bf81 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java Fri Feb 13 16:45:42 2015 +0100 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java Fri Feb 13 17:44:27 2015 +0100 @@ -94,7 +94,7 @@ throw GraalInternalError.shouldNotReachHere("can't read values of illegal stamp"); } - private static IllegalStamp instance = new IllegalStamp(); + private static final IllegalStamp instance = new IllegalStamp(); static IllegalStamp getInstance() { return instance; diff -r 26777392b971 -r 5ea169a3bf81 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java Fri Feb 13 16:45:42 2015 +0100 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java Fri Feb 13 17:44:27 2015 +0100 @@ -112,7 +112,7 @@ throw GraalInternalError.shouldNotReachHere("void stamp has no value"); } - private static VoidStamp instance = new VoidStamp(); + private static final VoidStamp instance = new VoidStamp(); static VoidStamp getInstance() { return instance; diff -r 26777392b971 -r 5ea169a3bf81 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchProcessor.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchProcessor.java Fri Feb 13 16:45:42 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchProcessor.java Fri Feb 13 17:44:27 2015 +0100 @@ -74,7 +74,7 @@ } } - private static Pattern tokenizer = Pattern.compile("\\s*([()=]|[A-Za-z][A-Za-z0-9]*)\\s*"); + private static final Pattern tokenizer = Pattern.compile("\\s*([()=]|[A-Za-z][A-Za-z0-9]*)\\s*"); private class RuleParser { private ArrayList capturedTypes = new ArrayList<>(); diff -r 26777392b971 -r 5ea169a3bf81 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java Fri Feb 13 16:45:42 2015 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java Fri Feb 13 17:44:27 2015 +0100 @@ -29,7 +29,7 @@ */ public class DebugValueMap { - private static List topLevelMaps = new ArrayList<>(); + private static final List topLevelMaps = new ArrayList<>(); private long[] values; private List children; diff -r 26777392b971 -r 5ea169a3bf81 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java Fri Feb 13 16:45:42 2015 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java Fri Feb 13 17:44:27 2015 +0100 @@ -29,12 +29,12 @@ */ public class KeyRegistry { - private static Map keyMap = new HashMap<>(); - private static List debugValues = new ArrayList<>(); + private static final Map keyMap = new HashMap<>(); + private static final List debugValues = new ArrayList<>(); /** * Ensures a given debug value is registered. - * + * * @return the globally unique id for {@code value} */ public static synchronized int register(DebugValue value) { @@ -48,7 +48,7 @@ /** * Gets a immutable view of the registered debug values. - * + * * @return a list where {@code get(i).getIndex() == i} */ public static synchronized List getDebugValues() { diff -r 26777392b971 -r 5ea169a3bf81 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 Feb 13 16:45:42 2015 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Fri Feb 13 17:44:27 2015 +0100 @@ -38,14 +38,14 @@ *

* Can be set with {@code -Dtruffle.ForceInterpreter=true}. */ - public static boolean ForceInterpreter = Boolean.getBoolean("truffle.ForceInterpreter"); + public static final boolean ForceInterpreter = Boolean.getBoolean("truffle.ForceInterpreter"); /** * Enables/disables the rewriting of traces in the Truffle runtime to stdout. *

* Can be set with {@code -Dtruffle.TraceRewrites=true}. */ - public static boolean TraceRewrites; + public static final boolean TraceRewrites; /** * Enables the generation of detailed rewrite reasons. Enabling this may introduce some overhead @@ -97,20 +97,20 @@ } static { - final boolean[] values = {false, false}; + final boolean[] values = new boolean[3]; AccessController.doPrivileged(new PrivilegedAction() { public Void run() { - TraceRewrites = Boolean.getBoolean("truffle.TraceRewrites"); + values[0] = Boolean.getBoolean("truffle.TraceRewrites"); TraceRewritesFilterClass = System.getProperty("truffle.TraceRewritesFilterClass"); TraceRewritesFilterFromCost = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterFromCost")); TraceRewritesFilterToCost = parseNodeInfoKind(System.getProperty("truffle.TraceRewritesFilterToCost")); - values[0] = Boolean.getBoolean("truffle.DetailedRewriteReasons"); - values[1] = Boolean.getBoolean("truffle.TraceASTJSON"); + values[1] = Boolean.getBoolean("truffle.DetailedRewriteReasons"); + values[2] = Boolean.getBoolean("truffle.TraceASTJSON"); return null; } }); - - DetailedRewriteReasons = values[0]; - TraceASTJSON = values[1]; + TraceRewrites = values[0]; + DetailedRewriteReasons = values[1]; + TraceASTJSON = values[2]; } }