Apparat (software)

__NOTOC__ Apparat is an open-source language manipulation and optimization framework for the ActionScript language released under the GNU Lesser General Public License (LGPL). It may also be used to perform static code analysis like reaching definitions and dominance analysis.

The Apparat framework is inspired by Soot and also written in the Java programming language. It contains command-line tools to work with SWF files.

Dump

The Dump tool extracts information of a compiled SWF file by analyzing its bytecode and structure. It can generate UML diagrams and inheritance graphs.

TDSI

TDSI is a command-line tool which allows ActionScript developers to use the fast Alchemy opcodes. The use of predefined functions will be replaced with the corresponding bytecode resulting in a significant speed improvement.

Example

The following example shows the behaviour of TDSI. Since the call to a static method is considered slow it will be replaced with the corresponding Alchemy opcode.

ActionScript:

 Memory.writeInt( 1, 0 );

Pseudo bytecode:

 GetLex Memory
 PushByte 1
 PushByte 0
 CallVoid writeInt, 2

After inline expansion:

 PushByte 1
 PushByte 0
 WriteInt  

TAAS

TreeAddressActionScript (TAAS) is an intermediate representation of ActionScript Bytecode in optional SSA form. The TAAS compiler is an optimizing compiler supporting:

  • Copy propagation
  • Constant folding
  • Strength reduction
  • Loop-invariant code motion
  • Inline expansion

See also

  • Soot (software)
  • List of tools for static code analysis