Packages

object Code

Defines constants useful when analyzing a method's code.

Source
Code.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Code
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final val KindId: Int(6)

    The unique id associated with attributes of kind: Code.

    The unique id associated with attributes of kind: Code.

    KindIds can be used for efficient branching on attributes.

  2. def apply(maxStack: Int, maxLocals: Int, instructions: Array[Instruction], exceptionHandlers: ExceptionHandlers = NoExceptionHandlers, attributes: Attributes = NoAttributes): Code
  3. def computeCFG(instructions: Array[Instruction], exceptionHandlers: ExceptionHandlers = NoExceptionHandlers, classHierarchy: ClassHierarchy = ClassHierarchy.PreInitializedClassHierarchy): CFG[Instruction, Code]
  4. def computeMaxLocals(isInstanceMethod: Boolean, descriptor: MethodDescriptor, instructions: Array[Instruction]): Int
  5. def computeMaxLocalsRequiredByCode(instructions: Array[Instruction]): Int

    The maximum number of registers required to execute the code - independent of the number of parameters.

    The maximum number of registers required to execute the code - independent of the number of parameters.

    Note

    The method's descriptor may actually require

  6. def computeMaxStack(instructions: Array[Instruction], exceptionHandlers: ExceptionHandlers, cfg: CFG[Instruction, Code]): Int

    Computes the maximum stack size required when executing this code block.

    Computes the maximum stack size required when executing this code block.

    Annotations
    @throws("if it is impossible to compute the maximum height of the stack")
    Exceptions thrown

    java.lang.ClassFormatError If the stack size differs between execution paths.

  7. def computeMaxStack(instructions: Array[Instruction], classHierarchy: ClassHierarchy = ClassHierarchy.PreInitializedClassHierarchy, exceptionHandlers: ExceptionHandlers = NoExceptionHandlers): Int

    Computes the maximum stack size required when executing this code block.

    Computes the maximum stack size required when executing this code block.

    Annotations
    @throws("if it is impossible to compute the maximum height of the stack")
    Exceptions thrown

    java.lang.ClassFormatError If the stack size differs between execution paths.

    Note

    If the cfg is available, call the respective computeMaxStack method.

  8. def invalidBytecode(descriptor: MethodDescriptor, isInstanceMethod: Boolean, message: Option[String] = None): Code

    Creates a method body which throws a java.lang.Error with the given message or that states that the underlying bytecode is invalid if the message is empty.

  9. def unapply(code: Code): Option[(Int, Int, Array[Instruction], ExceptionHandlers, Attributes)]