Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Compil3r.Quad
Class BytecodeToQuad  view BytecodeToQuad download BytecodeToQuad.java

java.lang.Object
  extended byCompil3r.BytecodeAnalysis.BytecodeVisitor
      extended byCompil3r.Quad.BytecodeToQuad
All Implemented Interfaces:
Clazz.jq_ClassFileConstants

public class BytecodeToQuad
extends Compil3r.BytecodeAnalysis.BytecodeVisitor

Converts stack-based Java bytecode to Quad intermediate format. This utilizes the ControlFlowGraph in the BytecodeAnalysis package to build up a control flow graph, then iterates over the graph to generate the Quad code.

Version:
$Id: BytecodeToQuad.java,v 1.58 2003/06/18 00:00:53 mcmartin Exp $

Nested Class Summary
static class BytecodeToQuad.AbstractState
          Class used to store the abstract state of the bytecode-to-quad converter.
static class BytecodeToQuad.jq_ReturnAddressType
           
(package private) static interface BytecodeToQuad.UnsafeHelper
           
 
Field Summary
private static BytecodeToQuad.UnsafeHelper _unsafe
           
static UTF.Utf8 address32
           
static UTF.Utf8 addressOf
           
static UTF.Utf8 align
           
static UTF.Utf8 alloca
           
static boolean ALWAYS_TRACE
           
static UTF.Utf8 asObject
           
static UTF.Utf8 asReferenceType
           
static UTF.Utf8 atomicAdd
           
static UTF.Utf8 atomicAnd
           
static UTF.Utf8 atomicCas4
           
static UTF.Utf8 atomicSub
           
private  Compil3r.BytecodeAnalysis.BasicBlock bc_bb
           
private  Compil3r.BytecodeAnalysis.ControlFlowGraph bc_cfg
           
private  BytecodeToQuad.AbstractState current_state
           
(package private)  Operand currentGuard
           
static UTF.Utf8 difference
           
static boolean ELIM_NULL_CHECKS
           
private  boolean endBasicBlock
           
private  boolean endsWithRET
           
static UTF.Utf8 getBasePointer
           
static UTF.Utf8 getNull
           
static UTF.Utf8 getStackPointer
           
static UTF.Utf8 isNull
           
(package private)  java.util.Map jsr_states
           
static UTF.Utf8 max
           
static UTF.Utf8 min
           
static UTF.Utf8 offset
           
static UTF.Utf8 peek
           
static UTF.Utf8 peek1
           
static UTF.Utf8 peek2
           
static UTF.Utf8 peek4
           
static UTF.Utf8 peek8
           
static UTF.Utf8 poke
           
static UTF.Utf8 poke1
           
static UTF.Utf8 poke2
           
static UTF.Utf8 poke4
           
static UTF.Utf8 poke8
           
private  BasicBlock quad_bb
           
private  BasicBlock[] quad_bbs
           
private  ControlFlowGraph quad_cfg
           
private  java.util.HashMap quad2bci
           
private  java.util.LinkedList regenerate
           
private  RegisterFactory rf
           
static UTF.Utf8 size
           
private  BytecodeToQuad.AbstractState[] start_states
           
static UTF.Utf8 stringRep
           
static UTF.Utf8 to32BitValue
           
private  boolean uncond_branch
           
private  boolean[] visited
           
 
Fields inherited from class Compil3r.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, TRACE, UNOP_NEG, unopnames
 
Fields inherited from interface Clazz.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_PREPARING, STATE_SFINITIALIZED, STATE_SFINITIALIZING, STATE_UNLOADED, STATE_VERIFIED, 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
 
Constructor Summary
BytecodeToQuad(Clazz.jq_Method method)
          Initializes the conversion from bytecode to quad format for the given method.
 
Method Summary
private  void ADDRESShelper(Clazz.jq_Method m, Operator.Invoke oper)
           
private  void ALOADhelper(Operator.ALoad operator, Clazz.jq_Type t)
           
(package private)  void appendQuad(Quad q)
           
private  void ASTOREhelper(Operator.AStore operator, Clazz.jq_Type t)
           
private static BytecodeToQuad.UnsafeHelper attemptDelegate(java.lang.String s)
           
private  void BINOPhelper(Operator.Binary operator, Clazz.jq_Type tr, Clazz.jq_Type t1, Clazz.jq_Type t2, boolean zero_check)
           
(package private)  void clearCurrentGuard()
           
 ControlFlowGraph convert()
          Perform conversion process from bytecode to quad.
private  void do_DUP_x1()
           
(package private) static Clazz.jq_Type getArrayElementTypeOf(Operand op)
           
(package private)  Operand getCurrentGuard()
           
private  void GETFIELDhelper(Clazz.jq_InstanceField f, Operator.Getfield oper1, Operator.Getfield oper2)
           
(package private) static Operand getGuard(Operand op)
           
(package private)  BytecodeToQuad.AbstractState getJSRState(Compil3r.BytecodeAnalysis.BasicBlock bb)
           
(package private)  int getLocalNumber(RegisterFactory.Register r, Clazz.jq_Type t)
           
(package private)  java.util.Map getQuadToBytecodeMap()
          return quad->bytecode map, may be incomplete
(package private)  Operand.RegisterOperand getStackRegister(Clazz.jq_Type type)
           
(package private)  Operand.RegisterOperand getStackRegister(Clazz.jq_Type type, int i)
           
private  void GETSTATIChelper(Clazz.jq_StaticField f, Operator.Getstatic oper1, Operator.Getstatic oper2)
           
(package private) static Clazz.jq_Type getTypeOf(Operand op)
           
(package private) static boolean hasGuard(Operand.RegisterOperand rop)
           
private  void INVOKEhelper(Operator.Invoke oper, Clazz.jq_Method f, Clazz.jq_Type returnType, boolean instance_call)
           
private  boolean isEndOfBB()
           
(package private)  Operand.RegisterOperand makeGuardReg()
           
(package private)  Operand.RegisterOperand makeLocal(int i, Clazz.jq_Type type)
           
(package private)  Operand.RegisterOperand makeLocal(int i, Operand.RegisterOperand rop)
           
private  void mergeStateWith(Compil3r.BytecodeAnalysis.BasicBlock bc_bb)
           
private  void mergeStateWith(Compil3r.BytecodeAnalysis.ExceptionHandler eh)
           
(package private)  void mergeStateWithAllExHandlers(boolean cfgEdgeToExit)
           
(package private)  void mergeStateWithArithExHandler(boolean cfgEdgeToExit)
           
(package private)  void mergeStateWithArrayBoundsExHandler(boolean cfgEdgeToExit)
           
(package private)  void mergeStateWithNullPtrExHandler(boolean cfgEdgeToExit)
           
(package private)  void mergeStateWithObjArrayStoreExHandler(boolean cfgEdgeToExit)
           
(package private)  boolean performBoundsCheck(Operand ref, Operand index)
           
(package private)  boolean performCheckStore(Operand.RegisterOperand ref, Operand elem)
           
(package private)  boolean performNullCheck(Operand op)
           
(package private)  boolean performZeroCheck(Operand op)
           
private  void PUTFIELDhelper(Clazz.jq_InstanceField f, Operator.Putfield oper1, Operator.Putfield oper2)
           
private  void PUTSTATIChelper(Clazz.jq_StaticField f, Operator.Putstatic oper1, Operator.Putstatic oper2)
           
private  void replaceLocalsOnStack(int index, Clazz.jq_Type type)
           
private  void saveStackIntoRegisters()
           
(package private)  void setCurrentGuard(Operand guard)
           
(package private) static void setGuard(Operand.RegisterOperand rop, Operand guard)
           
(package private)  void setJSRState(Compil3r.BytecodeAnalysis.BasicBlock bb, BytecodeToQuad.AbstractState s)
           
private  void STOREhelper(int i, Clazz.jq_Type type)
           
 java.lang.String toString()
          Returns a string with the name of the pass and the method being converted.
 void traverseBB(Compil3r.BytecodeAnalysis.BasicBlock bc_bb)
           
 void UNOPhelper(Operator.Unary operator, Clazz.jq_Type tr, Clazz.jq_Type t1)
           
private  void UNSAFEhelper(Clazz.jq_Method m, Operator.Invoke oper)
           
 void visitAALOAD()
           
 void visitAASTORE()
           
 void visitACONST(java.lang.Object s)
           
 void visitAGETFIELD(Clazz.jq_InstanceField f)
           
 void visitAGETSTATIC(Clazz.jq_StaticField f)
           
 void visitAINVOKE(byte op, Clazz.jq_Method f)
           
 void visitALOAD(int i)
           
 void visitAPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitAPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitARETURN()
           
 void visitARRAYLENGTH()
           
 void visitASTORE(int i)
           
 void visitATHROW()
           
 void visitBALOAD()
           
 void visitBASTORE()
           
 void visitBGETFIELD(Clazz.jq_InstanceField f)
           
 void visitBGETSTATIC(Clazz.jq_StaticField f)
           
 void visitBPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitBPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitCALOAD()
           
 void visitCASTORE()
           
 void visitCGETFIELD(Clazz.jq_InstanceField f)
           
 void visitCGETSTATIC(Clazz.jq_StaticField f)
           
 void visitCHECKCAST(Clazz.jq_Type f)
           
 void visitCPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitCPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitD2F()
           
 void visitD2I()
           
 void visitD2L()
           
 void visitDALOAD()
           
 void visitDASTORE()
           
 void visitDBINOP(byte op)
           
 void visitDCMP2(byte op)
           
 void visitDCONST(double c)
           
 void visitDGETFIELD(Clazz.jq_InstanceField f)
           
 void visitDGETSTATIC(Clazz.jq_StaticField f)
           
 void visitDINVOKE(byte op, Clazz.jq_Method f)
           
 void visitDLOAD(int i)
           
 void visitDPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitDPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitDRETURN()
           
 void visitDSTORE(int i)
           
 void visitDUNOP(byte op)
           
 void visitDUP_x1()
           
 void visitDUP_x2()
           
 void visitDUP()
           
 void visitDUP2_x1()
           
 void visitDUP2_x2()
           
 void visitDUP2()
           
 void visitF2D()
           
 void visitF2I()
           
 void visitF2L()
           
 void visitFALOAD()
           
 void visitFASTORE()
           
 void visitFBINOP(byte op)
           
 void visitFCMP2(byte op)
           
 void visitFCONST(float c)
           
 void visitFGETFIELD(Clazz.jq_InstanceField f)
           
 void visitFGETSTATIC(Clazz.jq_StaticField f)
           
 void visitFINVOKE(byte op, Clazz.jq_Method f)
           
 void visitFLOAD(int i)
           
 void visitFPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitFPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitFRETURN()
           
 void visitFSTORE(int i)
           
 void visitFUNOP(byte op)
           
 void visitGOTO(int target)
           
 void visitI2B()
           
 void visitI2C()
           
 void visitI2D()
           
 void visitI2F()
           
 void visitI2L()
           
 void visitI2S()
           
 void visitIALOAD()
           
 void visitIASTORE()
           
 void visitIBINOP(byte op)
           
 void visitICONST(int c)
           
 void visitIF(byte op, int target)
           
 void visitIFCMP(byte op, int target)
           
 void visitIFREF(byte op, int target)
           
 void visitIFREFCMP(byte op, int target)
           
 void visitIGETFIELD(Clazz.jq_InstanceField f)
           
 void visitIGETSTATIC(Clazz.jq_StaticField f)
           
 void visitIINC(int i, int v)
           
 void visitIINVOKE(byte op, Clazz.jq_Method f)
           
 void visitILOAD(int i)
           
 void visitINSTANCEOF(Clazz.jq_Type f)
           
 void visitIPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitIPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitIRETURN()
           
 void visitISHIFT(byte op)
           
 void visitISTORE(int i)
           
 void visitIUNOP(byte op)
           
 void visitJSR(int target)
           
 void visitL2D()
           
 void visitL2F()
           
 void visitL2I()
           
 void visitLALOAD()
           
 void visitLASTORE()
           
 void visitLBINOP(byte op)
           
 void visitLCMP2()
           
 void visitLCONST(long c)
           
 void visitLGETFIELD(Clazz.jq_InstanceField f)
           
 void visitLGETSTATIC(Clazz.jq_StaticField f)
           
 void visitLINVOKE(byte op, Clazz.jq_Method f)
           
 void visitLLOAD(int i)
           
 void visitLOOKUPSWITCH(int default_target, int[] values, int[] targets)
           
 void visitLPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitLPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitLRETURN()
           
 void visitLSHIFT(byte op)
           
 void visitLSTORE(int i)
           
 void visitLUNOP(byte op)
           
 void visitMONITOR(byte op)
           
 void visitMULTINEWARRAY(Clazz.jq_Type f, char dim)
           
 void visitNEW(Clazz.jq_Type f)
           
 void visitNEWARRAY(Clazz.jq_Array f)
           
 void visitNOP()
           
 void visitPOP()
           
 void visitPOP2()
           
 void visitRET(int i)
           
 void visitSALOAD()
           
 void visitSASTORE()
           
 void visitSGETFIELD(Clazz.jq_InstanceField f)
           
 void visitSGETSTATIC(Clazz.jq_StaticField f)
           
 void visitSPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitSPUTSTATIC(Clazz.jq_StaticField f)
           
 void visitSWAP()
           
 void visitTABLESWITCH(int default_target, int low, int high, int[] targets)
           
 void visitVINVOKE(byte op, Clazz.jq_Method f)
           
 void visitVRETURN()
           
 void visitZGETFIELD(Clazz.jq_InstanceField f)
           
 void visitZGETSTATIC(Clazz.jq_StaticField f)
           
 void visitZPUTFIELD(Clazz.jq_InstanceField f)
           
 void visitZPUTSTATIC(Clazz.jq_StaticField f)
           
 
Methods inherited from class Compil3r.BytecodeAnalysis.BytecodeVisitor
forwardTraversal, resolve, resolve, resolve, resolve, resolve, updateCPIndex, updateMemberReference, visitBytecode, visitPEI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

quad_cfg

private ControlFlowGraph quad_cfg

quad_bb

private BasicBlock quad_bb

bc_cfg

private Compil3r.BytecodeAnalysis.ControlFlowGraph bc_cfg

bc_bb

private Compil3r.BytecodeAnalysis.BasicBlock bc_bb

quad_bbs

private BasicBlock[] quad_bbs

rf

private RegisterFactory rf

visited

private boolean[] visited

uncond_branch

private boolean uncond_branch

regenerate

private java.util.LinkedList regenerate

quad2bci

private java.util.HashMap quad2bci

ALWAYS_TRACE

public static boolean ALWAYS_TRACE

endBasicBlock

private boolean endBasicBlock

endsWithRET

private boolean endsWithRET

currentGuard

Operand currentGuard

start_states

private BytecodeToQuad.AbstractState[] start_states

current_state

private BytecodeToQuad.AbstractState current_state

jsr_states

java.util.Map jsr_states

peek

public static final UTF.Utf8 peek

peek1

public static final UTF.Utf8 peek1

peek2

public static final UTF.Utf8 peek2

peek4

public static final UTF.Utf8 peek4

peek8

public static final UTF.Utf8 peek8

poke

public static final UTF.Utf8 poke

poke1

public static final UTF.Utf8 poke1

poke2

public static final UTF.Utf8 poke2

poke4

public static final UTF.Utf8 poke4

poke8

public static final UTF.Utf8 poke8

offset

public static final UTF.Utf8 offset

align

public static final UTF.Utf8 align

difference

public static final UTF.Utf8 difference

isNull

public static final UTF.Utf8 isNull

addressOf

public static final UTF.Utf8 addressOf

address32

public static final UTF.Utf8 address32

asObject

public static final UTF.Utf8 asObject

asReferenceType

public static final UTF.Utf8 asReferenceType

to32BitValue

public static final UTF.Utf8 to32BitValue

stringRep

public static final UTF.Utf8 stringRep

getNull

public static final UTF.Utf8 getNull

size

public static final UTF.Utf8 size

getBasePointer

public static final UTF.Utf8 getBasePointer

getStackPointer

public static final UTF.Utf8 getStackPointer

alloca

public static final UTF.Utf8 alloca

atomicAdd

public static final UTF.Utf8 atomicAdd

atomicSub

public static final UTF.Utf8 atomicSub

atomicCas4

public static final UTF.Utf8 atomicCas4

atomicAnd

public static final UTF.Utf8 atomicAnd

min

public static final UTF.Utf8 min

max

public static final UTF.Utf8 max

ELIM_NULL_CHECKS

public static final boolean ELIM_NULL_CHECKS
See Also:
Constant Field Values

_unsafe

private static BytecodeToQuad.UnsafeHelper _unsafe
Constructor Detail

BytecodeToQuad

public BytecodeToQuad(Clazz.jq_Method method)
Initializes the conversion from bytecode to quad format for the given method.

Method Detail

toString

public java.lang.String toString()
Returns a string with the name of the pass and the method being converted.


convert

public ControlFlowGraph convert()
Perform conversion process from bytecode to quad.


traverseBB

public void traverseBB(Compil3r.BytecodeAnalysis.BasicBlock bc_bb)

isEndOfBB

private boolean isEndOfBB()

mergeStateWith

private void mergeStateWith(Compil3r.BytecodeAnalysis.BasicBlock bc_bb)

mergeStateWith

private void mergeStateWith(Compil3r.BytecodeAnalysis.ExceptionHandler eh)

saveStackIntoRegisters

private void saveStackIntoRegisters()

replaceLocalsOnStack

private void replaceLocalsOnStack(int index,
                                  Clazz.jq_Type type)

appendQuad

void appendQuad(Quad q)

getQuadToBytecodeMap

java.util.Map getQuadToBytecodeMap()
return quad->bytecode map, may be incomplete


getStackRegister

Operand.RegisterOperand getStackRegister(Clazz.jq_Type type,
                                         int i)

getStackRegister

Operand.RegisterOperand getStackRegister(Clazz.jq_Type type)

makeLocal

Operand.RegisterOperand makeLocal(int i,
                                  Clazz.jq_Type type)

makeLocal

Operand.RegisterOperand makeLocal(int i,
                                  Operand.RegisterOperand rop)

hasGuard

static boolean hasGuard(Operand.RegisterOperand rop)

setGuard

static void setGuard(Operand.RegisterOperand rop,
                     Operand guard)

getGuard

static Operand getGuard(Operand op)

setCurrentGuard

void setCurrentGuard(Operand guard)

clearCurrentGuard

void clearCurrentGuard()

getCurrentGuard

Operand getCurrentGuard()

visitNOP

public void visitNOP()

visitACONST

public void visitACONST(java.lang.Object s)

visitICONST

public void visitICONST(int c)

visitLCONST

public void visitLCONST(long c)

visitFCONST

public void visitFCONST(float c)

visitDCONST

public void visitDCONST(double c)

visitILOAD

public void visitILOAD(int i)

visitLLOAD

public void visitLLOAD(int i)

visitFLOAD

public void visitFLOAD(int i)

visitDLOAD

public void visitDLOAD(int i)

visitALOAD

public void visitALOAD(int i)

STOREhelper

private void STOREhelper(int i,
                         Clazz.jq_Type type)

visitISTORE

public void visitISTORE(int i)

visitLSTORE

public void visitLSTORE(int i)

visitFSTORE

public void visitFSTORE(int i)

visitDSTORE

public void visitDSTORE(int i)

visitASTORE

public void visitASTORE(int i)

ALOADhelper

private void ALOADhelper(Operator.ALoad operator,
                         Clazz.jq_Type t)

visitIALOAD

public void visitIALOAD()

visitLALOAD

public void visitLALOAD()

visitFALOAD

public void visitFALOAD()

visitDALOAD

public void visitDALOAD()

visitAALOAD

public void visitAALOAD()

visitBALOAD

public void visitBALOAD()

visitCALOAD

public void visitCALOAD()

visitSALOAD

public void visitSALOAD()

ASTOREhelper

private void ASTOREhelper(Operator.AStore operator,
                          Clazz.jq_Type t)

visitIASTORE

public void visitIASTORE()

visitLASTORE

public void visitLASTORE()

visitFASTORE

public void visitFASTORE()

visitDASTORE

public void visitDASTORE()

visitAASTORE

public void visitAASTORE()

visitBASTORE

public void visitBASTORE()

visitCASTORE

public void visitCASTORE()

visitSASTORE

public void visitSASTORE()

visitPOP

public void visitPOP()

visitPOP2

public void visitPOP2()

visitDUP

public void visitDUP()

do_DUP_x1

private void do_DUP_x1()

visitDUP_x1

public void visitDUP_x1()

visitDUP_x2

public void visitDUP_x2()

visitDUP2

public void visitDUP2()

visitDUP2_x1

public void visitDUP2_x1()

visitDUP2_x2

public void visitDUP2_x2()

visitSWAP

public void visitSWAP()

BINOPhelper

private void BINOPhelper(Operator.Binary operator,
                         Clazz.jq_Type tr,
                         Clazz.jq_Type t1,
                         Clazz.jq_Type t2,
                         boolean zero_check)

visitIBINOP

public void visitIBINOP(byte op)

visitLBINOP

public void visitLBINOP(byte op)

visitFBINOP

public void visitFBINOP(byte op)

visitDBINOP

public void visitDBINOP(byte op)

UNOPhelper

public void UNOPhelper(Operator.Unary operator,
                       Clazz.jq_Type tr,
                       Clazz.jq_Type t1)

visitIUNOP

public void visitIUNOP(byte op)

visitLUNOP

public void visitLUNOP(byte op)

visitFUNOP

public void visitFUNOP(byte op)

visitDUNOP

public void visitDUNOP(byte op)

visitISHIFT

public void visitISHIFT(byte op)

visitLSHIFT

public void visitLSHIFT(byte op)

visitIINC

public void visitIINC(int i,
                      int v)

visitI2L

public void visitI2L()

visitI2F

public void visitI2F()

visitI2D

public void visitI2D()

visitL2I

public void visitL2I()

visitL2F

public void visitL2F()

visitL2D

public void visitL2D()

visitF2I

public void visitF2I()

visitF2L

public void visitF2L()

visitF2D

public void visitF2D()

visitD2I

public void visitD2I()

visitD2L

public void visitD2L()

visitD2F

public void visitD2F()

visitI2B

public void visitI2B()

visitI2C

public void visitI2C()

visitI2S

public void visitI2S()

visitLCMP2

public void visitLCMP2()

visitFCMP2

public void visitFCMP2(byte op)

visitDCMP2

public void visitDCMP2(byte op)

visitIF

public void visitIF(byte op,
                    int target)

visitIFREF

public void visitIFREF(byte op,
                       int target)

visitIFCMP

public void visitIFCMP(byte op,
                       int target)

visitIFREFCMP

public void visitIFREFCMP(byte op,
                          int target)

visitGOTO

public void visitGOTO(int target)

setJSRState

void setJSRState(Compil3r.BytecodeAnalysis.BasicBlock bb,
                 BytecodeToQuad.AbstractState s)

getJSRState

BytecodeToQuad.AbstractState getJSRState(Compil3r.BytecodeAnalysis.BasicBlock bb)

visitJSR

public void visitJSR(int target)

visitRET

public void visitRET(int i)

visitTABLESWITCH

public void visitTABLESWITCH(int default_target,
                             int low,
                             int high,
                             int[] targets)

visitLOOKUPSWITCH

public void visitLOOKUPSWITCH(int default_target,
                              int[] values,
                              int[] targets)

visitIRETURN

public void visitIRETURN()

visitLRETURN

public void visitLRETURN()

visitFRETURN

public void visitFRETURN()

visitDRETURN

public void visitDRETURN()

visitARETURN

public void visitARETURN()

visitVRETURN

public void visitVRETURN()

GETSTATIChelper

private void GETSTATIChelper(Clazz.jq_StaticField f,
                             Operator.Getstatic oper1,
                             Operator.Getstatic oper2)

visitIGETSTATIC

public void visitIGETSTATIC(Clazz.jq_StaticField f)

visitLGETSTATIC

public void visitLGETSTATIC(Clazz.jq_StaticField f)

visitFGETSTATIC

public void visitFGETSTATIC(Clazz.jq_StaticField f)

visitDGETSTATIC

public void visitDGETSTATIC(Clazz.jq_StaticField f)

visitAGETSTATIC

public void visitAGETSTATIC(Clazz.jq_StaticField f)

visitZGETSTATIC

public void visitZGETSTATIC(Clazz.jq_StaticField f)

visitBGETSTATIC

public void visitBGETSTATIC(Clazz.jq_StaticField f)

visitCGETSTATIC

public void visitCGETSTATIC(Clazz.jq_StaticField f)

visitSGETSTATIC

public void visitSGETSTATIC(Clazz.jq_StaticField f)

PUTSTATIChelper

private void PUTSTATIChelper(Clazz.jq_StaticField f,
                             Operator.Putstatic oper1,
                             Operator.Putstatic oper2)

visitIPUTSTATIC

public void visitIPUTSTATIC(Clazz.jq_StaticField f)

visitLPUTSTATIC

public void visitLPUTSTATIC(Clazz.jq_StaticField f)

visitFPUTSTATIC

public void visitFPUTSTATIC(Clazz.jq_StaticField f)

visitDPUTSTATIC

public void visitDPUTSTATIC(Clazz.jq_StaticField f)

visitAPUTSTATIC

public void visitAPUTSTATIC(Clazz.jq_StaticField f)

visitZPUTSTATIC

public void visitZPUTSTATIC(Clazz.jq_StaticField f)

visitBPUTSTATIC

public void visitBPUTSTATIC(Clazz.jq_StaticField f)

visitCPUTSTATIC

public void visitCPUTSTATIC(Clazz.jq_StaticField f)

visitSPUTSTATIC

public void visitSPUTSTATIC(Clazz.jq_StaticField f)

GETFIELDhelper

private void GETFIELDhelper(Clazz.jq_InstanceField f,
                            Operator.Getfield oper1,
                            Operator.Getfield oper2)

visitIGETFIELD

public void visitIGETFIELD(Clazz.jq_InstanceField f)

visitLGETFIELD

public void visitLGETFIELD(Clazz.jq_InstanceField f)

visitFGETFIELD

public void visitFGETFIELD(Clazz.jq_InstanceField f)

visitDGETFIELD

public void visitDGETFIELD(Clazz.jq_InstanceField f)

visitAGETFIELD

public void visitAGETFIELD(Clazz.jq_InstanceField f)

visitBGETFIELD

public void visitBGETFIELD(Clazz.jq_InstanceField f)

visitCGETFIELD

public void visitCGETFIELD(Clazz.jq_InstanceField f)

visitSGETFIELD

public void visitSGETFIELD(Clazz.jq_InstanceField f)

visitZGETFIELD

public void visitZGETFIELD(Clazz.jq_InstanceField f)

PUTFIELDhelper

private void PUTFIELDhelper(Clazz.jq_InstanceField f,
                            Operator.Putfield oper1,
                            Operator.Putfield oper2)

visitIPUTFIELD

public void visitIPUTFIELD(Clazz.jq_InstanceField f)

visitLPUTFIELD

public void visitLPUTFIELD(Clazz.jq_InstanceField f)

visitFPUTFIELD

public void visitFPUTFIELD(Clazz.jq_InstanceField f)

visitDPUTFIELD

public void visitDPUTFIELD(Clazz.jq_InstanceField f)

visitAPUTFIELD

public void visitAPUTFIELD(Clazz.jq_InstanceField f)

visitBPUTFIELD

public void visitBPUTFIELD(Clazz.jq_InstanceField f)

visitCPUTFIELD

public void visitCPUTFIELD(Clazz.jq_InstanceField f)

visitSPUTFIELD

public void visitSPUTFIELD(Clazz.jq_InstanceField f)

visitZPUTFIELD

public void visitZPUTFIELD(Clazz.jq_InstanceField f)

ADDRESShelper

private void ADDRESShelper(Clazz.jq_Method m,
                           Operator.Invoke oper)

UNSAFEhelper

private void UNSAFEhelper(Clazz.jq_Method m,
                          Operator.Invoke oper)

INVOKEhelper

private void INVOKEhelper(Operator.Invoke oper,
                          Clazz.jq_Method f,
                          Clazz.jq_Type returnType,
                          boolean instance_call)

visitIINVOKE

public void visitIINVOKE(byte op,
                         Clazz.jq_Method f)

visitLINVOKE

public void visitLINVOKE(byte op,
                         Clazz.jq_Method f)

visitFINVOKE

public void visitFINVOKE(byte op,
                         Clazz.jq_Method f)

visitDINVOKE

public void visitDINVOKE(byte op,
                         Clazz.jq_Method f)

visitAINVOKE

public void visitAINVOKE(byte op,
                         Clazz.jq_Method f)

visitVINVOKE

public void visitVINVOKE(byte op,
                         Clazz.jq_Method f)

visitNEW

public void visitNEW(Clazz.jq_Type f)

visitNEWARRAY

public void visitNEWARRAY(Clazz.jq_Array f)

visitCHECKCAST

public void visitCHECKCAST(Clazz.jq_Type f)

visitINSTANCEOF

public void visitINSTANCEOF(Clazz.jq_Type f)

visitARRAYLENGTH

public void visitARRAYLENGTH()

visitATHROW

public void visitATHROW()

visitMONITOR

public void visitMONITOR(byte op)

visitMULTINEWARRAY

public void visitMULTINEWARRAY(Clazz.jq_Type f,
                               char dim)

performNullCheck

boolean performNullCheck(Operand op)

performBoundsCheck

boolean performBoundsCheck(Operand ref,
                           Operand index)

performCheckStore

boolean performCheckStore(Operand.RegisterOperand ref,
                          Operand elem)

performZeroCheck

boolean performZeroCheck(Operand op)

getTypeOf

static Clazz.jq_Type getTypeOf(Operand op)

getArrayElementTypeOf

static Clazz.jq_Type getArrayElementTypeOf(Operand op)

mergeStateWithAllExHandlers

void mergeStateWithAllExHandlers(boolean cfgEdgeToExit)

mergeStateWithNullPtrExHandler

void mergeStateWithNullPtrExHandler(boolean cfgEdgeToExit)

mergeStateWithArithExHandler

void mergeStateWithArithExHandler(boolean cfgEdgeToExit)

mergeStateWithArrayBoundsExHandler

void mergeStateWithArrayBoundsExHandler(boolean cfgEdgeToExit)

mergeStateWithObjArrayStoreExHandler

void mergeStateWithObjArrayStoreExHandler(boolean cfgEdgeToExit)

makeGuardReg

Operand.RegisterOperand makeGuardReg()

getLocalNumber

int getLocalNumber(RegisterFactory.Register r,
                   Clazz.jq_Type t)

attemptDelegate

private static BytecodeToQuad.UnsafeHelper attemptDelegate(java.lang.String s)