Mercurial > hg > graal-compiler
changeset 22087:ba177df8f5aa
added local SuppressFBWarnings annotation to replace findbugs-SuppressFBWarnings.jar dependency
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/SuppressFBWarnings.java Thu Jun 25 14:33:53 2015 +0200 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.compiler.common; + +/** + * Used to suppress <a href="http://findbugs.sourceforge.net">FindBugs</a> warnings. + */ +public @interface SuppressFBWarnings { + /** + * The set of FindBugs <a + * href="http://findbugs.sourceforge.net/bugDescriptions.html">warnings</a> that are to be + * suppressed in annotated element. The value can be a bug category, kind or pattern. + */ + String[] value(); + + /** + * Reason why the warning is suppressed. + */ + String justification(); +}
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Thu Jun 25 13:17:08 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Thu Jun 25 14:33:53 2015 +0200 @@ -22,20 +22,18 @@ */ package com.oracle.graal.hotspot.sparc; +import static jdk.internal.jvmci.sparc.SPARC.*; import jdk.internal.jvmci.code.*; import jdk.internal.jvmci.hotspot.*; import jdk.internal.jvmci.meta.*; -import static jdk.internal.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.asm.sparc.SPARCMacroAssembler.*; +import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.sparc.*; -import edu.umd.cs.findbugs.annotations.*; - /** * Emits a safepoint poll. */
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Thu Jun 25 13:17:08 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Thu Jun 25 14:33:53 2015 +0200 @@ -36,8 +36,6 @@ import com.oracle.graal.hotspot.replacements.*; import com.oracle.graal.nodes.debug.*; -import edu.umd.cs.findbugs.annotations.*; - //JaCoCo Exclude /**
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/ComputeInliningRelevance.java Thu Jun 25 13:17:08 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/ComputeInliningRelevance.java Thu Jun 25 14:33:53 2015 +0200 @@ -25,11 +25,10 @@ import java.util.*; import java.util.function.*; +import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import edu.umd.cs.findbugs.annotations.*; - public class ComputeInliningRelevance { private static final double EPSILON = 1d / Integer.MAX_VALUE; @@ -155,7 +154,7 @@ this.parent = parent; } - @SuppressFBWarnings("FE_FLOATING_POINT_EQUALITY") + @SuppressFBWarnings(value = "FE_FLOATING_POINT_EQUALITY", justification = "comparing against -1D is accurate") public double getFastPathMinProbability() { if (fastPathMinProbability == UNINITIALIZED) { fastPathMinProbability = Math.max(EPSILON, computeFastPathMinProbability(start)); @@ -167,7 +166,7 @@ * Computes the ratio between the probabilities of the current scope's entry point and the * parent scope's fastPathMinProbability. */ - @SuppressFBWarnings("FE_FLOATING_POINT_EQUALITY") + @SuppressFBWarnings(value = "FE_FLOATING_POINT_EQUALITY", justification = "comparing against -1D is accurate") public double getScopeRelevanceWithinParent() { if (scopeRelevanceWithinParent == UNINITIALIZED) { if (start instanceof LoopBeginNode) {
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Thu Jun 25 13:17:08 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Thu Jun 25 14:33:53 2015 +0200 @@ -30,6 +30,7 @@ import jdk.internal.jvmci.debug.*; import jdk.internal.jvmci.meta.*; +import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; @@ -37,8 +38,6 @@ import com.oracle.graal.nodes.memory.*; import com.oracle.graal.phases.*; -import edu.umd.cs.findbugs.annotations.*; - public final class SchedulePhase extends Phase { /**
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StringSubstitutions.java Thu Jun 25 13:17:08 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StringSubstitutions.java Thu Jun 25 14:33:53 2015 +0200 @@ -22,12 +22,11 @@ */ package com.oracle.graal.replacements; +import com.oracle.graal.compiler.common.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.replacements.nodes.*; -import edu.umd.cs.findbugs.annotations.*; - // JaCoCo Exclude /**
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCompiledNmethod.java Thu Jun 25 13:17:08 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCompiledNmethod.java Thu Jun 25 14:33:53 2015 +0200 @@ -23,7 +23,6 @@ package jdk.internal.jvmci.hotspot; import jdk.internal.jvmci.code.*; -import edu.umd.cs.findbugs.annotations.*; /** * {@link HotSpotCompiledCode} destined for installation as an nmethod. @@ -40,7 +39,7 @@ * May be set by VM if code installation fails. It will describe in more detail why installation * failed (e.g., exactly which dependency failed). */ - @SuppressFBWarnings("UWF_UNWRITTEN_FIELD") private String installationFailureMessage; + @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "set by the VM") private String installationFailureMessage; public HotSpotCompiledNmethod(HotSpotResolvedJavaMethod method, CompilationResult compResult) { this(method, compResult, 0L);
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotInstalledCode.java Thu Jun 25 13:17:08 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotInstalledCode.java Thu Jun 25 14:33:53 2015 +0200 @@ -25,7 +25,6 @@ import static jdk.internal.jvmci.common.UnsafeAccess.*; import jdk.internal.jvmci.code.*; import sun.misc.*; -import edu.umd.cs.findbugs.annotations.*; /** * Implementation of {@link InstalledCode} for HotSpot.
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotObjectConstantImpl.java Thu Jun 25 13:17:08 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotObjectConstantImpl.java Thu Jun 25 14:33:53 2015 +0200 @@ -27,7 +27,6 @@ import java.lang.invoke.*; import jdk.internal.jvmci.meta.*; -import edu.umd.cs.findbugs.annotations.*; /** * Represents a constant non-{@code null} object reference, within the compiler and across the
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/InitTimer.java Thu Jun 25 13:17:08 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/InitTimer.java Thu Jun 25 14:33:53 2015 +0200 @@ -23,7 +23,6 @@ package jdk.internal.jvmci.hotspot; import jdk.internal.jvmci.debug.*; -import edu.umd.cs.findbugs.annotations.*; /** * A facility for timing a step in the runtime initialization sequence. This exists separate from
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/SuppressFBWarnings.java Thu Jun 25 14:33:53 2015 +0200 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.jvmci.hotspot; + +/** + * Used to suppress <a href="http://findbugs.sourceforge.net">FindBugs</a> warnings. + */ +public @interface SuppressFBWarnings { + /** + * The set of FindBugs <a + * href="http://findbugs.sourceforge.net/bugDescriptions.html">warnings</a> that are to be + * suppressed in annotated element. The value can be a bug category, kind or pattern. + */ + String[] value(); + + /** + * Reason why the warning is suppressed. + */ + String justification(); +}
--- a/make/jvmci.make Thu Jun 25 13:17:08 2015 +0200 +++ b/make/jvmci.make Thu Jun 25 14:33:53 2015 +0200 @@ -147,7 +147,7 @@ JVMCI_API_JAR = $(TARGET)/jvmci-api.jar -JVMCI_API_DEP_JARS = $(TARGET)/jvmci-service.jar jvmci/findbugs-SuppressFBWarnings.jar +JVMCI_API_DEP_JARS = $(TARGET)/jvmci-service.jar EXPORTED_FILES += $(JVMCI_API_JAR) @@ -155,8 +155,6 @@ JVMCI_SERVICE_JAR = $(TARGET)/jvmci-service.jar -JVMCI_SERVICE_DEP_JARS = jvmci/findbugs-SuppressFBWarnings.jar - EXPORTED_FILES += $(JVMCI_SERVICE_JAR) JVMCI_HOTSPOT_SRC = $(shell find jvmci/jdk.internal.jvmci.hotspotvmconfig/src -type f 2> /dev/null) @@ -170,7 +168,7 @@ JVMCI_HOTSPOT_JAR = $(TARGET)/jvmci-hotspot.jar -JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/jvmci-api.jar $(TARGET)/jvmci-service.jar jvmci/findbugs-SuppressFBWarnings.jar +JVMCI_HOTSPOT_DEP_JARS = $(TARGET)/jvmci-api.jar $(TARGET)/jvmci-service.jar EXPORTED_FILES += $(JVMCI_HOTSPOT_JAR) @@ -192,8 +190,8 @@ $(call build_and_jar,$(JDK_INTERNAL_JVMCI_OPTIONS_PROCESSOR_JAR),$(subst $(space),:,$(JVMCI_API_DEP_JARS)),,$(JVMCI_API_JAR)) -$(JVMCI_SERVICE_JAR): $(JVMCI_SERVICE_SRC) $(JVMCI_SERVICE_DEP_JARS) - $(call build_and_jar,,$(subst $(space),:,$(JVMCI_SERVICE_DEP_JARS)),,$(JVMCI_SERVICE_JAR)) +$(JVMCI_SERVICE_JAR): $(JVMCI_SERVICE_SRC) + $(call build_and_jar,,$(subst $(space),:,),,$(JVMCI_SERVICE_JAR)) $(JVMCI_HOTSPOT_JAR): $(JVMCI_HOTSPOT_SRC) $(JDK_INTERNAL_JVMCI_HOTSPOTVMCONFIG_PROCESSOR_JAR) $(JDK_INTERNAL_JVMCI_OPTIONS_PROCESSOR_JAR) $(JDK_INTERNAL_JVMCI_SERVICE_PROCESSOR_JAR) $(JVMCI_HOTSPOT_DEP_JARS)
--- a/mx.graal/suite.py Thu Jun 25 13:17:08 2015 +0200 +++ b/mx.graal/suite.py Thu Jun 25 14:33:53 2015 +0200 @@ -32,11 +32,6 @@ "sha1" : "508bcd26a4d7c4c44048990c6ea789a3b11a62dc", }, - "FINDBUGS" : { - "path" : "jvmci/findbugs-SuppressFBWarnings.jar", - "sha1" : "fb78822d27c68fabf2cb2e5e573b3cdb5f9cae2d", - }, - "DACAPO" : { "path" : "lib/dacapo-9.12-bach.jar", "urls" : [ @@ -304,7 +299,6 @@ "sourceDirs" : ["src"], "dependencies" : [ "jdk.internal.jvmci.hotspotvmconfig", - "FINDBUGS", "jdk.internal.jvmci.runtime", "jdk.internal.jvmci.common", "jdk.internal.jvmci.compiler", @@ -570,7 +564,6 @@ "com.oracle.graal.compiler.common", "com.oracle.graal.api.collections", "com.oracle.graal.api.runtime", - "FINDBUGS", ], "javaCompliance" : "1.8", "annotationProcessors" : ["com.oracle.graal.nodeinfo.processor"], @@ -1144,7 +1137,6 @@ "subDir" : "jvmci", "sourcesPath" : "build/jvmci-service.src.zip", "dependencies" : ["jdk.internal.jvmci.service"], - "exclude" : ["FINDBUGS"], }, "JVMCI_API" : { @@ -1157,7 +1149,6 @@ "jdk.internal.jvmci.common", "jdk.internal.jvmci.debug", ], - "exclude" : ["FINDBUGS"], "distDependencies" : [ "JVMCI_SERVICE", ], @@ -1187,7 +1178,6 @@ "com.oracle.graal.hotspot", "com.oracle.graal.printer", ], - "exclude" : ["FINDBUGS"], "distDependencies" : [ "JVMCI_API", "JVMCI_SERVICE", @@ -1215,7 +1205,6 @@ "com.oracle.graal.truffle.hotspot.amd64", "com.oracle.graal.truffle.hotspot.sparc" ], - "exclude" : ["FINDBUGS"], "distDependencies" : [ "GRAAL", "TRUFFLE",