KOPI
PrevNext

Chapter 1. Classfile Handling

Table of Contents
KOPI Assembly Language
KOPI Classfile API

KOPI classfile is an extensible package written completely in Java that allows you to read, edit and write classfiles. It is used by KJC (Java compiler), KSM (Java assembler) and DIS (Java disassembler).

This list shows typical tools that may be built with KOPI Classfile:

This package allows you to edit classfiles and to check and optimize instructions in an elegant way. Generated code from ``normal input'' is in the same order of size and speed as thus generated by other commercial compilers such as Javac or jikes. Applied optimisation is mainly peephole optimisation and has also faster bytecode replacement and switch selection capabilities. And last but not least, this package is able to compute the stack's depth and the number of local variables used by each method.

There are two main sections in this chapter:

The description of the tools in the section called KOPI Assembly Language.

An assembly language for the Java classfile format.

Two tools are available:

The documentation for the disassembler in the section called The KOPI Disassembler (DIS).

a Java disassembler that allows one to read and edit a classfile in kopi-assembler.

The documentation for the assembler in the section called The KOPI Assembler (KSM).

a Java assembler used to write classfile from kopi-assembler.

The description of the API in the section called KOPI Classfile API.

The package classfile itself, that allows one to handle Java code generation from within an other Java application without worrying about code optimization, stackand local variable handling, code checking and constant pool optimization.

The core API in the section called Read a classfile.

An API for embedding Java code generation in other tools.

The performed optimizations in the section called Pluggable Bytecode optimizer.

An in depth report about performed optimizations.


PrevHomeNext
Credits KOPI Assembly Language