Class SourceValue

  • All Implemented Interfaces:
    Value

    public class SourceValue
    extends java.lang.Object
    implements Value
    A Value which keeps track of the bytecode instructions that can produce it.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Set<org.objectweb.asm.tree.AbstractInsnNode> insns
      The instructions that can produce this value.
      int size
      The size of this value, in 32 bits words.
    • Constructor Summary

      Constructors 
      Constructor Description
      SourceValue​(int size)
      Constructs a new SourceValue.
      SourceValue​(int size, java.util.Set<org.objectweb.asm.tree.AbstractInsnNode> insnSet)
      Constructs a new SourceValue.
      SourceValue​(int size, org.objectweb.asm.tree.AbstractInsnNode insnNode)
      Constructs a new SourceValue.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object value)  
      int getSize()
      Returns the size of this value.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • size

        public final int size
        The size of this value, in 32 bits words. This size is 1 for byte, boolean, char, short, int, float, object and array types, and 2 for long and double.
      • insns

        public final java.util.Set<org.objectweb.asm.tree.AbstractInsnNode> insns
        The instructions that can produce this value. For example, for the Java code below, the instructions that can produce the value of i at line 5 are the two ISTORE instructions at line 1 and 3:
         1: i = 0;
         2: if (...) {
         3:   i = 1;
         4: }
         5: return i;
         
    • Constructor Detail

      • SourceValue

        public SourceValue​(int size)
        Constructs a new SourceValue.
        Parameters:
        size - the size of this value, in 32 bits words. This size is 1 for byte, boolean, char, short, int, float, object and array types, and 2 for long and double.
      • SourceValue

        public SourceValue​(int size,
                           org.objectweb.asm.tree.AbstractInsnNode insnNode)
        Constructs a new SourceValue.
        Parameters:
        size - the size of this value, in 32 bits words. This size is 1 for byte, boolean, char, short, int, float, object and array types, and 2 for long and double.
        insnNode - an instruction that can produce this value.
      • SourceValue

        public SourceValue​(int size,
                           java.util.Set<org.objectweb.asm.tree.AbstractInsnNode> insnSet)
        Constructs a new SourceValue.
        Parameters:
        size - the size of this value, in 32 bits words. This size is 1 for byte, boolean, char, short, int, float, object and array types, and 2 for long and double.
        insnSet - the instructions that can produce this value.
    • Method Detail

      • getSize

        public int getSize()
        Returns the size of this value.
        Specified by:
        getSize in interface Value
        Returns:
        the size of this value, in 32 bits words. This size is 1 for byte, boolean, char, short, int, float, object and array types, and 2 for long and double.
      • equals

        public boolean equals​(java.lang.Object value)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object