|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joeq.Compiler.BytecodeAnalysis.Bytecodes.InstructionList
public static class Bytecodes.InstructionList
Constructor Summary | |
---|---|
Bytecodes.InstructionList()
Create (empty) instruction list. |
|
Bytecodes.InstructionList(Bytecodes.BranchInstruction i)
Create instruction list containing one instruction. |
|
Bytecodes.InstructionList(Bytecodes.CompoundInstruction c)
Initialize list with (nonnull) compound instruction. |
|
Bytecodes.InstructionList(Bytecodes.Instruction i)
Create instruction list containing one instruction. |
|
Bytecodes.InstructionList(jq_ConstantPool cp,
byte[] code)
Initialize instruction list from byte array. |
|
Bytecodes.InstructionList(jq_Method m)
|
Method Summary | |
---|---|
void |
accept(Bytecodes.Visitor v)
Convenience method, simply calls accept() on the contained instructions. |
void |
addObserver(Bytecodes.InstructionListObserver o)
Add observer for this object. |
Bytecodes.BranchHandle |
append(Bytecodes.BranchInstruction i)
Append a branch instruction to the end of this list. |
Bytecodes.InstructionHandle |
append(Bytecodes.CompoundInstruction c)
Append a compound instruction. |
Bytecodes.InstructionHandle |
append(Bytecodes.Instruction i)
Append an instruction to the end of this list. |
Bytecodes.InstructionHandle |
append(Bytecodes.Instruction i,
Bytecodes.CompoundInstruction c)
Append a compound instruction, after instruction i. |
Bytecodes.InstructionHandle |
append(Bytecodes.Instruction i,
Bytecodes.Instruction j)
Append a single instruction j after another instruction i, which must be in this list of course! |
Bytecodes.InstructionHandle |
append(Bytecodes.Instruction i,
Bytecodes.InstructionList il)
Append another list after instruction i contained in this list. |
Bytecodes.BranchHandle |
append(Bytecodes.InstructionHandle ih,
Bytecodes.BranchInstruction i)
Append an instruction after instruction (handle) ih contained in this list. |
Bytecodes.InstructionHandle |
append(Bytecodes.InstructionHandle ih,
Bytecodes.CompoundInstruction c)
Append a compound instruction. |
Bytecodes.InstructionHandle |
append(Bytecodes.InstructionHandle ih,
Bytecodes.Instruction i)
Append an instruction after instruction (handle) ih contained in this list. |
Bytecodes.InstructionHandle |
append(Bytecodes.InstructionHandle ih,
Bytecodes.InstructionList il)
Append another list after instruction (handle) ih contained in this list. |
Bytecodes.InstructionHandle |
append(Bytecodes.InstructionList il)
Append another list to this one. |
boolean |
contains(Bytecodes.Instruction i)
|
boolean |
contains(Bytecodes.InstructionHandle i)
|
Bytecodes.InstructionList |
copy()
|
void |
delete(Bytecodes.Instruction i)
Remove instruction from this list. |
void |
delete(Bytecodes.Instruction from,
Bytecodes.Instruction to)
Remove instructions from instruction `from' to instruction `to' contained in this list. |
void |
delete(Bytecodes.InstructionHandle ih)
Remove instruction from this list. |
void |
delete(Bytecodes.InstructionHandle from,
Bytecodes.InstructionHandle to)
Remove instructions from instruction `from' to instruction `to' contained in this list. |
void |
dispose()
Delete contents of list. |
Enumeration |
elements()
|
Bytecodes.InstructionHandle |
findHandle(int pos)
Get instruction handle for instruction at byte code position pos. |
static Bytecodes.InstructionHandle |
findHandle(List ihs,
int[] pos,
int target)
Find the target instruction (handle) that corresponds to the given target position (byte code offset). |
byte[] |
getByteCode()
When everything is finished, use this method to convert the instruction list into an array of bytes. |
Bytecodes.InstructionHandle |
getEnd()
|
List |
getInstructionHandles()
|
int[] |
getInstructionPositions()
Get positions (offsets) of all instructions in the list. |
List |
getInstructions(jq_ConstantPool cp)
|
int |
getLength()
|
Bytecodes.InstructionHandle |
getStart()
|
Bytecodes.BranchHandle |
insert(Bytecodes.BranchInstruction i)
Insert a branch instruction at start of this list. |
Bytecodes.InstructionHandle |
insert(Bytecodes.CompoundInstruction c)
Insert a compound instruction. |
Bytecodes.InstructionHandle |
insert(Bytecodes.Instruction i)
Insert an instruction at start of this list. |
Bytecodes.InstructionHandle |
insert(Bytecodes.Instruction i,
Bytecodes.CompoundInstruction c)
Insert a compound instruction before instruction i. |
Bytecodes.InstructionHandle |
insert(Bytecodes.Instruction i,
Bytecodes.Instruction j)
Insert a single instruction j before another instruction i, which must be in this list of course! |
Bytecodes.InstructionHandle |
insert(Bytecodes.Instruction i,
Bytecodes.InstructionList il)
Insert another list before Instruction i contained in this list. |
Bytecodes.BranchHandle |
insert(Bytecodes.InstructionHandle ih,
Bytecodes.BranchInstruction i)
Insert an instruction before instruction (handle) ih contained in this list. |
Bytecodes.InstructionHandle |
insert(Bytecodes.InstructionHandle ih,
Bytecodes.CompoundInstruction c)
Insert a compound instruction. |
Bytecodes.InstructionHandle |
insert(Bytecodes.InstructionHandle ih,
Bytecodes.Instruction i)
Insert an instruction before instruction (handle) ih contained in this list. |
Bytecodes.InstructionHandle |
insert(Bytecodes.InstructionHandle ih,
Bytecodes.InstructionList il)
Insert another list before Instruction handle ih contained in this list. |
Bytecodes.InstructionHandle |
insert(Bytecodes.InstructionList il)
Insert another list. |
boolean |
isEmpty()
Test for empty list. |
ListIterator |
iterator()
|
void |
move(Bytecodes.InstructionHandle ih,
Bytecodes.InstructionHandle target)
Move a single instruction (handle) to a new location. |
void |
move(Bytecodes.InstructionHandle start,
Bytecodes.InstructionHandle end,
Bytecodes.InstructionHandle target)
Take all instructions (handles) from "start" to "end" and append them after the new location "target". |
void |
redirectBranches(Bytecodes.InstructionHandle old_target,
Bytecodes.InstructionHandle new_target)
Redirect all references from old_target to new_target, i.e., update targets of branch instructions. |
void |
redirectExceptionHandlers(Bytecodes.CodeException[] exceptions,
Bytecodes.InstructionHandle old_target,
Bytecodes.InstructionHandle new_target)
Redirect all references of exception handlers from old_target to new_target. |
void |
removeObserver(Bytecodes.InstructionListObserver o)
Remove observer for this object. |
void |
setPositions()
|
void |
setPositions(boolean check)
Give all instructions their position number (offset in byte stream), i.e., make the list ready to be dumped. |
int |
size()
|
String |
toString()
|
String |
toString(boolean verbose)
|
void |
update()
Call notify() method on all observers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Bytecodes.InstructionList()
public Bytecodes.InstructionList(Bytecodes.Instruction i)
i
- initial instructionpublic Bytecodes.InstructionList(Bytecodes.BranchInstruction i)
i
- initial instructionpublic Bytecodes.InstructionList(Bytecodes.CompoundInstruction c)
c
- compound instruction (list)public Bytecodes.InstructionList(jq_Method m)
public Bytecodes.InstructionList(jq_ConstantPool cp, byte[] code)
code
- byte array containing the instructionsMethod Detail |
---|
public boolean isEmpty()
public static Bytecodes.InstructionHandle findHandle(List ihs, int[] pos, int target)
ihs
- array of instruction handles, i.e. il.getInstructionHandles()pos
- array of positions corresponding to ihs, i.e. il.getInstructionPositions()target
- target position to search for
public Bytecodes.InstructionHandle findHandle(int pos)
pos
- byte code position to search for
public Bytecodes.InstructionHandle append(Bytecodes.InstructionHandle ih, Bytecodes.InstructionList il)
ih
- where to append the instruction listil
- Instruction list to append to this one
public Bytecodes.InstructionHandle append(Bytecodes.Instruction i, Bytecodes.InstructionList il)
i
- where to append the instruction listil
- Instruction list to append to this one
public Bytecodes.InstructionHandle append(Bytecodes.InstructionList il)
il
- list to append to end of this list
public Bytecodes.InstructionHandle append(Bytecodes.Instruction i)
i
- instruction to append
public Bytecodes.BranchHandle append(Bytecodes.BranchInstruction i)
i
- branch instruction to append
public Bytecodes.InstructionHandle append(Bytecodes.Instruction i, Bytecodes.Instruction j)
i
- Instruction in listj
- Instruction to append after i in list
public Bytecodes.InstructionHandle append(Bytecodes.Instruction i, Bytecodes.CompoundInstruction c)
i
- Instruction in listc
- The composite instruction (containing an InstructionList)
public Bytecodes.InstructionHandle append(Bytecodes.CompoundInstruction c)
c
- The composite instruction (containing an InstructionList)
public Bytecodes.InstructionHandle append(Bytecodes.InstructionHandle ih, Bytecodes.CompoundInstruction c)
ih
- where to append the instruction listc
- The composite instruction (containing an InstructionList)
public Bytecodes.InstructionHandle append(Bytecodes.InstructionHandle ih, Bytecodes.Instruction i)
ih
- where to append the instruction listi
- Instruction to append
public Bytecodes.BranchHandle append(Bytecodes.InstructionHandle ih, Bytecodes.BranchInstruction i)
ih
- where to append the instruction listi
- Instruction to append
public Bytecodes.InstructionHandle insert(Bytecodes.InstructionHandle ih, Bytecodes.InstructionList il)
ih
- where to append the instruction listil
- instruction list to insert
public Bytecodes.InstructionHandle insert(Bytecodes.InstructionList il)
il
- list to insert before start of this list
public Bytecodes.InstructionHandle insert(Bytecodes.Instruction i, Bytecodes.InstructionList il)
i
- where to append the instruction listil
- Instruction list to insert
public Bytecodes.InstructionHandle insert(Bytecodes.Instruction i)
i
- instruction to insert
public Bytecodes.BranchHandle insert(Bytecodes.BranchInstruction i)
i
- branch instruction to insert
public Bytecodes.InstructionHandle insert(Bytecodes.Instruction i, Bytecodes.Instruction j)
i
- Instruction in listj
- Instruction to insert before i in list
public Bytecodes.InstructionHandle insert(Bytecodes.Instruction i, Bytecodes.CompoundInstruction c)
i
- Instruction in listc
- The composite instruction (containing an InstructionList)
public Bytecodes.InstructionHandle insert(Bytecodes.CompoundInstruction c)
c
- The composite instruction (containing an InstructionList)
public Bytecodes.InstructionHandle insert(Bytecodes.InstructionHandle ih, Bytecodes.Instruction i)
ih
- where to insert to the instruction listi
- Instruction to insert
public Bytecodes.InstructionHandle insert(Bytecodes.InstructionHandle ih, Bytecodes.CompoundInstruction c)
ih
- where to insert the instruction listc
- The composite instruction (containing an InstructionList)
public Bytecodes.BranchHandle insert(Bytecodes.InstructionHandle ih, Bytecodes.BranchInstruction i)
ih
- where to insert to the instruction listi
- Instruction to insert
public void move(Bytecodes.InstructionHandle start, Bytecodes.InstructionHandle end, Bytecodes.InstructionHandle target)
start
- of moved blockend
- of moved blocktarget
- of moved blockpublic void move(Bytecodes.InstructionHandle ih, Bytecodes.InstructionHandle target)
ih
- moved instructiontarget
- new location of moved instructionpublic void delete(Bytecodes.InstructionHandle ih) throws Bytecodes.TargetLostException
ih
- instruction (handle) to remove
Bytecodes.TargetLostException
public void delete(Bytecodes.Instruction i) throws Bytecodes.TargetLostException
i
- instruction to remove
Bytecodes.TargetLostException
public void delete(Bytecodes.InstructionHandle from, Bytecodes.InstructionHandle to) throws Bytecodes.TargetLostException
from
- where to start deleting (inclusive)to
- where to end deleting (inclusive)
Bytecodes.TargetLostException
public void delete(Bytecodes.Instruction from, Bytecodes.Instruction to) throws Bytecodes.TargetLostException
from
- where to start deleting (inclusive)to
- where to end deleting (inclusive)
Bytecodes.TargetLostException
public boolean contains(Bytecodes.InstructionHandle i)
public boolean contains(Bytecodes.Instruction i)
public void setPositions()
public void setPositions(boolean check)
check
- Perform sanity checks, e.g. if all targeted instructions really belong
to this listpublic byte[] getByteCode()
public List getInstructions(jq_ConstantPool cp)
public String toString()
toString
in class Object
public String toString(boolean verbose)
verbose
- toggle output format
public Enumeration elements()
public ListIterator iterator()
public List getInstructionHandles()
public int[] getInstructionPositions()
public Bytecodes.InstructionList copy()
public void dispose()
public Bytecodes.InstructionHandle getStart()
public Bytecodes.InstructionHandle getEnd()
public int getLength()
public int size()
public void redirectBranches(Bytecodes.InstructionHandle old_target, Bytecodes.InstructionHandle new_target)
old_target
- the old target instruction handlenew_target
- the new target instruction handlepublic void redirectExceptionHandlers(Bytecodes.CodeException[] exceptions, Bytecodes.InstructionHandle old_target, Bytecodes.InstructionHandle new_target)
exceptions
- array of exception handlersold_target
- the old target instruction handlenew_target
- the new target instruction handlepublic void addObserver(Bytecodes.InstructionListObserver o)
public void removeObserver(Bytecodes.InstructionListObserver o)
public void update()
public void accept(Bytecodes.Visitor v)
v
- Visitor object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |