diff truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/ValueProfile.java @ 22501:a63bda98cfdb

Extract profiles into separate package. Add isProfilingEnabled in TruffleRuntime to disable profiling in the default runtime; Add low overhead profiles for primitives; Add LoopConditionProfile; Profile footprint/threadsafety improvements; Make toString implementations more consistent; Greatly enhanced javadoc documentation for profiles; Deprecate old profiles
author Christian Humer <christian.humer@oracle.com>
date Wed, 16 Dec 2015 16:38:13 +0100
parents 71c7a1ae8829
children
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/ValueProfile.java	Wed Dec 16 12:31:17 2015 +0100
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/ValueProfile.java	Wed Dec 16 16:38:13 2015 +0100
@@ -27,51 +27,38 @@
 import com.oracle.truffle.api.nodes.NodeCloneable;
 
 /**
- * Utility class to speculate on certain properties of values.
- *
- * Example usage:
- *
- * <pre>
- * private final ValueProfile classProfile = ValueProfile.createClassProfile();
- *
- * return classProfile.profile(value);
- * </pre>
- *
- * All instances of {@code ValueProfile} (and subclasses) must be held in {@code final} fields for
- * compiler optimizations to take effect.
- *
- * @see #createPrimitiveProfile()
- * @see #createIdentityProfile()
- * @see #createClassProfile()
+ * @deprecated use {@link com.oracle.truffle.api.profiles.ValueProfile} instead
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public abstract class ValueProfile extends NodeCloneable {
 
     public abstract <T> T profile(T value);
 
     /**
-     * Returns a {@link PrimitiveValueProfile} that speculates on the primitive equality or object
-     * identity of a value.
+     * @deprecated use
+     *             {@link com.oracle.truffle.api.profiles.PrimitiveValueProfile#createEqualityProfile()}
+     *             instead
      */
+    @Deprecated
     public static PrimitiveValueProfile createPrimitiveProfile() {
         return new PrimitiveValueProfile();
     }
 
     /**
-     * Returns a {@link ValueProfile} that speculates on the exact class of a value. It will check
-     * the class of the profiled value and provide additional information to the compiler if only
-     * non-null values of exactly one concrete Java class are passed as a parameter to the
-     * {@link ValueProfile#profile} method. This can be beneficial if subsequent code can take
-     * advantage of knowing the concrete class of the value. The profile will degrade to the generic
-     * case if a null value or if at least two instances of two different Java classes are
-     * registered.
+     * @deprecated use {@link com.oracle.truffle.api.profiles.ValueProfile#createClassProfile()}
+     *             instead
      */
+    @Deprecated
     public static ValueProfile createClassProfile() {
         return new ExactClassValueProfile();
     }
 
     /**
-     * Returns a {@link ValueProfile} that speculates on the object identity of a value.
+     * @deprecated use {@link com.oracle.truffle.api.profiles.ValueProfile#createIdentityProfile()}
+     *             instead
      */
+    @Deprecated
     public static ValueProfile createIdentityProfile() {
         return new IdentityValueProfile();
     }