Package

org.opalj

tac

Permalink

package tac

Common definitions related to the definition and processing of three address code.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. tac
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class ArrayLength(pc: PC, arrayRef: Var) extends Expr with Product with Serializable

    Permalink
  2. case class ArrayLoad(pc: PC, index: Var, arrayRef: Var) extends Expr with Product with Serializable

    Permalink
  3. case class ArrayStore(pc: PC, arrayRef: Expr, index: Expr, value: Expr) extends SimpleStmt with Product with Serializable

    Permalink
  4. case class Assignment(pc: PC, targetVar: Var, expr: Expr) extends SimpleStmt with Product with Serializable

    Permalink
  5. case class BinaryExpr(pc: PC, cTpe: ComputationalType, op: BinaryArithmeticOperator, left: Expr, right: Expr) extends Expr with Product with Serializable

    Permalink

    cTpe

    The computational type of the result of the binary expression.

  6. trait Call extends AnyRef

    Permalink

    Defines nodes used by statements and expressions.

  7. case class Checkcast(pc: PC, value: Var, cmpTpe: ReferenceType) extends Expr with Product with Serializable

    Permalink
  8. case class ClassConst(pc: PC, value: ReferenceType) extends SimpleValueConst with Product with Serializable

    Permalink
  9. case class Compare(pc: PC, left: Expr, condition: RelationalOperator, right: Expr) extends Expr with Product with Serializable

    Permalink
  10. sealed abstract class Const extends ValueExpr

    Permalink
  11. case class DomainValueBasedVar(id: Int, properties: ai.Domain.DomainValue) extends IdBasedVar with Product with Serializable

    Permalink
  12. case class DoubleConst(pc: PC, value: Double) extends SimpleValueConst with Product with Serializable

    Permalink
  13. trait Expr extends AnyRef

    Permalink
  14. sealed abstract class FieldAccessStmt extends SimpleStmt

    Permalink
  15. case class FloatConst(pc: PC, value: Float) extends SimpleValueConst with Product with Serializable

    Permalink
  16. sealed abstract class FunctionCall extends Expr with Call

    Permalink
  17. case class GetField(pc: PC, declaringClass: ObjectType, name: String, objRef: Expr) extends Expr with Product with Serializable

    Permalink
  18. case class GetStatic(pc: PC, declaringClass: ObjectType, name: String) extends Expr with Product with Serializable

    Permalink
  19. case class Goto(pc: PC, target: Int) extends Stmt with Product with Serializable

    Permalink

    target

    First the pc (absolute) of the target instruction in the original bytecode array; then the index of the respective quadruples instruction.

  20. sealed trait IdBasedVar extends Var

    Permalink
  21. case class If(pc: PC, left: Expr, condition: RelationalOperator, right: Expr, target: Int) extends Stmt with Product with Serializable

    Permalink

  22. sealed abstract class InstanceFunctionCall extends FunctionCall

    Permalink
  23. sealed abstract class InstanceMethodCall extends MethodCall

    Permalink
  24. case class InstanceOf(pc: PC, value: Var, cmpTpe: ReferenceType) extends Expr with Product with Serializable

    Permalink
  25. case class IntConst(pc: PC, value: Int) extends SimpleValueConst with Product with Serializable

    Permalink
  26. case class Invokedynamic(pc: PC, bootstrapMethod: BootstrapMethod, name: String, descriptor: MethodDescriptor, params: List[Expr]) extends Expr with Product with Serializable

    Permalink
  27. case class JumpToSubroutine(pc: PC, target: Int) extends Stmt with Product with Serializable

    Permalink

    A JSR Instruction is mapped to two instructions:

    A JSR Instruction is mapped to two instructions:

    1. the jsr instruction which performs a jump
    2. an assigment instruction at the jump target that initializes the local variable that is used to store the return address.
    target

    At creation time the pc (absolute) of the target instruction in the original bytecode array; then the index of the respective quadruples instruction.

  28. case class LongConst(pc: PC, value: Long) extends SimpleValueConst with Product with Serializable

    Permalink
  29. sealed abstract class MethodCall extends SimpleStmt with Call

    Permalink
  30. case class MethodHandleConst(pc: PC, value: MethodHandle) extends Const with Product with Serializable

    Permalink
  31. case class MethodTypeConst(pc: PC, value: MethodDescriptor) extends Const with Product with Serializable

    Permalink
  32. case class MonitorEnter(pc: PC, objRef: Expr) extends SynchronizationStmt with Product with Serializable

    Permalink
  33. case class MonitorExit(pc: PC, objRef: Expr) extends SynchronizationStmt with Product with Serializable

    Permalink
  34. case class New(pc: PC, tpe: ObjectType) extends Expr with Product with Serializable

    Permalink
  35. case class NewArray(pc: PC, counts: List[Expr], tpe: ArrayType) extends Expr with Product with Serializable

    Permalink
  36. case class NonVirtualFunctionCall(pc: PC, declaringClass: ReferenceType, name: String, descriptor: MethodDescriptor, receiver: Expr, params: List[Expr]) extends InstanceFunctionCall with Product with Serializable

    Permalink
  37. case class NonVirtualMethodCall(pc: PC, declaringClass: ReferenceType, name: String, descriptor: MethodDescriptor, receiver: Expr, params: List[Expr]) extends InstanceMethodCall with Product with Serializable

    Permalink
  38. case class Nop(pc: PC) extends SimpleStmt with Product with Serializable

    Permalink
  39. case class NullExpr(pc: PC) extends SimpleValueConst with Product with Serializable

    Permalink
  40. case class Param(cTpe: ComputationalType, name: String) extends ValueExpr with Product with Serializable

    Permalink

    Parameter expressions must occur at the very beginning of the quadruples code and must perform the initial initialization of the register values.

  41. case class PrefixExpr(pc: PC, cTpe: ComputationalType, op: UnaryArithmeticOperator, operand: Expr) extends Expr with Product with Serializable

    Permalink

    cTpe

    The computational type of the result of the prefix expression.

  42. case class PrimitiveTypecastExpr(pc: PC, targetTpe: BaseType, operand: Expr) extends Expr with Product with Serializable

    Permalink
  43. case class PutField(pc: PC, declaringClass: ObjectType, name: String, objRef: Expr, value: Expr) extends FieldAccessStmt with Product with Serializable

    Permalink
  44. case class PutStatic(pc: PC, declaringClass: ObjectType, name: String, value: Expr) extends FieldAccessStmt with Product with Serializable

    Permalink
  45. case class Ret(pc: PC, returnAddressVar: Var) extends Stmt with Product with Serializable

    Permalink
  46. case class Return(pc: PC) extends SimpleStmt with Product with Serializable

    Permalink
  47. case class ReturnValue(pc: PC, expr: Expr) extends SimpleStmt with Product with Serializable

    Permalink
  48. sealed abstract class SimpleStmt extends Stmt

    Permalink
  49. sealed abstract class SimpleValueConst extends Const

    Permalink
  50. case class SimpleVar(id: Int, cTpe: ComputationalType) extends IdBasedVar with Product with Serializable

    Permalink

    The id determines the name of the local variable and is equivalent to "the position of the value on the operand stack" or "-1-(the accessed register)".

    The id determines the name of the local variable and is equivalent to "the position of the value on the operand stack" or "-1-(the accessed register)". If the id is Int.MinValue then the variable is an intermediate variable that was artificially generated.

  51. type Stack = List[Var]

    Permalink
  52. case class StaticFunctionCall(pc: PC, declaringClass: ReferenceType, name: String, descriptor: MethodDescriptor, params: List[Expr]) extends FunctionCall with Product with Serializable

    Permalink
  53. case class StaticMethodCall(pc: PC, declaringClass: ReferenceType, name: String, descriptor: MethodDescriptor, params: List[Expr]) extends MethodCall with Product with Serializable

    Permalink
  54. sealed abstract class Stmt extends AnyRef

    Permalink

    Super trait of all quadruple statements.

  55. case class StringConst(pc: PC, value: String) extends SimpleValueConst with Product with Serializable

    Permalink
  56. case class Switch(pc: PC, defaultTarget: PC, index: Var, npairs: IndexedSeq[(Int, PC)]) extends Stmt with Product with Serializable

    Permalink
  57. sealed abstract class SynchronizationStmt extends SimpleStmt

    Permalink
  58. trait TACOptimization extends AnyRef

    Permalink

    Common interface of all code optimizers that operate on the three-address code representation.

  59. case class TACOptimizationResult(code: Array[Stmt], cfg: CFG, wasTransformed: Boolean = false) extends Product with Serializable

    Permalink

    Encapsulates the result of an optimization/transformation of some three-address code.

  60. case class Throw(pc: PC, exception: Expr) extends SimpleStmt with Product with Serializable

    Permalink
  61. trait ValueExpr extends Expr

    Permalink
  62. trait Var extends ValueExpr

    Permalink
  63. case class VirtualFunctionCall(pc: PC, declaringClass: ReferenceType, name: String, descriptor: MethodDescriptor, receiver: Expr, params: List[Expr]) extends InstanceFunctionCall with Product with Serializable

    Permalink
  64. case class VirtualMethodCall(pc: PC, declaringClass: ReferenceType, name: String, descriptor: MethodDescriptor, receiver: Expr, params: List[Expr]) extends InstanceMethodCall with Product with Serializable

    Permalink

Value Members

  1. final val AllOptimizations: List[TACOptimization]

    Permalink
  2. object AsQuadruples

    Permalink

    Converts the bytecode of a method into a three address representation using quadruples.

    Converts the bytecode of a method into a three address representation using quadruples. The converted method has an isomorophic CFG when compared to the original method, but may contain more instructions.

  3. object Call

    Permalink
  4. object InstanceMethodCall

    Permalink
  5. final val NoOptimizations: List[TACOptimization]

    Permalink
  6. object OperandVar

    Permalink
  7. object RegisterVar

    Permalink
  8. object SimplePropagation extends TACOptimization

    Permalink

    A very simple peephole optimizer which performs intra-basic block constant and copy propagation.

  9. object TAC

    Permalink

    Creates the three-address representation and prints it.

    Creates the three-address representation and prints it.

    Example:
    1. To convert all files of a project to TAC you can use:

      import org.opalj.io.write
      import org.opalj.tac._
      import org.opalj.util.PerformanceEvaluation.time
      val f = new java.io.File("/Users/eichberg/Downloads/presto-verifier-0.147-executable.zip")
      val p = org.opalj.br.analyses.Project(f)
      var i = 0
      time {
      p.parForeachMethodWithBody(parallelizationLevel=32){ mi =>
        val (code,_) = org.opalj.tac.AsQuadruples(mi.method,p.classHierarchy)
        val tac = ToJavaLike(code)
        val fileNamePrefix = mi.classFile.thisType.toJava+"."+mi.method.name
        val file = write(tac, fileNamePrefix, ".tac.txt")
        i+= 1
        println(i+":"+file)
      }
      }(t => println("Analysis time: "+t.toSeconds))
  10. object TempVar

    Permalink
  11. object ToJavaLike

    Permalink

    Converts a list of three-address instructions into a Java like representation.

  12. object Var

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped