joeq.Compiler.BytecodeAnalysis
Class ModRefAnalysis

java.lang.Object
  extended by joeq.Compiler.BytecodeAnalysis.BytecodeVisitor
      extended by joeq.Compiler.BytecodeAnalysis.ModRefAnalysis
All Implemented Interfaces:
jq_ClassFileConstants, CompilationConstants

public class ModRefAnalysis
extends BytecodeVisitor

Simple mod/ref analysis.

Version:
$Id: ModRefAnalysis.java 2282 2005-05-28 11:14:27Z joewhaley $
Author:
John Whaley

Nested Class Summary
static class ModRefAnalysis.ModRefVisitor
           
 
Field Summary
static boolean ALWAYS_TRACE
           
static boolean INTRA_CLASS
           
protected  Set mod
           
protected  Set ref
           
static Map results
           
 
Fields inherited from class joeq.Compiler.BytecodeAnalysis.BytecodeVisitor
bcs, BINOP_ADD, BINOP_AND, BINOP_DIV, BINOP_MUL, BINOP_OR, BINOP_REM, BINOP_SUB, BINOP_XOR, binopnames, clazz, CMP_AE, CMP_EQ, CMP_G, CMP_GE, CMP_GT, CMP_L, CMP_LE, CMP_LT, CMP_NE, CMP_UNCOND, cmpopnames, fcmpopnames, i_end, i_start, INVOKE_INTERFACE, INVOKE_SPECIAL, INVOKE_STATIC, INVOKE_VIRTUAL, invokeopnames, method, MONITOR_ENTER, MONITOR_EXIT, monitoropnames, out, SHIFT_LEFT, SHIFT_RIGHT, SHIFT_URIGHT, shiftopnames, state, TRACE, UNOP_NEG, unopnames
 
Fields inherited from interface joeq.Class.jq_ClassFileConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_Class, CONSTANT_Double, CONSTANT_FieldRef, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodRef, CONSTANT_Long, CONSTANT_MethodRef, CONSTANT_NameAndType, CONSTANT_ResolvedClass, CONSTANT_ResolvedIFieldRef, CONSTANT_ResolvedIMethodRef, CONSTANT_ResolvedSFieldRef, CONSTANT_ResolvedSMethodRef, CONSTANT_String, CONSTANT_Utf8, CONSUME_STACK, ILLEGAL_OPCODE, ILLEGAL_TYPE, jbc_AALOAD, jbc_AASTORE, jbc_ACONST_NULL, jbc_ALOAD, jbc_ALOAD_0, jbc_ALOAD_1, jbc_ALOAD_2, jbc_ALOAD_3, jbc_ANEWARRAY, jbc_ARETURN, jbc_ARRAYLENGTH, jbc_ASTORE, jbc_ASTORE_0, jbc_ASTORE_1, jbc_ASTORE_2, jbc_ASTORE_3, jbc_ATHROW, jbc_BALOAD, jbc_BASTORE, jbc_BIPUSH, jbc_BREAKPOINT, jbc_CALOAD, jbc_CASTORE, jbc_CHECKCAST, jbc_D2F, jbc_D2I, jbc_D2L, jbc_DADD, jbc_DALOAD, jbc_DASTORE, jbc_DCMPG, jbc_DCMPL, jbc_DCONST_0, jbc_DCONST_1, jbc_DDIV, jbc_DLOAD, jbc_DLOAD_0, jbc_DLOAD_1, jbc_DLOAD_2, jbc_DLOAD_3, jbc_DMUL, jbc_DNEG, jbc_DREM, jbc_DRETURN, jbc_DSTORE, jbc_DSTORE_0, jbc_DSTORE_1, jbc_DSTORE_2, jbc_DSTORE_3, jbc_DSUB, jbc_DUP, jbc_DUP_X1, jbc_DUP_X2, jbc_DUP2, jbc_DUP2_X1, jbc_DUP2_X2, jbc_F2D, jbc_F2I, jbc_F2L, jbc_FADD, jbc_FALOAD, jbc_FASTORE, jbc_FCMPG, jbc_FCMPL, jbc_FCONST_0, jbc_FCONST_1, jbc_FCONST_2, jbc_FDIV, jbc_FLOAD, jbc_FLOAD_0, jbc_FLOAD_1, jbc_FLOAD_2, jbc_FLOAD_3, jbc_FMUL, jbc_FNEG, jbc_FREM, jbc_FRETURN, jbc_FSTORE, jbc_FSTORE_0, jbc_FSTORE_1, jbc_FSTORE_2, jbc_FSTORE_3, jbc_FSUB, jbc_GETFIELD, jbc_GETSTATIC, jbc_GOTO, jbc_GOTO_W, jbc_I2B, jbc_I2C, jbc_I2D, jbc_I2F, jbc_I2L, jbc_I2S, jbc_IADD, jbc_IALOAD, jbc_IAND, jbc_IASTORE, jbc_ICONST_0, jbc_ICONST_1, jbc_ICONST_2, jbc_ICONST_3, jbc_ICONST_4, jbc_ICONST_5, jbc_ICONST_M1, jbc_IDIV, jbc_IF_ACMPEQ, jbc_IF_ACMPNE, jbc_IF_ICMPEQ, jbc_IF_ICMPGE, jbc_IF_ICMPGT, jbc_IF_ICMPLE, jbc_IF_ICMPLT, jbc_IF_ICMPNE, jbc_IFEQ, jbc_IFGE, jbc_IFGT, jbc_IFLE, jbc_IFLT, jbc_IFNE, jbc_IFNONNULL, jbc_IFNULL, jbc_IINC, jbc_ILOAD, jbc_ILOAD_0, jbc_ILOAD_1, jbc_ILOAD_2, jbc_ILOAD_3, jbc_IMUL, jbc_INEG, jbc_INSTANCEOF, jbc_INT2BYTE, jbc_INT2CHAR, jbc_INT2SHORT, jbc_INVOKEINTERFACE, jbc_INVOKENONVIRTUAL, jbc_INVOKESPECIAL, jbc_INVOKESTATIC, jbc_INVOKEVIRTUAL, jbc_IOR, jbc_IREM, jbc_IRETURN, jbc_ISHL, jbc_ISHR, jbc_ISTORE, jbc_ISTORE_0, jbc_ISTORE_1, jbc_ISTORE_2, jbc_ISTORE_3, jbc_ISUB, jbc_IUSHR, jbc_IXOR, jbc_JSR, jbc_JSR_W, jbc_L2D, jbc_L2F, jbc_L2I, jbc_LADD, jbc_LALOAD, jbc_LAND, jbc_LASTORE, jbc_LCMP, jbc_LCONST_0, jbc_LCONST_1, jbc_LDC, jbc_LDC_W, jbc_LDC2_W, jbc_LDIV, jbc_LLOAD, jbc_LLOAD_0, jbc_LLOAD_1, jbc_LLOAD_2, jbc_LLOAD_3, jbc_LMUL, jbc_LNEG, jbc_LOOKUPSWITCH, jbc_LOR, jbc_LREM, jbc_LRETURN, jbc_LSHL, jbc_LSHR, jbc_LSTORE, jbc_LSTORE_0, jbc_LSTORE_1, jbc_LSTORE_2, jbc_LSTORE_3, jbc_LSUB, jbc_LUSHR, jbc_LXOR, jbc_MONITORENTER, jbc_MONITOREXIT, jbc_MULTIANEWARRAY, jbc_NEW, jbc_NEWARRAY, jbc_NOP, jbc_POP, jbc_POP2, jbc_PUTFIELD, jbc_PUTSTATIC, jbc_RET, jbc_RETURN, jbc_SALOAD, jbc_SASTORE, jbc_SIPUSH, jbc_SWAP, jbc_TABLESWITCH, jbc_WIDE, NO_OF_OPERANDS, OPCODE_NAMES, PRODUCE_STACK, RESERVED, STATE_CLSINITERROR, STATE_CLSINITIALIZED, STATE_CLSINITIALIZING, STATE_CLSINITRUNNING, STATE_COMPILED, STATE_COMPILING, STATE_LOADED, STATE_LOADERROR, STATE_LOADING1, STATE_LOADING2, STATE_LOADING3, STATE_PREPARED, STATE_PREPAREERROR, STATE_PREPARING, STATE_SFINITERROR, STATE_SFINITIALIZED, STATE_SFINITIALIZING, STATE_UNLOADED, STATE_VERIFIED, STATE_VERIFYERROR, STATE_VERIFYING, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TC_ARRAY, TC_BOOLEAN, TC_BYTE, TC_CHAR, TC_CLASS, TC_CLASSEND, TC_DOUBLE, TC_FLOAT, TC_INT, TC_LONG, TC_PARAM, TC_PARAMEND, TC_SHORT, TC_VOID, TYPE_OF_OPERANDS, UNDEFINED, UNPREDICTABLE
 
Fields inherited from interface joeq.Compiler.CompilationConstants
MAYBE, NO, YES
 
Constructor Summary
ModRefAnalysis(jq_Method m)
          Creates new ModRefAnalysis
 
Method Summary
 Set getMod()
           
 Set getRef()
           
protected  void handleInvoke(jq_Method target)
           
protected  void invokeHelper(byte op, jq_Method f)
           
 String toString()
           
 void visitAGETFIELD(jq_InstanceField f)
           
 void visitAGETSTATIC(jq_StaticField f)
           
 void visitAINVOKE(byte op, jq_Method f)
           
 void visitAPUTFIELD(jq_InstanceField f)
           
 void visitAPUTSTATIC(jq_StaticField f)
           
 void visitBGETFIELD(jq_InstanceField f)
           
 void visitBGETSTATIC(jq_StaticField f)
           
 void visitBPUTFIELD(jq_InstanceField f)
           
 void visitBPUTSTATIC(jq_StaticField f)
           
 void visitCGETFIELD(jq_InstanceField f)
           
 void visitCGETSTATIC(jq_StaticField f)
           
 void visitCPUTFIELD(jq_InstanceField f)
           
 void visitCPUTSTATIC(jq_StaticField f)
           
 void visitDGETFIELD(jq_InstanceField f)
           
 void visitDGETSTATIC(jq_StaticField f)
           
 void visitDINVOKE(byte op, jq_Method f)
           
 void visitDPUTFIELD(jq_InstanceField f)
           
 void visitDPUTSTATIC(jq_StaticField f)
           
 void visitFGETFIELD(jq_InstanceField f)
           
 void visitFGETSTATIC(jq_StaticField f)
           
 void visitFINVOKE(byte op, jq_Method f)
           
 void visitFPUTFIELD(jq_InstanceField f)
           
 void visitFPUTSTATIC(jq_StaticField f)
           
 void visitIGETFIELD(jq_InstanceField f)
           
 void visitIGETSTATIC(jq_StaticField f)
           
 void visitIINVOKE(byte op, jq_Method f)
           
 void visitIPUTFIELD(jq_InstanceField f)
           
 void visitIPUTSTATIC(jq_StaticField f)
           
 void visitLGETFIELD(jq_InstanceField f)
           
 void visitLGETSTATIC(jq_StaticField f)
           
 void visitLINVOKE(byte op, jq_Method f)
           
 void visitLPUTFIELD(jq_InstanceField f)
           
 void visitLPUTSTATIC(jq_StaticField f)
           
 void visitSGETFIELD(jq_InstanceField f)
           
 void visitSGETSTATIC(jq_StaticField f)
           
 void visitSPUTFIELD(jq_InstanceField f)
           
 void visitSPUTSTATIC(jq_StaticField f)
           
 void visitVINVOKE(byte op, jq_Method f)
           
 void visitZGETFIELD(jq_InstanceField f)
           
 void visitZGETSTATIC(jq_StaticField f)
           
 void visitZPUTFIELD(jq_InstanceField f)
           
 void visitZPUTSTATIC(jq_StaticField f)
           
 
Methods inherited from class joeq.Compiler.BytecodeAnalysis.BytecodeVisitor
forwardTraversal, tryResolve, tryResolve, tryResolve, tryResolve, tryResolve, updateCPIndex, updateMemberReference, visitAALOAD, visitAASTORE, visitACONST, visitALOAD, visitARETURN, visitARRAYLENGTH, visitASTORE, visitATHROW, visitBALOAD, visitBASTORE, visitBytecode, visitCALOAD, visitCASTORE, visitCHECKCAST, visitD2F, visitD2I, visitD2L, visitDALOAD, visitDASTORE, visitDBINOP, visitDCMP2, visitDCONST, visitDLOAD, visitDRETURN, visitDSTORE, visitDUNOP, visitDUP_x1, visitDUP_x2, visitDUP, visitDUP2_x1, visitDUP2_x2, visitDUP2, visitF2D, visitF2I, visitF2L, visitFALOAD, visitFASTORE, visitFBINOP, visitFCMP2, visitFCONST, visitFLOAD, visitFRETURN, visitFSTORE, visitFUNOP, visitGOTO, visitI2B, visitI2C, visitI2D, visitI2F, visitI2L, visitI2S, visitIALOAD, visitIASTORE, visitIBINOP, visitICONST, visitIF, visitIFCMP, visitIFREF, visitIFREFCMP, visitIINC, visitILOAD, visitINSTANCEOF, visitIRETURN, visitISHIFT, visitISTORE, visitIUNOP, visitJSR, visitL2D, visitL2F, visitL2I, visitLALOAD, visitLASTORE, visitLBINOP, visitLCMP2, visitLCONST, visitLLOAD, visitLOOKUPSWITCH, visitLRETURN, visitLSHIFT, visitLSTORE, visitLUNOP, visitMONITOR, visitMULTINEWARRAY, visitNEW, visitNEWARRAY, visitNOP, visitPEI, visitPOP, visitPOP2, visitRET, visitSALOAD, visitSASTORE, visitSWAP, visitTABLESWITCH, visitVRETURN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INTRA_CLASS

public static final boolean INTRA_CLASS
See Also:
Constant Field Values

ALWAYS_TRACE

public static final boolean ALWAYS_TRACE
See Also:
Constant Field Values

results

public static Map results

mod

protected Set mod

ref

protected Set ref
Constructor Detail

ModRefAnalysis

public ModRefAnalysis(jq_Method m)
Creates new ModRefAnalysis

Method Detail

getMod

public Set getMod()

getRef

public Set getRef()

visitIGETSTATIC

public void visitIGETSTATIC(jq_StaticField f)
Overrides:
visitIGETSTATIC in class BytecodeVisitor

visitLGETSTATIC

public void visitLGETSTATIC(jq_StaticField f)
Overrides:
visitLGETSTATIC in class BytecodeVisitor

visitFGETSTATIC

public void visitFGETSTATIC(jq_StaticField f)
Overrides:
visitFGETSTATIC in class BytecodeVisitor

visitDGETSTATIC

public void visitDGETSTATIC(jq_StaticField f)
Overrides:
visitDGETSTATIC in class BytecodeVisitor

visitAGETSTATIC

public void visitAGETSTATIC(jq_StaticField f)
Overrides:
visitAGETSTATIC in class BytecodeVisitor

visitZGETSTATIC

public void visitZGETSTATIC(jq_StaticField f)
Overrides:
visitZGETSTATIC in class BytecodeVisitor

visitBGETSTATIC

public void visitBGETSTATIC(jq_StaticField f)
Overrides:
visitBGETSTATIC in class BytecodeVisitor

visitCGETSTATIC

public void visitCGETSTATIC(jq_StaticField f)
Overrides:
visitCGETSTATIC in class BytecodeVisitor

visitSGETSTATIC

public void visitSGETSTATIC(jq_StaticField f)
Overrides:
visitSGETSTATIC in class BytecodeVisitor

visitIPUTSTATIC

public void visitIPUTSTATIC(jq_StaticField f)
Overrides:
visitIPUTSTATIC in class BytecodeVisitor

visitLPUTSTATIC

public void visitLPUTSTATIC(jq_StaticField f)
Overrides:
visitLPUTSTATIC in class BytecodeVisitor

visitFPUTSTATIC

public void visitFPUTSTATIC(jq_StaticField f)
Overrides:
visitFPUTSTATIC in class BytecodeVisitor

visitDPUTSTATIC

public void visitDPUTSTATIC(jq_StaticField f)
Overrides:
visitDPUTSTATIC in class BytecodeVisitor

visitAPUTSTATIC

public void visitAPUTSTATIC(jq_StaticField f)
Overrides:
visitAPUTSTATIC in class BytecodeVisitor

visitZPUTSTATIC

public void visitZPUTSTATIC(jq_StaticField f)
Overrides:
visitZPUTSTATIC in class BytecodeVisitor

visitBPUTSTATIC

public void visitBPUTSTATIC(jq_StaticField f)
Overrides:
visitBPUTSTATIC in class BytecodeVisitor

visitCPUTSTATIC

public void visitCPUTSTATIC(jq_StaticField f)
Overrides:
visitCPUTSTATIC in class BytecodeVisitor

visitSPUTSTATIC

public void visitSPUTSTATIC(jq_StaticField f)
Overrides:
visitSPUTSTATIC in class BytecodeVisitor

visitIGETFIELD

public void visitIGETFIELD(jq_InstanceField f)
Overrides:
visitIGETFIELD in class BytecodeVisitor

visitLGETFIELD

public void visitLGETFIELD(jq_InstanceField f)
Overrides:
visitLGETFIELD in class BytecodeVisitor

visitFGETFIELD

public void visitFGETFIELD(jq_InstanceField f)
Overrides:
visitFGETFIELD in class BytecodeVisitor

visitDGETFIELD

public void visitDGETFIELD(jq_InstanceField f)
Overrides:
visitDGETFIELD in class BytecodeVisitor

visitAGETFIELD

public void visitAGETFIELD(jq_InstanceField f)
Overrides:
visitAGETFIELD in class BytecodeVisitor

visitBGETFIELD

public void visitBGETFIELD(jq_InstanceField f)
Overrides:
visitBGETFIELD in class BytecodeVisitor

visitCGETFIELD

public void visitCGETFIELD(jq_InstanceField f)
Overrides:
visitCGETFIELD in class BytecodeVisitor

visitSGETFIELD

public void visitSGETFIELD(jq_InstanceField f)
Overrides:
visitSGETFIELD in class BytecodeVisitor

visitZGETFIELD

public void visitZGETFIELD(jq_InstanceField f)
Overrides:
visitZGETFIELD in class BytecodeVisitor

visitIPUTFIELD

public void visitIPUTFIELD(jq_InstanceField f)
Overrides:
visitIPUTFIELD in class BytecodeVisitor

visitLPUTFIELD

public void visitLPUTFIELD(jq_InstanceField f)
Overrides:
visitLPUTFIELD in class BytecodeVisitor

visitFPUTFIELD

public void visitFPUTFIELD(jq_InstanceField f)
Overrides:
visitFPUTFIELD in class BytecodeVisitor

visitDPUTFIELD

public void visitDPUTFIELD(jq_InstanceField f)
Overrides:
visitDPUTFIELD in class BytecodeVisitor

visitAPUTFIELD

public void visitAPUTFIELD(jq_InstanceField f)
Overrides:
visitAPUTFIELD in class BytecodeVisitor

visitBPUTFIELD

public void visitBPUTFIELD(jq_InstanceField f)
Overrides:
visitBPUTFIELD in class BytecodeVisitor

visitCPUTFIELD

public void visitCPUTFIELD(jq_InstanceField f)
Overrides:
visitCPUTFIELD in class BytecodeVisitor

visitSPUTFIELD

public void visitSPUTFIELD(jq_InstanceField f)
Overrides:
visitSPUTFIELD in class BytecodeVisitor

visitZPUTFIELD

public void visitZPUTFIELD(jq_InstanceField f)
Overrides:
visitZPUTFIELD in class BytecodeVisitor

handleInvoke

protected void handleInvoke(jq_Method target)

invokeHelper

protected void invokeHelper(byte op,
                            jq_Method f)

visitIINVOKE

public void visitIINVOKE(byte op,
                         jq_Method f)
Overrides:
visitIINVOKE in class BytecodeVisitor

visitLINVOKE

public void visitLINVOKE(byte op,
                         jq_Method f)
Overrides:
visitLINVOKE in class BytecodeVisitor

visitFINVOKE

public void visitFINVOKE(byte op,
                         jq_Method f)
Overrides:
visitFINVOKE in class BytecodeVisitor

visitDINVOKE

public void visitDINVOKE(byte op,
                         jq_Method f)
Overrides:
visitDINVOKE in class BytecodeVisitor

visitAINVOKE

public void visitAINVOKE(byte op,
                         jq_Method f)
Overrides:
visitAINVOKE in class BytecodeVisitor

visitVINVOKE

public void visitVINVOKE(byte op,
                         jq_Method f)
Overrides:
visitVINVOKE in class BytecodeVisitor

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2008 John Whaley. All Rights Reserved.