60 61 import java.util.Set; 62 63 import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode; 64 65 /** 66 * A {@link Value} that is represented by its type in a two types type system. 67 * This type system distinguishes the ONEWORD and TWOWORDS types. 68 * 69 * @author Eric Bruneton 70 */ 71 public class SourceValue implements Value { 72 73 /** 74 * The size of this value. 75 */ 76 public final int size; 77 78 /** 79 * The instructions that can produce this value. For example, for the Java 80 * code below, the instructions that can produce the value of <tt>i</tt> 81 * at line 5 are the txo ISTORE instructions at line 1 and 3: 82 * 83 * <pre> 84 * 1: i = 0; 85 * 2: if (...) { 86 * 3: i = 1; 87 * 4: } 88 * 5: return i; 89 * </pre> 90 * 91 * This field is a set of {@link AbstractInsnNode} objects. 92 */ 93 public final Set<AbstractInsnNode> insns; 94 95 public SourceValue(final int size) { 96 this(size, SmallSet.<AbstractInsnNode>emptySet()); 97 } 98 99 public SourceValue(final int size, final AbstractInsnNode insn) { 100 this.size = size; 101 this.insns = new SmallSet<AbstractInsnNode>(insn, null); 102 } 103 104 public SourceValue(final int size, final Set<AbstractInsnNode> insns) { 105 this.size = size; 106 this.insns = insns; 107 } 108 109 public int getSize() { 110 return size; 111 } 112 113 @Override 114 public boolean equals(final Object value) { 115 if (!(value instanceof SourceValue)) { 116 return false; | 60 61 import java.util.Set; 62 63 import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode; 64 65 /** 66 * A {@link Value} that is represented by its type in a two types type system. 67 * This type system distinguishes the ONEWORD and TWOWORDS types. 68 * 69 * @author Eric Bruneton 70 */ 71 public class SourceValue implements Value { 72 73 /** 74 * The size of this value. 75 */ 76 public final int size; 77 78 /** 79 * The instructions that can produce this value. For example, for the Java 80 * code below, the instructions that can produce the value of <tt>i</tt> at 81 * line 5 are the txo ISTORE instructions at line 1 and 3: 82 * 83 * <pre> 84 * 1: i = 0; 85 * 2: if (...) { 86 * 3: i = 1; 87 * 4: } 88 * 5: return i; 89 * </pre> 90 * 91 * This field is a set of {@link AbstractInsnNode} objects. 92 */ 93 public final Set<AbstractInsnNode> insns; 94 95 public SourceValue(final int size) { 96 this(size, SmallSet.<AbstractInsnNode> emptySet()); 97 } 98 99 public SourceValue(final int size, final AbstractInsnNode insn) { 100 this.size = size; 101 this.insns = new SmallSet<AbstractInsnNode>(insn, null); 102 } 103 104 public SourceValue(final int size, final Set<AbstractInsnNode> insns) { 105 this.size = size; 106 this.insns = insns; 107 } 108 109 public int getSize() { 110 return size; 111 } 112 113 @Override 114 public boolean equals(final Object value) { 115 if (!(value instanceof SourceValue)) { 116 return false; |