Class FieldAccessInstruction


  • public class FieldAccessInstruction
    extends IRInstruction
    A static or instance field load or store, distinguished by its AccessMode.
    • Method Detail

      • createLoad

        public static FieldAccessInstruction createLoad​(SSAValue result,
                                                        String owner,
                                                        String name,
                                                        String descriptor,
                                                        Value objectRef)
        Creates an instance field load.
        Parameters:
        result - the SSA value receiving the field value
        owner - the internal name of the declaring class
        name - the field name
        descriptor - the field descriptor
        objectRef - the receiver object
        Returns:
        the load instruction
      • createStaticLoad

        public static FieldAccessInstruction createStaticLoad​(SSAValue result,
                                                              String owner,
                                                              String name,
                                                              String descriptor)
        Creates a static field load.
        Parameters:
        result - the SSA value receiving the field value
        owner - the internal name of the declaring class
        name - the field name
        descriptor - the field descriptor
        Returns:
        the load instruction
      • createStore

        public static FieldAccessInstruction createStore​(String owner,
                                                         String name,
                                                         String descriptor,
                                                         Value objectRef,
                                                         Value value)
        Creates an instance field store.
        Parameters:
        owner - the internal name of the declaring class
        name - the field name
        descriptor - the field descriptor
        objectRef - the receiver object
        value - the value to store
        Returns:
        the store instruction
      • createStaticStore

        public static FieldAccessInstruction createStaticStore​(String owner,
                                                               String name,
                                                               String descriptor,
                                                               Value value)
        Creates a static field store.
        Parameters:
        owner - the internal name of the declaring class
        name - the field name
        descriptor - the field descriptor
        value - the value to store
        Returns:
        the store instruction
      • getMode

        public AccessMode getMode()
        Returns:
        the mode
      • getOwner

        public String getOwner()
        Returns:
        the owner
      • getName

        public String getName()
        Returns:
        the name
      • getDescriptor

        public String getDescriptor()
        Returns:
        the descriptor
      • isStatic

        public boolean isStatic()
        Returns:
        whether static
      • getObjectRef

        public Value getObjectRef()
        Returns:
        the object ref
      • getValue

        public Value getValue()
        Returns:
        the value
      • isLoad

        public boolean isLoad()
        Returns:
        true if this access is a load
      • isStore

        public boolean isStore()
        Returns:
        true if this access is a store
      • replaceOperand

        public void replaceOperand​(Value oldValue,
                                   Value newValue)
        Description copied from class: IRInstruction
        Replaces an operand value with a new value.
        Specified by:
        replaceOperand in class IRInstruction
        Parameters:
        oldValue - the value to replace
        newValue - the replacement value
      • accept

        public <T> T accept​(IRVisitor<T> visitor)
        Description copied from class: IRInstruction
        Accepts a visitor for this instruction.
        Specified by:
        accept in class IRInstruction
        Type Parameters:
        T - the return type
        Parameters:
        visitor - the visitor to accept
        Returns:
        the visitor result
      • copyWithNewOperands

        public IRInstruction copyWithNewOperands​(SSAValue newResult,
                                                 List<Value> newOperands)
        Description copied from class: IRInstruction
        Creates a copy of this instruction with new result and operands.
        Overrides:
        copyWithNewOperands in class IRInstruction
        Parameters:
        newResult - the new result value (may be null)
        newOperands - the new operand values
        Returns:
        a copy of this instruction, or null if copying not supported