comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/BranchProfile.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 dc83cc1f94f2
children
comparison
equal deleted inserted replaced
22500:fbe1eb7b4172 22501:a63bda98cfdb
27 import com.oracle.truffle.api.CompilerDirectives; 27 import com.oracle.truffle.api.CompilerDirectives;
28 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; 28 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
29 import com.oracle.truffle.api.nodes.NodeCloneable; 29 import com.oracle.truffle.api.nodes.NodeCloneable;
30 30
31 /** 31 /**
32 * Utility class to speculate on branches to be never visited. If the {@link #enter()} method is 32 * @deprecated use {@link com.oracle.truffle.api.profiles.BranchProfile} instead
33 * invoked first the optimized code is invalidated and the branch where {@link #enter()} is invoked
34 * is enabled for compilation. Otherwise if the {@link #enter()} method was never invoked the branch
35 * will not get compiled.
36 *
37 * All {@code BranchProfile} instances must be held in {@code final} fields for compiler
38 * optimizations to take effect.
39 */ 33 */
34 @Deprecated
40 public final class BranchProfile extends NodeCloneable { 35 public final class BranchProfile extends NodeCloneable {
41 36
42 @CompilationFinal private boolean visited; 37 @CompilationFinal private boolean visited;
43 38
44 private BranchProfile() { 39 private BranchProfile() {
53 48
54 public boolean isVisited() { 49 public boolean isVisited() {
55 return visited; 50 return visited;
56 } 51 }
57 52
53 /**
54 * @deprecated use {@link com.oracle.truffle.api.profiles.BranchProfile#create()} instead
55 */
56 @Deprecated
58 public static BranchProfile create() { 57 public static BranchProfile create() {
59 return new BranchProfile(); 58 return new BranchProfile();
60 } 59 }
61 60
62 @Override 61 @Override