Package | Description |
---|---|
javassist.bytecode |
Bytecode-level API.
|
javassist.bytecode.analysis |
Bytecode Analysis API.
|
javassist.bytecode.stackmap | |
javassist.convert | |
javassist.expr |
This package contains the classes for modifying a method body.
|
javassist.tools.reflect |
Runtime Behavioral Reflection.
|
Modifier and Type | Method | Description |
---|---|---|
void |
StackMapTable.Walker.appendFrame(int pos,
int offsetDelta,
int[] tags,
int[] data) |
Invoked if the visited frame is a
append_frame . |
void |
StackMapTable.Walker.chopFrame(int pos,
int offsetDelta,
int k) |
Invoked if the visited frame is a
chop_frame . |
int |
CodeAttribute.computeMaxStack() |
Computes the maximum stack size and sets
max_stack
to the computed size. |
void |
StackMapTable.Walker.fullFrame(int pos,
int offsetDelta,
int[] localTags,
int[] localData,
int[] stackTags,
int[] stackData) |
Invoked if the visited frame is
full_frame . |
int |
CodeIterator.insert(byte[] code) |
Inserts the given bytecode sequence
before the next instruction that would be returned by
next() (not before the instruction returned
by the last call to next() ). |
void |
CodeIterator.insert(int pos,
byte[] code) |
Inserts the given bytecode sequence
before the instruction at the given index
pos . |
int |
CodeIterator.insertAt(int pos,
byte[] code) |
Inserts the given bytecode sequence
before the instruction at the given index
pos . |
int |
CodeIterator.insertEx(byte[] code) |
Inserts the given bytecode sequence exclusively
before the next instruction that would be returned by
next() (not before the instruction returned
by tha last call to next() ). |
void |
CodeIterator.insertEx(int pos,
byte[] code) |
Inserts the given bytecode sequence exclusively
before the instruction at the given index
pos . |
int |
CodeIterator.insertExAt(int pos,
byte[] code) |
Inserts the given bytecode sequence exclusively
before the instruction at the given index
pos . |
int |
CodeIterator.insertExGap(int length) |
Inserts an exclusive gap
before the next instruction that would be returned by
next() (not before the instruction returned
by the last call to next() ). |
int |
CodeIterator.insertExGap(int pos,
int length) |
Inserts an exclusive gap in front of the instruction at the given
index
pos . |
int |
CodeIterator.insertGap(int length) |
Inserts a gap
before the next instruction that would be returned by
next() (not before the instruction returned
by the last call to next() ). |
int |
CodeIterator.insertGap(int pos,
int length) |
Inserts a gap in front of the instruction at the given
index
pos . |
CodeIterator.Gap |
CodeIterator.insertGapAt(int pos,
int length,
boolean exclusive) |
Inserts an inclusive or exclusive gap in front of the instruction
at the given index
pos . |
void |
StackMap.insertLocal(int index,
int tag,
int classInfo) |
Updates this stack map table when a new local variable is inserted
for a new parameter.
|
void |
StackMapTable.insertLocal(int index,
int tag,
int classInfo) |
Updates this stack map table when a new local variable is inserted
for a new parameter.
|
void |
CodeAttribute.insertLocalVar(int where,
int size) |
Changes the index numbers of the local variables
to append a new parameter.
|
int |
CodeIterator.next() |
Returns the index of the next instruction
(not the operand following the current opcode).
|
void |
StackMapTable.Walker.parse() |
Visits each entry of the stack map frames.
|
void |
MethodInfo.rebuildStackMap(ClassPool pool) |
Rebuilds a stack map table.
|
void |
MethodInfo.rebuildStackMapForME(ClassPool pool) |
Rebuilds a stack map table for J2ME (CLDC).
|
void |
MethodInfo.rebuildStackMapIf6(ClassPool pool,
ClassFile cf) |
Rebuilds a stack map table if the class file is for Java 6
or later.
|
void |
StackMapTable.Walker.sameFrame(int pos,
int offsetDelta) |
Invoked if the visited frame is a
same_frame or
a same_frame_extended . |
void |
StackMapTable.Walker.sameLocals(int pos,
int offsetDelta,
int stackTag,
int stackData) |
Invoked if the visited frame is a
same_locals_1_stack_item_frame
or a same_locals_1_stack_item_frame_extended . |
void |
MethodInfo.setSuperclass(String superclass) |
Changes a super constructor called by this constructor.
|
int |
CodeIterator.skipConstructor() |
Moves to the instruction for
either
super() or this() . |
int |
CodeIterator.skipSuperConstructor() |
Moves to the instruction for
super() . |
int |
CodeIterator.skipThisConstructor() |
Moves to the instruction for
this() . |
static SignatureAttribute.ClassSignature |
SignatureAttribute.toClassSignature(String sig) |
Parses the given signature string as a class signature.
|
static SignatureAttribute.ObjectType |
SignatureAttribute.toFieldSignature(String sig) |
Parses the given signature string as a field type signature.
|
static SignatureAttribute.MethodSignature |
SignatureAttribute.toMethodSignature(String sig) |
Parses the given signature string as a method type signature.
|
static SignatureAttribute.Type |
SignatureAttribute.toTypeSignature(String sig) |
Parses the given signature string as a type signature.
|
Constructor | Description |
---|---|
MethodInfo(ConstPool cp,
String methodname,
MethodInfo src,
Map<String,String> classnameMap) |
Constructs a copy of
method_info structure. |
Modifier and Type | Method | Description |
---|---|---|
Frame[] |
Analyzer.analyze(CtClass clazz,
MethodInfo method) |
Performs data-flow analysis on a method and returns an array, indexed by
instruction position, containing the starting frame state of all reachable
instructions.
|
Frame[] |
Analyzer.analyze(CtMethod method) |
Performs data-flow analysis on a method and returns an array, indexed by
instruction position, containing the starting frame state of all reachable
instructions.
|
void |
Executor.execute(MethodInfo method,
int pos,
CodeIterator iter,
Frame frame,
Subroutine subroutine) |
Execute the instruction, modeling the effects on the specified frame and subroutine.
|
Frame |
ControlFlow.frameAt(int pos) |
Returns the types of the local variables and stack frame entries
available at the given position.
|
Subroutine[] |
SubroutineScanner.scan(MethodInfo method) |
Constructor | Description |
---|---|
ControlFlow(CtClass ctclazz,
MethodInfo minfo) |
Constructs a control-flow analyzer.
|
ControlFlow(CtMethod method) |
Constructs a control-flow analyzer for the given method.
|
Modifier and Type | Method | Description |
---|---|---|
static void |
TypeData.aastore(TypeData array,
TypeData value,
ClassPool cp) |
|
protected int |
Tracer.doOpcode(int pos,
byte[] code) |
Does abstract interpretation on the given bytecode instruction.
|
static BasicBlock |
BasicBlock.find(BasicBlock[] blocks,
int pos) |
|
BasicBlock[] |
BasicBlock.Maker.make(CodeIterator ci,
int begin,
int end,
ExceptionTable et) |
|
BasicBlock[] |
BasicBlock.Maker.make(MethodInfo minfo) |
|
static StackMapTable |
MapMaker.make(ClassPool classes,
MethodInfo minfo) |
Computes the stack map table of the given method and returns it.
|
static TypeData |
TypeData.ArrayElement.make(TypeData array) |
|
static StackMap |
MapMaker.make2(ClassPool classes,
MethodInfo minfo) |
Computes the stack map table for J2ME.
|
static TypedBlock[] |
TypedBlock.makeBlocks(MethodInfo minfo,
CodeAttribute ca,
boolean optimize) |
Divides the method body into basic blocks.
|
protected void |
BasicBlock.Maker.makeJsr(Map<Integer,javassist.bytecode.stackmap.BasicBlock.Mark> marks,
int pos,
int target,
int size) |
|
void |
TypedBlock.setStackMap(int st,
TypeData[] stack,
int nl,
TypeData[] locals) |
|
void |
TypeData.ArrayElement.setType(String s,
ClassPool cp) |
|
void |
TypeData.ArrayType.setType(String s,
ClassPool cp) |
|
void |
TypeData.BasicType.setType(String s,
ClassPool cp) |
|
void |
TypeData.ClassName.setType(String typeName,
ClassPool cp) |
|
abstract void |
TypeData.setType(String s,
ClassPool cp) |
|
void |
TypeData.TypeVar.setType(String typeName,
ClassPool cp) |
|
void |
TypeData.UninitTypeVar.setType(String s,
ClassPool cp) |
|
protected void |
Tracer.visitBranch(int pos,
byte[] code,
int offset) |
|
protected void |
Tracer.visitGoto(int pos,
byte[] code,
int offset) |
|
protected void |
Tracer.visitJSR(int pos,
byte[] code) |
Invoked when the visited instruction is jsr.
|
protected void |
Tracer.visitLookupSwitch(int pos,
byte[] code,
int n,
int pairsPos,
int defaultOffset) |
|
protected void |
Tracer.visitRET(int pos,
byte[] code) |
Invoked when the visited instruction is ret or wide ret.
|
protected void |
Tracer.visitReturn(int pos,
byte[] code) |
|
protected void |
Tracer.visitTableSwitch(int pos,
byte[] code,
int n,
int offsetPos,
int defaultOffset) |
|
protected void |
Tracer.visitThrow(int pos,
byte[] code) |
Modifier and Type | Method | Description |
---|---|---|
protected int |
TransformBefore.match(int c,
int pos,
CodeIterator iterator,
int typedesc,
ConstPool cp) |
|
protected int |
TransformCall.match(int c,
int pos,
CodeIterator iterator,
int typedesc,
ConstPool cp) |
|
protected int |
TransformAfter.match2(int pos,
CodeIterator iterator) |
|
protected int |
TransformBefore.match2(int pos,
CodeIterator iterator) |
|
int |
TransformAccessArrayField.transform(CtClass tclazz,
int pos,
CodeIterator iterator,
ConstPool cp) |
|
int |
TransformCall.transform(CtClass clazz,
int pos,
CodeIterator iterator,
ConstPool cp) |
Modify INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC and INVOKEVIRTUAL
so that a different method is invoked.
|
abstract int |
Transformer.transform(CtClass clazz,
int pos,
CodeIterator it,
ConstPool cp) |
|
int |
TransformReadField.transform(CtClass tclazz,
int pos,
CodeIterator iterator,
ConstPool cp) |
|
int |
TransformWriteField.transform(CtClass tclazz,
int pos,
CodeIterator iterator,
ConstPool cp) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
Expr.replace0(int pos,
Bytecode bytecode,
int size) |
Modifier and Type | Method | Description |
---|---|---|
void |
Reflection.rebuildClassFile(ClassFile cf) |
Copyright © 2018 Shigeru Chiba, www.javassist.org. All rights reserved.