org.logicalcobwebs.cglib.core
Class RemappingCodeVisitor

java.lang.Object
  extended by org.logicalcobwebs.asm.CodeAdapter
      extended by org.logicalcobwebs.cglib.core.RemappingCodeVisitor
All Implemented Interfaces:
CodeVisitor
Direct Known Subclasses:
CodeEmitter

public class RemappingCodeVisitor
extends CodeAdapter


Nested Class Summary
private static class RemappingCodeVisitor.IntRef
           
private static class RemappingCodeVisitor.State
           
 
Field Summary
private  RemappingCodeVisitor.IntRef check
           
private  RemappingCodeVisitor.State state
           
 
Fields inherited from class org.logicalcobwebs.asm.CodeAdapter
cv
 
Constructor Summary
RemappingCodeVisitor(CodeVisitor v, int access, Type[] args)
           
RemappingCodeVisitor(RemappingCodeVisitor wrap)
           
 
Method Summary
protected  int nextLocal(int size)
           
private  int remap(int var, int size)
           
 void visitIincInsn(int var, int increment)
          Visits an IINC instruction.
 void visitLocalVariable(java.lang.String name, java.lang.String desc, Label start, Label end, int index)
          Visits a local variable declaration.
 void visitMaxs(int maxStack, int maxLocals)
          Visits the maximum stack size and the maximum number of local variables of the method.
 void visitVarInsn(int opcode, int var)
          Visits a local variable instruction.
 
Methods inherited from class org.logicalcobwebs.asm.CodeAdapter
visitAttribute, visitFieldInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLookupSwitchInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

private RemappingCodeVisitor.State state

check

private RemappingCodeVisitor.IntRef check
Constructor Detail

RemappingCodeVisitor

public RemappingCodeVisitor(CodeVisitor v,
                            int access,
                            Type[] args)

RemappingCodeVisitor

public RemappingCodeVisitor(RemappingCodeVisitor wrap)
Method Detail

nextLocal

protected int nextLocal(int size)

remap

private int remap(int var,
                  int size)

visitIincInsn

public void visitIincInsn(int var,
                          int increment)
Description copied from interface: CodeVisitor
Visits an IINC instruction.

Specified by:
visitIincInsn in interface CodeVisitor
Overrides:
visitIincInsn in class CodeAdapter
Parameters:
var - index of the local variable to be incremented.
increment - amount to increment the local variable by.

visitLocalVariable

public void visitLocalVariable(java.lang.String name,
                               java.lang.String desc,
                               Label start,
                               Label end,
                               int index)
Description copied from interface: CodeVisitor
Visits a local variable declaration.

Specified by:
visitLocalVariable in interface CodeVisitor
Overrides:
visitLocalVariable in class CodeAdapter
Parameters:
name - the name of a local variable.
desc - the type descriptor of this local variable.
start - the first instruction corresponding to the scope of this local variable (inclusive).
end - the last instruction corresponding to the scope of this local variable (exclusive).
index - the local variable's index.

visitVarInsn

public void visitVarInsn(int opcode,
                         int var)
Description copied from interface: CodeVisitor
Visits a local variable instruction. A local variable instruction is an instruction that loads or stores the value of a local variable.

Specified by:
visitVarInsn in interface CodeVisitor
Overrides:
visitVarInsn in class CodeAdapter
Parameters:
opcode - the opcode of the local variable instruction to be visited. This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
var - the operand of the instruction to be visited. This operand is the index of a local variable.

visitMaxs

public void visitMaxs(int maxStack,
                      int maxLocals)
Description copied from interface: CodeVisitor
Visits the maximum stack size and the maximum number of local variables of the method.

Specified by:
visitMaxs in interface CodeVisitor
Overrides:
visitMaxs in class CodeAdapter
Parameters:
maxStack - maximum stack size of the method.
maxLocals - maximum number of local variables for the method.