Next: About this document
Up: No Title
Previous: Usage
Jopt optimizes the class files in the following ways:
- removing debug info
line number table, local variable table - removing attributes that are unnecessary for execution
sourcefile, innerclass, synthetic, deprecated, user-defined - removing unused private methods and fields
- removing unused entries from the constant pool
any entry that is not referenced from anywhere inside the class file,
e.g. the constant_utf8 ``SourceFile'' and the name of the sourcefile
that were lost when the sourcefile attribute was removed - optimizing the order of local variable slots
- obfuscating private method- and fieldnames
the new names are usually shorter than the old ones,
so the optimized class file is also shorter - optimizing the bytecode in different ways
- removing NOP instructions
- removing GOTO instructions that jump to the following instruction
- redirecting GOTO instructions that jump to another GOTO instruction
- replacing GOTO instructions that jump to a RETURN instruction
- removing dead code
- replacing xSTOREn/xLOADn by DUP/xSTOREn, which can entail other
optimizations
- live variable analysis (currently deactivated)
- constant folding propagation (currently deactivated)
- ... there is more to come ...
Markus Jansen
Fri Sep 17 14:27:53 MET DST 1999