Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/BranchProfile.java @ 18511:62aac33db669
Truffle: refactor NodeCloneable interface to abstract class
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 26 Nov 2014 01:06:38 +0100 |
parents | cb4d5cc2b52b |
children |
comparison
equal
deleted
inserted
replaced
18510:cb4d5cc2b52b | 18511:62aac33db669 |
---|---|
35 * will not get compiled. | 35 * will not get compiled. |
36 * | 36 * |
37 * All {@code BranchProfile} instances must be held in {@code final} fields for compiler | 37 * All {@code BranchProfile} instances must be held in {@code final} fields for compiler |
38 * optimizations to take effect. | 38 * optimizations to take effect. |
39 */ | 39 */ |
40 public final class BranchProfile implements NodeCloneable { | 40 public final class BranchProfile extends NodeCloneable { |
41 | 41 |
42 @CompilationFinal private boolean visited; | 42 @CompilationFinal private boolean visited; |
43 | 43 |
44 private BranchProfile() { | 44 private BranchProfile() { |
45 } | 45 } |
61 | 61 |
62 @Override | 62 @Override |
63 public String toString() { | 63 public String toString() { |
64 return String.format("%s(%s)@%x", getClass().getSimpleName(), visited ? "visited" : "not-visited", hashCode()); | 64 return String.format("%s(%s)@%x", getClass().getSimpleName(), visited ? "visited" : "not-visited", hashCode()); |
65 } | 65 } |
66 | |
67 @Override | |
68 public Object clone() { | |
69 try { | |
70 return super.clone(); | |
71 } catch (CloneNotSupportedException e) { | |
72 throw new AssertionError(e); | |
73 } | |
74 } | |
75 } | 66 } |