Mercurial > hg > graal-compiler
changeset 14776:07dd21c7d533
revived use of FindBugs annotations
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 26 Mar 2014 22:19:33 +0100 |
parents | 40aa1eb176db |
children | 10c6700908ef |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StringSubstitutions.java mx/projects |
diffstat | 5 files changed, 22 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Mar 26 22:18:44 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Mar 26 22:19:33 2014 +0100 @@ -53,6 +53,8 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + public class CompilationTask implements Runnable, Comparable { private static final long TIMESTAMP_START = System.currentTimeMillis(); @@ -135,6 +137,7 @@ return entryBCI; } + @SuppressFBWarnings(value = "NN_NAKED_NOTIFY") public void run() { withinEnqueue.set(Boolean.FALSE); try {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Wed Mar 26 22:18:44 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Wed Mar 26 22:19:33 2014 +0100 @@ -44,22 +44,24 @@ import com.oracle.graal.options.*; import com.oracle.graal.replacements.nodes.*; +import edu.umd.cs.findbugs.annotations.*; + /** * This class contains infrastructure to maintain counters based on {@link DynamicCounterNode}s. The * infrastructure is enabled by specifying either the GenericDynamicCounters or * BenchmarkDynamicCounters option.<br/> - * + * * The counters are kept in a special area allocated for each native JavaThread object, and the * number of counters is configured using {@code -XX:GraalCounterSize=value}. * {@code -XX:+/-GraalCountersExcludeCompiler} configures whether to exclude compiler threads * (defaults to true). - * + * * The subsystems that use the logging need to have their own options to turn on the counters, and * insert DynamicCounterNodes when they're enabled. - * + * * Counters will be displayed as a rate (per second) if their group name starts with "~", otherwise * they will be displayed as a total number. - * + * * <h1>Example</h1> In order to create statistics about allocations within the DaCapo pmd benchmark * the following steps are necessary: * <ul> @@ -104,6 +106,7 @@ public static long[] delta; public static final ArrayList<AtomicLong> staticCounters = new ArrayList<>(); + @SuppressFBWarnings(value = "AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION", justification = "concurrent abstraction calls are in synchronized block") public static int getIndex(DynamicCounterNode counter) { if (!enabled) { throw new GraalInternalError("counter nodes shouldn't exist when counters are not enabled: " + counter.getGroup() + ", " + counter.getName());
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Wed Mar 26 22:18:44 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Wed Mar 26 22:19:33 2014 +0100 @@ -29,11 +29,13 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; +import edu.umd.cs.findbugs.annotations.*; + /** * Checks for illegal object constants in a graph processed for AOT compilation. The only legal * object constants are {@linkplain String#intern() interned} strings as they will be installed in * the Class Data Sharing (CDS) space. - * + * * @see LoadJavaMirrorWithKlassPhase */ public class AheadOfTimeVerificationPhase extends VerifyPhase<PhaseContext> { @@ -58,6 +60,7 @@ return isObject(node) && node.asConstant().asObject() == null; } + @SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "reference equality is what we want") private static boolean isInternedString(ConstantNode node) { if (!isObject(node)) { return false;
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StringSubstitutions.java Wed Mar 26 22:18:44 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StringSubstitutions.java Wed Mar 26 22:19:33 2014 +0100 @@ -30,6 +30,8 @@ import com.oracle.graal.graph.*; import com.oracle.graal.replacements.nodes.*; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + /** * Substitutions for {@link java.lang.String} methods. */ @@ -51,6 +53,7 @@ } @MethodSubstitution(isStatic = false) + @SuppressFBWarnings(value = "ES_COMPARING_PARAMETER_STRING_WITH_EQ", justification = "reference equality on the receiver is what we want") public static boolean equals(final String thisString, Object obj) { if (thisString == obj) { return true;
--- a/mx/projects Wed Mar 26 22:18:44 2014 +0100 +++ b/mx/projects Wed Mar 26 22:19:33 2014 +0100 @@ -13,6 +13,9 @@ library@CHECKSTYLE@path=lib/checkstyle-5.5-all.jar library@CHECKSTYLE@urls=jar:http://sourceforge.net/projects/checkstyle/files/checkstyle/5.5/checkstyle-5.5-bin.zip/download!/checkstyle-5.5/checkstyle-5.5-all.jar +library@FINDBUGS@path=lib/findbugs-3.0.0-dev-20131204-e3cbbd5.jar +library@FINDBUGS@urls=jar:http://sourceforge.net/projects/findbugs/files/findbugs/3.0.0/findbugs-3.0.0-dev-20131204-e3cbbd5.zip/download!/findbugs-3.0.0-dev-20131204-e3cbbd5/lib/findbugs.jar + library@DACAPO@path=lib/dacapo-9.12-bach.jar library@DACAPO@urls=http://softlayer.dl.sourceforge.net/project/dacapobench/9.12-bach/dacapo-9.12-bach.jar @@ -51,6 +54,7 @@ com.oracle.graal.hotspot.sparc,\ com.oracle.graal.hotspot,\ com.oracle.graal.hotspot.hsail +distribution@GRAAL@excludeDependencies=FINDBUGS # graal.api.runtime project@com.oracle.graal.api.runtime@subDir=graal @@ -234,7 +238,7 @@ # graal.graph project@com.oracle.graal.graph@subDir=graal project@com.oracle.graal.graph@sourceDirs=src -project@com.oracle.graal.graph@dependencies=com.oracle.graal.debug,com.oracle.graal.api.code +project@com.oracle.graal.graph@dependencies=com.oracle.graal.debug,com.oracle.graal.api.code,FINDBUGS project@com.oracle.graal.graph@javaCompliance=1.8 project@com.oracle.graal.graph@workingSets=Graal,Graph