Mercurial > hg > truffle
changeset 19358:5ea169a3bf81
make various fields final
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Fri, 13 Feb 2015 17:44:27 +0100 |
parents | 26777392b971 |
children | afe80ca4b0f0 |
files | graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchProcessor.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java |
diffstat | 6 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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;
--- 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<TypeDescriptor> capturedTypes = new ArrayList<>();
--- 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<DebugValueMap> topLevelMaps = new ArrayList<>(); + private static final List<DebugValueMap> topLevelMaps = new ArrayList<>(); private long[] values; private List<DebugValueMap> children;
--- 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<String, Integer> keyMap = new HashMap<>(); - private static List<DebugValue> debugValues = new ArrayList<>(); + private static final Map<String, Integer> keyMap = new HashMap<>(); + private static final List<DebugValue> 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<DebugValue> getDebugValues() {
--- 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 @@ * <p> * 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. * <p> * 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<Void>() { 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]; } }