|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Code.BytecodeMapAttribute
Maps bytecodes to some kind of attribute. For example, the Exceptions attribute maps bytecodes to exception handler regions; likewise, the LineNumbersTable attribute maps bytecodes to source code line numbers.
During bytecode optimisation, the relative position of bytecodes may change as a result of eliminating redundant bytecodes. In such a case we need to update those attributes which are affected. This interface captures those attributes which are affected, and provides a hook to tell them about rewrites as they happen.
Finally, the actual bytecode offsets in the code block (as opposed to their index in the block) are not known until the class file is actually written. Attributes which write bytecode offsets must convert between indices and actual code offsets.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface jasm.lang.BytecodeAttribute |
---|
BytecodeAttribute.Fn, BytecodeAttribute.Reader, BytecodeAttribute.Unknown |
Method Summary | |
---|---|
void |
apply(java.util.List<Code.Rewrite> rewrites)
This method accepts a list of rewrites which should be applied. |
void |
write(int[] bytecodeOffsets,
BinaryOutputStream writer,
java.util.Map<Constant.Info,java.lang.Integer> constantPool)
This method requires the attribute to write itself to the binary stream. |
Methods inherited from interface jasm.lang.BytecodeAttribute |
---|
addPoolItems, name, print, write |
Method Detail |
---|
void apply(java.util.List<Code.Rewrite> rewrites)
rewrites
- void write(int[] bytecodeOffsets, BinaryOutputStream writer, java.util.Map<Constant.Info,java.lang.Integer> constantPool) throws java.io.IOException
bytecodeOffsets
- --- maps each bytecode index to its actual offset in the
code block.writer
- --- stream to write attribute toconstantPool
- --- map of constant pool items to their actual pool indexload
- --- class loader instance
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |