Trait/Object

org.opalj.br.instructions

Instruction

Related Docs: object Instruction | package instructions

Permalink

trait Instruction extends AnyRef

Common superclass of all instructions.

Linear Supertypes
AnyRef, Any
Known Subclasses
AALOAD, AASTORE, ACONST_NULL, ALOAD, ALOAD_0, ALOAD_1, ALOAD_2, ALOAD_3, ALoadInstruction, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ASTORE_0, ASTORE_1, ASTORE_2, ASTORE_3, AStoreInstruction, ATHROW, AddInstruction, ArithmeticInstruction, ArrayAccessInstruction, ArrayLoadInstruction, ArrayStoreInstruction, BALOAD, BASTORE, BIPUSH, BinaryArithmeticInstruction, BitwiseInstruction, CALOAD, CASTORE, CHECKCAST, ComparisonInstruction, CompoundConditionalBranchInstruction, ConditionalBranchInstruction, ConstantLengthInstruction, ControlTransferInstruction, CreateNewArrayInstruction, CreateNewOneDimensionalArrayInstruction, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DConstInstruction, DDIV, DLOAD, DLOAD_0, DLOAD_1, DLOAD_2, DLOAD_3, DLoadInstruction, DMUL, DNEG, DREM, DRETURN, DSTORE, DSTORE_0, DSTORE_1, DSTORE_2, DSTORE_3, DSUB, DStoreInstruction, DUP, DUP2, DUP2_X1, DUP2_X2, DUP_X1, DUP_X2, DivideInstruction, ExplicitLocalVariableIndex, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FConstInstruction, FDIV, FLOAD, FLOAD_0, FLOAD_1, FLOAD_2, FLOAD_3, FLoadInstruction, FMUL, FNEG, FREM, FRETURN, FSTORE, FSTORE_0, FSTORE_1, FSTORE_2, FSTORE_3, FSUB, FStoreInstruction, FieldAccess, FieldReadAccess, FieldWriteAccess, FloatingPointDivideInstruction, FloatingPointRemainderInstruction, GETFIELD, GETSTATIC, GOTO, GOTO_W, GotoInstruction, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IConstInstruction, IDIV, IF0Instruction, IFACMPInstruction, IFEQ, IFGE, IFGT, IFICMPInstruction, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IFXNullInstruction, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IINC, ILOAD, ILOAD_0, ILOAD_1, ILOAD_2, ILOAD_3, ILoadInstruction, IMUL, INCOMPLETE_INVOKEDYNAMIC, INEG, INSTANCEOF, INVOKEDYNAMIC, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISTORE_0, ISTORE_1, ISTORE_2, ISTORE_3, ISUB, IStoreInstruction, IUSHR, IXOR, ImplicitLocalVariableIndex, ImplicitValue, IntegerDivideInstruction, IntegerRemainderInstruction, InvocationInstruction, JDK8_LAMBDA_INVOKEDYNAMIC, JSR, JSRInstruction, JSR_W, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LConstInstruction, LDC, LDC2_W, LDC_W, LDIV, LLOAD, LLOAD_0, LLOAD_1, LLOAD_2, LLOAD_3, LLoadInstruction, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSTORE_0, LSTORE_1, LSTORE_2, LSTORE_3, LSUB, LStoreInstruction, LUSHR, LXOR, LoadClass, LoadClass_W, LoadConstantInstruction, LoadDouble, LoadFloat, LoadFloat_W, LoadInt, LoadInt_W, LoadLocalVariableInstruction, LoadLong, LoadMethodHandle, LoadMethodHandle_W, LoadMethodType, LoadMethodType_W, LoadString, LoadString_W, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, MethodInvocationInstruction, MultiplyInstruction, NEW, NEWARRAY, NOP, NegateInstruction, NonVirtualMethodInvocationInstruction, NumericConversionInstruction, POP, POP2, PUTFIELD, PUTSTATIC, PopInstruction, PrimitiveArrayStoreInstruction, RET, RETURN, RemainderInstruction, ReturnInstruction, ReturnValueInstruction, SALOAD, SASTORE, SIPUSH, SWAP, ShiftInstruction, SimpleConditionalBranchInstruction, StackBasedArithmeticInstruction, StackManagementInstruction, StoreLocalVariableInstruction, SubtractInstruction, SynchronizationInstruction, TABLESWITCH, UNRESOLVED_INVOKEDYNAMIC, UnaryArithmeticInstruction, UnconditionalBranchInstruction, VirtualMethodInvocationInstruction, WIDE
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Instruction
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def expressionResult: ExpressionResult

    Permalink

    Returns the location – Stack, Register or NoExpression – where the value computed by this instruction is stored.

    Returns the location – Stack, Register or NoExpression – where the value computed by this instruction is stored. In this case an instruction is only considered to be an expression if a puts a value on the stack or in a register that is the result of some kind of computation; i.e., just copying, duplicating or moving a value between the stack and the registers is not considered to be an expression.

    Note

    The CHECKCAST instruction is special in the sense that it just inspects the top-most value.

  2. abstract def indexOfNextInstruction(currentPC: PC, modifiedByWide: Boolean): Int

    Permalink

    The index of the next instruction in the code array.

  3. abstract def indexOfNextInstruction(currentPC: PC)(implicit code: Code): Int

    Permalink

    The index of the next instruction in the code array.

    The index of the next instruction in the code array.

    Note

    This is primarily a convenience method that delegates to the method indexOfNextInstrution(PC,Boolean). However, given that this is also the standard method called by clients, it is often meaningful to directly implement this. In particular since most instructions cannot be modified by wide.

  4. abstract def indexOfReadLocal: Int

    Permalink

    The index of the local (variable)/register that is read is returned.

    The index of the local (variable)/register that is read is returned. This method is only defined if readsLocal returns true.

    Annotations
    @throws( ... )
  5. abstract def indexOfWrittenLocal: Int

    Permalink

    The index of the local (variable)/register that is written.

    The index of the local (variable)/register that is written. This method is only defined if writesLocal returns true.

    Annotations
    @throws( ... )
  6. abstract def isIsomorphic(thisPC: PC, otherPC: PC)(implicit code: Code): Boolean

    Permalink

    Determines if this instruction is isomorphic to the given instruction.

    Determines if this instruction is isomorphic to the given instruction.

    Two instructions are isomporphic if they access the same operand and register values and if the instructions have the same bytecode representation, except of (A) (potential) padding bytes and (B) the branch offset of JSR(_W) instructions. In the first case the branch offsets are corrected by the number of padding bytes and in the second case the absolute addresses are compared (i.e., whether both instructions call the same subroutine.

    For example, an aload_0 instruction is only isomorphic to another aload_0 instruction and is not isomorphic to an aload(0) instruction – though the runtime effect is the same. However, a LOOKUPSWITCH (TABLESWITCH) instruction is considered isomorphic to another respective instruction if the only difference is the number of padding bytes. Furthermore, two JSR(_W) instructions are isomorphic if and only if they jump to the same subroutine.

    Note

    this.isIsomorphic(thisPC,thisPC) is always true

    ,

    The number of padding bytes is generally calculated by (otherPC % 4) - (thisPC %4) (=== "padding other" - "padding this") and should be added to the branch offsets of this (XYZ)switch instruction when the branch targets are compared to the other instructions branchoffsets.

    // "padding b" - "padding a"
    // === (3 - (bPC % 4)) - (3 - (aPC % 4))
    // === (aPC % 4) - (bPC %4)
  7. abstract def jvmExceptions: List[ObjectType]

    Permalink

    The exceptions that may be thrown by the JVM at runtime if the execution of this instruction fails.

    The exceptions that may be thrown by the JVM at runtime if the execution of this instruction fails. I.e., these are neither exceptions that are explicitly created and then thrown by user code nor errors that may arise due to an invalid code base (e.g. LinkageErrors). However, OutOfMemoryErrors are possible.

  8. abstract def mnemonic: String

    Permalink

    The mnemonic of the instruction as defined by the JVM specification.

  9. abstract def nextInstructions(currentPC: PC, regularSuccessorsOnly: Boolean)(implicit code: Code): PCs

    Permalink

    Returns the pcs of the instructions that may be executed next at runtime.

    Returns the pcs of the instructions that may be executed next at runtime.

    returns

    The absolute addresses of all instructions that may be executed next at runtime.

  10. abstract def numberOfPoppedOperands(ctg: (Int) ⇒ ComputationalTypeCategory): Int

    Permalink

    The number of values that are popped from the operand stack.

    The number of values that are popped from the operand stack. Here, long and double values are also counted as one value though they use two stack slots. E.g., IADD (integer add) and LADD (long add) both pop two values and push one value.

    ctg

    A function that returns the computational type category of the value on the operand stack with a given index. E.g., The top value on the operand stack has index '0' and may occupy one (for category 1 values) or two stack slots (for category 2 values.)

    Note

    In case of some of the StackManagementInstruction this number is not fixed. In that case the number depends on the concrete layout of the operand stack. E.g., the POP2 instruction may just pop one categeory 2 value (of type long or double) or two category 1 values.

  11. abstract def numberOfPushedOperands(ctg: (Int) ⇒ ComputationalTypeCategory): Int

    Permalink

    The number of values that are put onto the operand stack.

    The number of values that are put onto the operand stack. Here, long and double values are also counted as one value though they use two stack slots. E.g., IADD (integer add) and LADD (long add) both pop two values and push one value.

    ctg

    A function that returns the computational type category of the value on the operand stack with a given index. The top value on the operand stack has index '0' and may occupy one (for category 1 values) or two stack slots (for category 2 values.)

    Note

    In case of some of the StackManagementInstruction this number is not fixed. In that case the number depends on the concrete layout of the operand stack. E.g., the DUP2 instruction may just duplicate one categeory 2 value (result is 1) (of type long or double) or two category 1 values (result is 2).

  12. abstract def opcode: Int

    Permalink

    The opcode of the instruction as defined by the JVM specification.

    The opcode of the instruction as defined by the JVM specification. The opcode is a value in the range [0..255].

  13. abstract def readsLocal: Boolean

    Permalink

    Returns true if this instruction reads/uses a local variable.

  14. abstract def writesLocal: Boolean

    Permalink

    Returns true if this instruction writes/updates a local variable.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def nextInstructions(currentPC: PC)(implicit code: Code): PCs

    Permalink

    Returns the pcs of the instructions that may be executed next at runtime.

    Returns the pcs of the instructions that may be executed next at runtime. This method takes potentially thrown exceptions into account. I.e., every instruction that may throw an exception checks if it occurs within a catch block and – if so – checks if an appropriate handler exists and – if so – also returns the first instruction of the handler.

    returns

    The absolute addresses of all instructions that may be executed next at runtime.

  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(currentPC: Int): String

    Permalink

    Returns a string representation of this instruction.

    Returns a string representation of this instruction. If this instruction is a (conditional) jump instruction then the PCs of the target instructions are given absolute address.

    currentPC

    The program counter of this instruction. Used to resolve relative jump targets.

  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped