| |
|
| java.lang.Object com.caucho.bytecode.CodeVisitor com.caucho.bytecode.CodeEnhancer
CodeEnhancer | public class CodeEnhancer extends CodeVisitor (Code) | | Visitor for travelling the code.
|
Inner Class :abstract static class Branch | |
Inner Class :static class Jump extends Branch | |
Inner Class :static class Switch extends Branch | |
Inner Class :static class TableSwitch extends Switch | |
Inner Class :static class LookupSwitch extends Switch | |
Inner Class :class JumpAnalyzer extends Analyzer | |
Method Summary | |
public void | add(int offset, byte[] buffer, int bufOffset, int length) Adds a byte to the code. | public void | addByte(int offset, int value) Adds a byte to the code. | public void | addNulls(int offset, int count) Adds a byte to the code. | public void | addShort(int offset, int value) Adds a short to the code. | public void | analyze(Analyzer analyzer, boolean allowFlow) | protected void | analyzeJumps() | public byte[] | getCode() Returns the code buffer. | public int | getLength() Returns the length. | public void | init(JavaClass javaClass, CodeAttribute codeAttr) | protected void | insertCode(int offset, int count) Updates indices when adding a chunk of code. | public void | remove(int offset, int count) Removes a range from the code. | protected void | removeCode(int offset, int count) | public void | setByte(int offset, int value) Adds a byte to the code. | public void | update() Updates the code. |
CodeEnhancer | public CodeEnhancer()(Code) | | |
add | public void add(int offset, byte[] buffer, int bufOffset, int length)(Code) | | Adds a byte to the code.
|
addByte | public void addByte(int offset, int value)(Code) | | Adds a byte to the code.
|
addNulls | public void addNulls(int offset, int count)(Code) | | Adds a byte to the code.
|
addShort | public void addShort(int offset, int value)(Code) | | Adds a short to the code.
|
analyze | public void analyze(Analyzer analyzer, boolean allowFlow) throws Exception(Code) | | Analyzes the code for a method
|
analyzeJumps | protected void analyzeJumps()(Code) | | |
getCode | public byte[] getCode()(Code) | | Returns the code buffer.
|
getLength | public int getLength()(Code) | | Returns the length.
|
insertCode | protected void insertCode(int offset, int count)(Code) | | Updates indices when adding a chunk of code. The operation at
the given offset moves, e.g. adding 6 bytes to the beginning of
the program moves the initial byte down by 6 and therefore needs
to update the links as well.
Therefore, enhancers which expand an opcode from 2 bytes to 3 bytes
must insert the new bytes after the initial opcode.
|
remove | public void remove(int offset, int count)(Code) | | Removes a range from the code.
|
removeCode | protected void removeCode(int offset, int count)(Code) | | |
setByte | public void setByte(int offset, int value)(Code) | | Adds a byte to the code.
|
update | public void update()(Code) | | Updates the code.
|
|
|
|