User:Jpbowen/Apparat (software)

Apparat is an open-source language manipulation and optimization framework development project.

Overview
The Apparat software framework is 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 framework is inspired by Soot and written in the Scala programming language on the Java platform. It contains command-line tools to work with SWF files.

The project was initially hosted by Google on the Google Codefacility but has since moved to GitHub.

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.

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.
 * Example

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