joeq.Compiler.BytecodeAnalysis
Class Bytecodes.CPInstruction

java.lang.Object
  extended by joeq.Compiler.BytecodeAnalysis.Bytecodes.Instruction
      extended by joeq.Compiler.BytecodeAnalysis.Bytecodes.CPInstruction
All Implemented Interfaces:
Serializable, Cloneable, Bytecodes.TypedInstruction
Direct Known Subclasses:
Bytecodes.ANEWARRAY, Bytecodes.CHECKCAST, Bytecodes.FieldOrMethod, Bytecodes.INSTANCEOF, Bytecodes.LDC, Bytecodes.LDC2_W, Bytecodes.MULTIANEWARRAY, Bytecodes.NEW
Enclosing interface:
Bytecodes

public abstract static class Bytecodes.CPInstruction
extends Bytecodes.Instruction
implements Bytecodes.TypedInstruction

See Also:
Serialized Form

Field Summary
protected  char index
           
protected  Object o
           
 
Fields inherited from class joeq.Compiler.BytecodeAnalysis.Bytecodes.Instruction
length, opcode
 
Constructor Summary
protected Bytecodes.CPInstruction(short opcode, Object o)
           
 
Method Summary
 void dump(DataOutputStream out)
          Dump instruction as byte code to stream out.
 int getIndex()
           
 Object getObject()
           
 jq_Type getType()
           
protected  void initFromFile(jq_ConstantPool cp, jwutil.io.ByteSequence bytes, boolean wide)
          Read needed data (i.e., index) from file.
 void setIndex(jq_ConstantPool.ConstantPoolRebuilder cpr)
          Set the index to constant pool.
 void setObject(Object o)
           
 String toString()
           
 String toString(boolean verbose)
          Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"
 
Methods inherited from class joeq.Compiler.BytecodeAnalysis.Bytecodes.Instruction
accept, consumeStack, copy, getLength, getOpcode, produceStack, readInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

o

protected Object o

index

protected char index
Constructor Detail

Bytecodes.CPInstruction

protected Bytecodes.CPInstruction(short opcode,
                                  Object o)
Parameters:
opcode - instruction opcode
o - referred to in constant pool
Method Detail

dump

public void dump(DataOutputStream out)
          throws IOException
Dump instruction as byte code to stream out.

Overrides:
dump in class Bytecodes.Instruction
Parameters:
out - Output stream
Throws:
IOException

toString

public String toString(boolean verbose)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"

Overrides:
toString in class Bytecodes.Instruction
Parameters:
verbose - long/short format switch
Returns:
mnemonic for instruction

toString

public String toString()
Overrides:
toString in class Bytecodes.Instruction
Returns:
mnemonic for instruction with symbolic references resolved

initFromFile

protected void initFromFile(jq_ConstantPool cp,
                            jwutil.io.ByteSequence bytes,
                            boolean wide)
                     throws IOException
Read needed data (i.e., index) from file.

Overrides:
initFromFile in class Bytecodes.Instruction
Parameters:
bytes - input stream
wide - wide prefix?
cp - constant pool of class we are reading
Throws:
IOException

getIndex

public final int getIndex()
Returns:
index in constant pool referred by this instruction.

setIndex

public void setIndex(jq_ConstantPool.ConstantPoolRebuilder cpr)
Set the index to constant pool.

Parameters:
cpr - constant pool rebuilder

getObject

public Object getObject()

setObject

public void setObject(Object o)

getType

public jq_Type getType()
Specified by:
getType in interface Bytecodes.TypedInstruction
Returns:
type related with this instruction.


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