package tac
Common definitions related to the definition and processing of three address code.
- Source
- package.scala
- Alphabetic
- By Inheritance
- tac
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class AITACode[P <: AnyRef, VI <: ValueInformation] extends TACode[P, DUVar[VI]]
- trait ASTNode[+V <: Var[V]] extends AnyRef
Defines nodes used by statements and expressions.
- trait ArrayExpr[+V <: Var[V]] extends Expr[V]
- case class ArrayLength[+V <: Var[V]](pc: PC, arrayRef: Expr[V]) extends ArrayExpr[V] with Product with Serializable
- case class ArrayLoad[+V <: Var[V]](pc: PC, index: Expr[V], arrayRef: Expr[V]) extends ArrayExpr[V] with Product with Serializable
- case class ArrayStore[+V <: Var[V]](pc: PC, arrayRef: Expr[V], index: Expr[V], value: Expr[V]) extends Stmt[V] with Product with Serializable
- case class Assignment[+V <: Var[V]](pc: PC, targetVar: V, expr: Expr[V]) extends AssignmentLikeStmt[V] with Product with Serializable
- sealed abstract class AssignmentLikeStmt[+V <: Var[V]] extends Stmt[V]
- case class BinaryExpr[+V <: Var[V]](pc: PC, cTpe: ComputationalType, op: BinaryArithmeticOperator, left: Expr[V], right: Expr[V]) extends Expr[V] with Product with Serializable
- cTpe
The computational type of the result of the binary expression if the expression succeeds.
- trait Call[+V <: Var[V]] extends AnyRef
Common supertrait of statements and expressions calling a method.
- case class CaughtException[+V <: Var[V]](pc: PC, exceptionType: Option[ObjectType], throwingStmts: IntTrieSet) extends Stmt[V] with Product with Serializable
A caught exception is essential to ensure that the "throw" is never optimized away, even if the exception object as such is not used.
A caught exception is essential to ensure that the "throw" is never optimized away, even if the exception object as such is not used.
- Note
CaughtException
expression are only created by TACAI!
- case class Checkcast[+V <: Var[V]](pc: PC, value: Expr[V], cmpTpe: ReferenceType) extends Stmt[V] with Product with Serializable
A
checkcast
as defined by the JVM specification. - case class ClassConst(pc: PC, value: ReferenceType) extends SimpleValueConst with Product with Serializable
- case class Compare[+V <: Var[V]](pc: PC, left: Expr[V], condition: RelationalOperator, right: Expr[V]) extends Expr[V] with Product with Serializable
A comparison of two values.
- sealed abstract class Const extends NoVariableExpr
A constant value expression.
- abstract class DUVar[+Value <: ValueInformation] extends Var[DUVar[Value]]
Identifies a variable which has a single static definition/initialization site.
- class DVar[+Value <: ValueInformation] extends DUVar[Value]
A (final) variable definition, which is uniquely identified by its origin/the index of the corresponding AssignmentStatement.
A (final) variable definition, which is uniquely identified by its origin/the index of the corresponding AssignmentStatement. I.e., per method there must be at most one D variable which has the given origin. Initially, the pc of the underlying bytecode instruction is used.
- case class DoubleConst(pc: PC, value: Double) extends SimpleValueConst with Product with Serializable
- case class DynamicConst(pc: PC, bootstrapMethod: BootstrapMethod, name: String, descriptor: FieldType) extends SimpleValueConst with Product with Serializable
- trait Expr[+V <: Var[V]] extends ASTNode[V]
Represents an expression.
Represents an expression. In general, every expression should be a simple expression, where the child expressions are just Vars or Consts. However, when the code is going to be transformed to human readable code (e.g., Java oder Scala), then it is possible to build up complex/nested expressions after all transformations and static analyses have been performed.
- case class ExprStmt[+V <: Var[V]](pc: Int, expr: Expr[V]) extends AssignmentLikeStmt[V] with Product with Serializable
An expression where the value is not further used.
- abstract class FieldRead[+V <: Var[V]] extends Expr[V]
- sealed abstract class FieldWriteAccessStmt[+V <: Var[V]] extends Stmt[V]
- case class FloatConst(pc: PC, value: Float) extends SimpleValueConst with Product with Serializable
- sealed abstract class FunctionCall[+V <: Var[V]] extends Expr[V] with Call[V]
- case class GetField[+V <: Var[V]](pc: PC, declaringClass: ObjectType, name: String, declaredFieldType: FieldType, objRef: Expr[V]) extends FieldRead[V] with Product with Serializable
- case class GetStatic(pc: PC, declaringClass: ObjectType, name: String, declaredFieldType: FieldType) extends FieldRead[Nothing] with Product with Serializable
- case class Goto(pc: PC, target: Int) extends Stmt[Nothing] with VariableFreeStmt with Product with Serializable
- target
First the
pc
(absolute) of the target instruction in the original bytecode array; then the index of the respective quadruples instruction.
- sealed trait IdBasedVar extends Var[IdBasedVar]
Id based variables are named based on the position of the corresponding stack/register value.
- case class If[+V <: Var[V]](pc: PC, left: Expr[V], condition: RelationalOperator, right: Expr[V], target: Int) extends Stmt[V] with Product with Serializable
Representation of a conditional jump, where we jump to the given target if the condition evaluates to true.
Representation of a conditional jump, where we jump to the given target if the condition evaluates to true.
- left
The expression left to the relational operator. In general, this can be expected to be a Var or Const. However, it is an expression to facilitate advanced use cases such as generating source code.
- right
The expression right to the relational operator. In general, this can be expected to be a Var or Const. However, it is an expression to facilitate advanced use cases such as generating source code.
- target
Index in the statements array.
- sealed abstract class InstanceFunctionCall[+V <: Var[V]] extends FunctionCall[V]
- sealed abstract class InstanceMethodCall[+V <: Var[V]] extends MethodCall[V]
- case class InstanceOf[+V <: Var[V]](pc: PC, value: Expr[V], cmpTpe: ReferenceType) extends Expr[V] with Product with Serializable
An
instance of
expression as defined by the JVM specification. - case class IntConst(pc: PC, value: Int) extends SimpleValueConst with Product with Serializable
- case class InvokedynamicFunctionCall[+V <: Var[V]](pc: PC, bootstrapMethod: BootstrapMethod, name: String, descriptor: MethodDescriptor, params: Seq[Expr[V]]) extends Expr[V] with Product with Serializable
Representation of an
invokedynamic
instruction where the finally called method returns some value.Representation of an
invokedynamic
instruction where the finally called method returns some value.- V
The type of the Vars.
- case class InvokedynamicMethodCall[+V <: Var[V]](pc: PC, bootstrapMethod: BootstrapMethod, name: String, descriptor: MethodDescriptor, params: Seq[Expr[V]]) extends Stmt[V] with Product with Serializable
Representation of an
invokedynamic
instruction where the return type of the finally called method isvoid
.Representation of an
invokedynamic
instruction where the return type of the finally called method isvoid
.- V
The type of the Vars.
- case class JSR(pc: PC, target: Int) extends Stmt[Nothing] with VariableFreeStmt with Product with Serializable
JSR/RET instructions in the bytecode are mapped to corresponding statements where the Ret instruction explicitly encodes the control flow by explicitly listing all target instructions.
JSR/RET instructions in the bytecode are mapped to corresponding statements where the Ret instruction explicitly encodes the control flow by explicitly listing all target instructions. The target instructions implicitly encode the JSR instruction which called the subroutine.
- target
At creation time the
pc
(absolute) of the target instruction in the original bytecode array; then the index of the respective quadruples instruction.
- case class LongConst(pc: PC, value: Long) extends SimpleValueConst with Product with Serializable
- sealed abstract class MethodCall[+V <: Var[V]] extends Stmt[V] with Call[V]
- case class MethodHandleConst(pc: PC, value: MethodHandle) extends Const with Product with Serializable
- case class MethodTypeConst(pc: PC, value: MethodDescriptor) extends Const with Product with Serializable
- case class MonitorEnter[+V <: Var[V]](pc: PC, objRef: Expr[V]) extends SynchronizationStmt[V] with Product with Serializable
- case class MonitorExit[+V <: Var[V]](pc: PC, objRef: Expr[V]) extends SynchronizationStmt[V] with Product with Serializable
- final class NaiveTACode[P <: AnyRef] extends TACode[P, IdBasedVar]
- case class New(pc: PC, tpe: ObjectType) extends Expr[Nothing] with Product with Serializable
Allocates memory for the (non-abstract) given object.
Allocates memory for the (non-abstract) given object. Note, that the call of the separator is done later and therefore the object is not considered to be properly initialized and – therefore – no further operations other than the call of a constructor are allowed.
- case class NewArray[+V <: Var[V]](pc: PC, counts: Seq[Expr[V]], tpe: ArrayType) extends ArrayExpr[V] with Product with Serializable
- counts
Encodes the number of dimensions that are initialized and the size of the respective dimension.
- tpe
The type of the array. The number of dimensions is always
>= count.size
.
- trait NoVariableExpr extends ValueExpr[Nothing]
- case class NonVirtualFunctionCall[+V <: Var[V]](pc: PC, declaringClass: ObjectType, isInterface: Boolean, name: String, descriptor: MethodDescriptor, receiver: Expr[V], params: Seq[Expr[V]]) extends InstanceFunctionCall[V] with Product with Serializable
An instance based method call which does not require virtual method lookup.
An instance based method call which does not require virtual method lookup. In other words the target method is either directly found in the specified class or a super class thereof. (Basically corresponds to an invokespecial at bytecode level.)
- V
The type of the Var used by this representation.
- pc
The pc of the underlying, original bytecode instruction. Primarily useful to do a lookup in the line-/local-variable tables.
- declaringClass
The declaring class of the target method.
- isInterface
true
if the declaring class defines an interface type. (Required since Java 8.)- name
The name of the target method.
- descriptor
The descriptor.
- receiver
The receiver object.
- params
The parameters of the method call (including the implicit
this
reference.)
- case class NonVirtualMethodCall[+V <: Var[V]](pc: Int, declaringClass: ObjectType, isInterface: Boolean, name: String, descriptor: MethodDescriptor, receiver: Expr[V], params: Seq[Expr[V]]) extends InstanceMethodCall[V] with Product with Serializable
Call of an instance method for which no virtual method call resolution has to happen.
Call of an instance method for which no virtual method call resolution has to happen. I.e., it is either a super-call, a private instance method call or a constructor call.
- case class Nop(pc: Int) extends SimpleStmt with Product with Serializable
Models a no-operation.
Models a no-operation. In general, a NOP (no operation) can be pruned; however, in the TACAI representation, if a NOP is the last statement of a basic block where the previous basic block has multiple-successors then it may be the case that the NOP cannot be pruned, because it it is required to keep the path alive. For example, given the following code:
public int m(int i, int j, boolean z){ int r = 0; if (z) { r = i; } else { r = j; } return r; }
In this case, the returned value is either i or j and therefore the UVar would directly encode that information and therefore the assignments would be ignored. (The information cannot be recovered! If needed a complete SSA representation would be required; TACAI only provides only an SSA-like representation!)
- case class NullExpr(pc: PC) extends SimpleValueConst with Product with Serializable
- case class Param(cTpe: ComputationalType, name: String) extends NoVariableExpr with Product with Serializable
Explicit initialization of a parameter.
- class Parameters[P <: AnyRef] extends (Int) => P
Information about a method's explicit and implicit parameters.
- case class PrefixExpr[+V <: Var[V]](pc: PC, cTpe: ComputationalType, op: UnaryArithmeticOperator, operand: Expr[V]) extends Expr[V] with Product with Serializable
- cTpe
The computational type of the result of the prefix expression.
- case class PrimitiveTypecastExpr[+V <: Var[V]](pc: PC, targetTpe: BaseType, operand: Expr[V]) extends Expr[V] with Product with Serializable
- case class PutField[+V <: Var[V]](pc: Int, declaringClass: ObjectType, name: String, declaredFieldType: FieldType, objRef: Expr[V], value: Expr[V]) extends FieldWriteAccessStmt[V] with Product with Serializable
- case class PutStatic[+V <: Var[V]](pc: PC, declaringClass: ObjectType, name: String, declaredFieldType: FieldType, value: Expr[V]) extends FieldWriteAccessStmt[V] with Product with Serializable
- case class Ret(pc: PC, returnAddresses: PCs) extends Stmt[Nothing] with VariableFreeStmt with Product with Serializable
Return from subroutine; only to be used in combination with JSR instructions (Java 6 and earlier).
Return from subroutine; only to be used in combination with JSR instructions (Java 6 and earlier).
- returnAddresses
The set of return addresses. Based on the return addresses it is immediately possible to determine the original JSR instruction that led to the execution of the subroutine. It is the JSR instruction directly preceding the instruction to which this RET instruction jumps to. This information is only relevant in case of flow-sensitive analyses.
- case class Return(pc: Int) extends SimpleStmt with Product with Serializable
- case class ReturnValue[+V <: Var[V]](pc: Int, expr: Expr[V]) extends Stmt[V] with Product with Serializable
- sealed abstract class SimpleStmt extends Stmt[Nothing] with VariableFreeStmt
- sealed abstract class SimpleValueConst extends Const
- case class SimpleVar(id: Int, cTpe: ComputationalType) extends IdBasedVar with Product with Serializable
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.
- case class StaticFunctionCall[+V <: Var[V]](pc: PC, declaringClass: ObjectType, isInterface: Boolean, name: String, descriptor: MethodDescriptor, params: Seq[Expr[V]]) extends FunctionCall[V] with Product with Serializable
- case class StaticMethodCall[+V <: Var[V]](pc: Int, declaringClass: ObjectType, isInterface: Boolean, name: String, descriptor: MethodDescriptor, params: Seq[Expr[V]]) extends MethodCall[V] with Product with Serializable
- sealed abstract class Stmt[+V <: Var[V]] extends ASTNode[V]
Super trait of all three-address code/quadruple statements.
- case class StringConst(pc: PC, value: String) extends SimpleValueConst with Product with Serializable
- case class Switch[+V <: Var[V]](pc: PC, defaultTarget: Int, index: Expr[V], npairs: ArraySeq[IntIntPair]) extends Stmt[V] with Product with Serializable
Represents a table or lookup switch statement.
Represents a table or lookup switch statement.
- defaultTarget
the target if none of the values matches.
- npairs
may be empty in that case we have a glorified goto – or if all other cases were determined to be dead.
- Note
The conversion from switch bytecode instructions may end up in simple goto statement.
- sealed abstract class SynchronizationStmt[+V <: Var[V]] extends Stmt[V]
- trait TACAIKey[I <: AnyRef] extends ProjectInformationKey[(Method) => AITACode[TACMethodParameter, ValueInformation], I]
- case class TACMethodParameter(origin: ValueOrigin, useSites: IntTrieSet) extends Product with Serializable
Captures essential information about a method's parameter.
- trait TACOptimization[P <: AnyRef, V <: Var[V], C <: TACode[P, V]] extends AnyRef
Common interface of all code optimizers that operate on the three-address code representation.
- case class TACOptimizationResult[P <: AnyRef, V <: Var[V], C <: TACode[P, V]](code: C, wasTransformed: Boolean) extends Product with Serializable
Encapsulates the result of an optimization/transformation of some three-address code.
- case class TACStmts[V <: Var[V]](instructions: Array[Stmt[V]]) extends CodeSequence[Stmt[V]] with Product with Serializable
Wrapper class to warp an array of statements.
- sealed trait TACode[P <: AnyRef, V <: Var[V]] extends Attribute with CodeSequence[Stmt[V]]
Contains the 3-address code (like) representation of a method.
Contains the 3-address code (like) representation of a method.
OPAL offers multiple 3-address code like representations. One that is a one-to-one conversion of the bytecode and which does not provide higher-level information. Additionally, the (Base)TACAI represtation is offered that is targeted towards static analyses. The base TACAI representation does not preserve all information which would be required to regenerate the original code, but which greatly facilitates static analysis by making the end-to-end def-use chains directly available.
- V
The type of Vars used by the underlying code. Given that the stmts array is conceptually immutable - i.e., no client is allowed to change it(!) - the type V is actually co-variant, but we cannot express this.
- case class Throw[+V <: Var[V]](pc: PC, exception: Expr[V]) extends Stmt[V] with Product with Serializable
- class UVar[+Value <: ValueInformation] extends DUVar[Value]
- trait ValueExpr[+V <: Var[V]] extends Expr[V]
- trait Var[+V <: Var[V]] extends ValueExpr[V]
Represents a variable.
Represents a variable. Depending on the concrete usage, it is possible to distinguish between a use and/or definition site. Typically,
V
is directly bound by the direct subtypes of Var.- V
Specifies the type of
Var
used by the three address representation.V
is also the self type.
trait MyVar extends Var[MyVar]
Example: - trait VariableFreeStmt extends Stmt[Nothing]
- trait VirtualCall[+V <: Var[V]] extends AnyRef
- case class VirtualFunctionCall[+V <: Var[V]](pc: PC, declaringClass: ReferenceType, isInterface: Boolean, name: String, descriptor: MethodDescriptor, receiver: Expr[V], params: Seq[Expr[V]]) extends InstanceFunctionCall[V] with VirtualCall[V] with Product with Serializable
- case class VirtualMethodCall[+V <: Var[V]](pc: Int, declaringClass: ReferenceType, isInterface: Boolean, name: String, descriptor: MethodDescriptor, receiver: Expr[V], params: Seq[Expr[V]]) extends InstanceMethodCall[V] with VirtualCall[V] with Product with Serializable
Value Members
- final val AllNaiveTACodeOptimizations: List[TACOptimization[Param, IdBasedVar, NaiveTACode[Param]]]
- final val OriginOfThis: Int(-1)
Identifies the implicit
this
reference in the 3-address code representation.Identifies the implicit
this
reference in the 3-address code representation. -1 always identifies the origin of the self reference(this
) if the the method is an instance method; if the method is not an instance method the origin -1 is not used. - final val SelfReferenceParameter: IntTrieSet
- def tacToDot[V <: Var[V]](stmts: Array[Stmt[V]], cfg: CFG[Stmt[V], TACStmts[V]]): String
- def tacToGraph[V <: Var[V]](stmts: Array[Stmt[V]], cfg: CFG[Stmt[V], TACStmts[V]]): Iterable[Node]
- def tacToGraph[P <: AnyRef, V <: Var[V]](tac: TACode[P, V]): Iterable[Node]
- def updateExceptionHandlers(newIndexes: Array[Int])(implicit aiResult: AIResult { val domain: org.opalj.ai.Domain with org.opalj.ai.domain.RecordDefUse }): ExceptionHandlers
Updates the exception handlers by adjusting the start, end and handler index (pc).
Updates the exception handlers by adjusting the start, end and handler index (pc).
- newIndexes
A map that contains for each previous index the new index that should be used.
- aiResult
The result of the abstract interpretation of the method.
- returns
The new exception handlers.
- Note
This method can only be used in cases where the order of instructions remains the same and/or instructions are deleted. If instructions are reordered this method cannot be used!
- object AITACode
- object ArrayLength extends Serializable
- object ArrayLoad extends Serializable
- object ArrayStore extends Serializable
- object Assignment extends Serializable
- object AssignmentLikeStmt
- object BinaryExpr extends Serializable
- object Call
- object CaughtException extends Serializable
- object Checkcast extends Serializable
- object ClassConst extends Serializable
- object Compare extends Serializable
- object ComputeTACAIKey extends TACAIKey[(Method) => Domain with RecordDefUse]
Key to compute the 3-address based code of a method computed using the configured domain/data-flow analysis.
Key to compute the 3-address based code of a method computed using the configured domain/data-flow analysis. The result is not cached and the 3-address code is still linked to the results of the underlying data-flow analysis. In general, this key is only appropriate if you want to transform every method at most once.
To get the index use the org.opalj.br.analyses.Project's
get
method and pass inthis
object.
Example: - object DUVar
- object DVar
- object DefSites
Extractor to get the definition site of an expression's/statement's value.
Extractor to get the definition site of an expression's/statement's value.
This extractor may fail (i.e., throw an exception), when the expr is not a DVar or a Const; this decision was made to capture programming failures as early as possible (flat).
To get a return value's definition sites (unless the value is constant).
val tac.ReturnValue(pc,tac.DefSites(defSites)) = code.stmts(5)
Example: - object DoubleConst extends Serializable
- object DynamicConst extends Serializable
- object EagerDetachedTACAIKey extends TACAIKey[(Method) => Domain with RecordDefUse]
Key to get the 3-address based code of a method computed using the configured domain/data-flow analysis.
Key to get the 3-address based code of a method computed using the configured domain/data-flow analysis. This key performs the transformation eagerly for all methods. The results of the underlying analysis are not cached.
To get the index use the org.opalj.br.analyses.Project's
get
method and pass inthis
object.
Example: - object ExprStmt extends Serializable
- object FloatConst extends Serializable
- object GetField extends Serializable
- object GetStatic extends Serializable
- object Goto extends Serializable
- object If extends Serializable
- object InstanceMethodCall
- object InstanceOf extends Serializable
- object IntConst extends Serializable
- object InvokedynamicFunctionCall extends Serializable
- object InvokedynamicMethodCall extends Serializable
- object JSR extends Serializable
- object LazyDetachedTACAIKey extends TACAIKey[(Method) => Domain with RecordDefUse]
Key to get the 3-address based code of a method computed using the configured domain/data-flow analysis.
Key to get the 3-address based code of a method computed using the configured domain/data-flow analysis. This key performs the underlying data-flow analysis on demand using the configured data-flow analyses; the results of the data-flow analyses are NOT cached/shared. Hence, this key should only be used if the result of the underlying analysis is no longer required after generating the TAC.
To get the index use the org.opalj.br.analyses.Project's
get
method and pass inthis
object.
Example: - object LazyTACUsingAIKey extends TACAIKey[Nothing]
Key to get the 3-address based code of a method computed using the result of the data-flow analysis performed by
SimpleAIKey
.Key to get the 3-address based code of a method computed using the result of the data-flow analysis performed by
SimpleAIKey
.To get the index use the org.opalj.br.analyses.Project's
get
method and pass inthis
object.
Example: - object LongConst extends Serializable
- object MethodCallParameters
- object MethodHandleConst extends Serializable
- object MethodTypeConst extends Serializable
- object MonitorEnter extends Serializable
- object MonitorExit extends Serializable
- object New extends Serializable
- object NewArray extends Serializable
- object NonVirtualFunctionCall extends Serializable
- object NonVirtualFunctionCallStatement
Matches a statement which – in flat form – directly calls a non-virtual function; basically abstracts over ExprStmts and Assignments.
- object NonVirtualMethodCall extends Serializable
- object Nop extends Serializable
- object NullExpr extends Serializable
- object OperandVar
- object Param extends Serializable
- object PrefixExpr extends Serializable
- object PrimitiveTypecastExpr extends Serializable
- object PutField extends Serializable
- object PutStatic extends Serializable
- object RegisterVar
- object Ret extends Serializable
- object Return extends Serializable
- object ReturnValue extends Serializable
- object SimplePropagation extends TACOptimization[Param, IdBasedVar, NaiveTACode[Param]]
A very simple peephole optimizer which performs intra-basic block constant and copy propagation for the naive representation (in case of the ai-based representation these steps are already done at abstract-interpretation time).
- object StaticFunctionCall extends Serializable
- object StaticFunctionCallStatement
Matches a statement which – in flat form – directly calls a static function; basically abstracts over ExprStmts and Assignments.
- object StaticMethodCall extends Serializable
- object StringConst extends Serializable
- object Switch extends Serializable
- object TAC
Creates the three-address representation for some method(s) and prints it to
std out
or writes it to a file.Creates the three-address representation for some method(s) and prints it to
std out
or writes it to a file.To convert all files of a project to the AI based three-address code, you can use:
import org.opalj.io.write import org.opalj.util.PerformanceEvaluation.time import org.opalj.tac._ val f = new java.io.File("OPAL/bi/target/scala-2.12/resource_managed/test/ai.jar") val p = org.opalj.br.analyses.Project(f) var i = 0 val errors = time { p.parForeachMethodWithBody(parallelizationLevel=32){ mi => val TACode(code,cfg,ehs,_) = org.opalj.tac.TACAI(p,mi.method)() val tac = ToTxt(code, Some(cfg)) val fileNamePrefix = mi.classFile.thisType.toJava+"."+mi.method.name val file = write(tac, fileNamePrefix, ".tac.txt") i+= 1 println(i+":"+file) } }(t => println("transformation time: "+t.toSeconds)) if(errors.nonEmpty) println(errors.mkString("\n"))
Example: - object TACAI
Factory to convert the bytecode of a method into a three address representation using the results of a(n) (local) abstract interpretation of the method.
Factory to convert the bytecode of a method into a three address representation using the results of a(n) (local) abstract interpretation of the method.
The generated representation is completely parameterized over the domains that were used to perform the abstract interpretation. The only requirement is that the Def/Use information is recorded while performing the abstract interpretation (see org.opalj.ai.domain.RecordDefUse).
The generated representation is necessarily in static single assignment form: each variable is assigned exactly once, and every variable is defined before it is used. However, no PHI instructions are inserted; instead - in case of a use - we simply directly refer to all def sites.
- object TACNaive
Converts the bytecode of a method into a three address representation using a very naive approach where each each operand stack value is stored in a local variable based on the position of the value on the stack and where each local variable is stored in a local variable named based on the register's index (In general, you should use the three-address code create using TACAI).
Converts the bytecode of a method into a three address representation using a very naive approach where each each operand stack value is stored in a local variable based on the position of the value on the stack and where each local variable is stored in a local variable named based on the register's index (In general, you should use the three-address code create using TACAI).
The converted method has an isomorophic CFG when compared to the original method, but may contain more instructions due to the way how the stack manipulation instructions are transformed. In general - unless JSR/RET instructions are found - no CFG is created and used. This approach relies on the invariant that the stack has to have the same layout on all paths. This makes the transformation very fast, but also makes it impossible to trivially compute the type information.
- object TACode
- object TempVar
- object Throw extends Serializable
- object ToTxt
Converts a list of three-address instructions into a text-based representation for comprehension purposes only.
Converts a list of three-address instructions into a text-based representation for comprehension purposes only.
- Note
This representation is primarily provided for debugging purposes and is not performance optimized.
- object UVar
- object Var
- object VirtualFunctionCall extends Serializable
- object VirtualFunctionCallStatement
Matches a statement which – in flat form – directly calls a virtual function; basically abstracts over ExprStmts and Assignments.
- object VirtualMethodCall extends Serializable