| java.lang.Object org.netbeans.lib.profiler.instrumentation.SingleMethodScaner org.netbeans.lib.profiler.instrumentation.Injector
All known Subclasses: org.netbeans.lib.profiler.instrumentation.ProfilePointHitCallInjector, org.netbeans.lib.profiler.instrumentation.SpecialCallInjector, org.netbeans.lib.profiler.instrumentation.CodeRegionEntryExitCallsInjector, org.netbeans.lib.profiler.instrumentation.ObjLivenessInstrCallsInjector, org.netbeans.lib.profiler.instrumentation.MethodEntryExitCallsInjector,
Injector | abstract public class Injector extends SingleMethodScaner (Code) | | Base class for a number of classes performing concrete method instrumentation injections. Contains core functionality
for injection of arbitrary bytecodes at a given location in a method and subsequent rewriting of bytecodes. Also
supports appending bytecodes to the existing bytecodes, and extending the method's exception table.
author: Misha Dmitriev |
Constructor Summary | |
protected | Injector() | protected | Injector(ClassInfo clazz, int methodIdx) Creates a new Injector for the specified method. |
Method Summary | |
protected void | addExceptionTableEntry(int startPC, int endPC, int handlerPC, int typeCPIndex) | protected void | appendCode(byte[] appendedBytes, int appendedBytesCount) | protected byte[] | createPackedMethodInfo() | void | handleJumpWiden(int bci, int delta) | protected void | injectCodeAndRewrite(byte[] injectedBytes, int injectedBytesCount, int injectionPos, boolean injectionBindsToFollowingInstruction) Injects the specified raw bytes array at the specified location.
The last parameter indicates whether the injected code should be bound to the following (if true) or previous (if false) bytecode
instruction. | protected void | insertProfilingPoints(RuntimeProfilingPoint[] points, int ppHitCPMethodIdx) Profiling points MUST BE already SORTED by BCI in ascending order and only relevant to this method. | abstract public byte[] | instrumentMethod() |
baseCPoolCount | protected int baseCPoolCount(Code) | | |
excTableEntryCount | protected int excTableEntryCount(Code) | | |
exceptionTable | protected byte[] exceptionTable(Code) | | |
maxLocals | protected int maxLocals(Code) | | |
maxStack | protected int maxStack(Code) | | |
origBytecodesLength | protected int origBytecodesLength(Code) | | |
origExcTableEntryCount | protected int origExcTableEntryCount(Code) | | |
Injector | protected Injector()(Code) | | |
Injector | protected Injector(ClassInfo clazz, int methodIdx)(Code) | | Creates a new Injector for the specified method. Subsequently one can call injectCodeAndRewrite() and other
methods below as many times as needed.
|
addExceptionTableEntry | protected void addExceptionTableEntry(int startPC, int endPC, int handlerPC, int typeCPIndex)(Code) | | |
appendCode | protected void appendCode(byte[] appendedBytes, int appendedBytesCount)(Code) | | |
createPackedMethodInfo | protected byte[] createPackedMethodInfo()(Code) | | |
handleJumpWiden | void handleJumpWiden(int bci, int delta)(Code) | | Called by the ChangeJumpWiden class
|
injectCodeAndRewrite | protected void injectCodeAndRewrite(byte[] injectedBytes, int injectedBytesCount, int injectionPos, boolean injectionBindsToFollowingInstruction)(Code) | | Injects the specified raw bytes array at the specified location.
The last parameter indicates whether the injected code should be bound to the following (if true) or previous (if false) bytecode
instruction. When binding to the following instruction, all jumps that target that instruction will target the injected code after
rewriting. When binding to the previous instruction x, all jumps that target the instruction x+1 will still target that instruction
after rewriting (i.e. not target our injected code, as in the first case).
|
insertProfilingPoints | protected void insertProfilingPoints(RuntimeProfilingPoint[] points, int ppHitCPMethodIdx)(Code) | | Profiling points MUST BE already SORTED by BCI in ascending order and only relevant to this method.
Parameters: points - sorted array of Profiling points Parameters: ppHitCPMethodIdx - |
instrumentMethod | abstract public byte[] instrumentMethod()(Code) | | In concrete subclasses, should do all the real work on method instrumentation and return the updated packed methodInfo
|
Methods inherited from org.netbeans.lib.profiler.instrumentation.SingleMethodScaner | protected static int align(int n)(Code)(Java Doc) protected int getByte(int pos)(Code)(Java Doc) protected int getInt(int pos)(Code)(Java Doc) protected short getShort(int pos)(Code)(Java Doc) protected static int getU2(byte[] buf, int pos)(Code)(Java Doc) protected int getU2(int pos)(Code)(Java Doc) protected static int getU4(byte[] buf, int pos)(Code)(Java Doc) protected int getU4(int pos)(Code)(Java Doc) protected void initBytecodesArray()(Code)(Java Doc) protected int opcodeLength(int bci)(Code)(Java Doc) protected static void putByte(byte[] buf, int pos, int value)(Code)(Java Doc) protected void putInt(int pos, int value)(Code)(Java Doc) protected void putShort(int pos, short value)(Code)(Java Doc) protected static void putU2(byte[] buf, int pos, int value)(Code)(Java Doc) protected static void putU4(byte[] buf, int pos, int value)(Code)(Java Doc) protected void putU4(int pos, int value)(Code)(Java Doc) public void setClassAndMethod(ClassInfo clazz, int methodIdx)(Code)(Java Doc)
|
|
|