Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DE.fub.inf.JVM.ClassGen.InstructionList
Constructor Summary | |
InstructionList()
Create (empty) instruction list. |
|
InstructionList(Instruction i)
Create instruction list containing one instruction. |
|
InstructionList(CompoundInstruction c)
Initialize list with (nonnull) compound instruction. |
|
InstructionList(byte[] code)
Initialize instruction list from byte array. |
Method Summary | |
InstructionHandle | append(InstructionHandle ih,
InstructionList il)
Append another list after instruction (handle) ih contained in this list. |
InstructionHandle | append(Instruction i,
InstructionList il)
Append another list after instruction i contained in this list. |
InstructionHandle | append(InstructionList il)
Append another list to this one. |
InstructionHandle | append(Instruction i)
Append an instruction to the end of this list. |
BranchHandle | append(BranchInstruction i)
Append a branch instruction to the end of this list. |
InstructionHandle | append(Instruction i,
Instruction j)
Append a single instruction j after another instruction i, which must be in this list of course! |
InstructionHandle | append(Instruction i,
CompoundInstruction c)
Append a compound instruction, after instruction i. |
InstructionHandle | append(CompoundInstruction c)
Append a compound instruction. |
InstructionHandle | append(InstructionHandle ih,
Instruction i)
Append an instruction after instruction (handle) ih contained in this list. |
InstructionList | copy()
|
void | delete(InstructionHandle ih)
Remove instruction from this list. |
void | delete(Instruction i)
Remove instruction from this list. |
void | delete(InstructionHandle from,
InstructionHandle to)
Remove instructions from instruction `from' to instruction `to' contained in this list. |
void | delete(Instruction from,
Instruction to)
Remove instructions from instruction `from' to instruction `to' contained in this list. |
java.util.Enumeration | elements()
|
static InstructionHandle | findHandle(InstructionHandle[] ihs,
int[] pos,
int count,
int target)
Find the target instruction (handle) that corresponds to the given target position (byte code offset). |
InstructionHandle | findHandle(int pos)
Get instruction handle for instruction at byte code position pos. |
byte[] | getByteCode()
|
InstructionHandle | getEnd()
|
InstructionHandle[] | getInstructionHandles()
|
int[] | getInstructionPositions()
Get positions (offsets) of all instructions in the list. |
int | getLength()
|
InstructionHandle | getStart()
|
InstructionHandle | insert(InstructionHandle ih,
InstructionList il)
Insert another list before Instruction handle ih contained in this list. |
InstructionHandle | insert(InstructionList il)
Insert another list. |
InstructionHandle | insert(Instruction i,
InstructionList il)
Insert another list before Instruction i contained in this list. |
InstructionHandle | insert(Instruction i)
Insert an instruction at start of this list. |
BranchHandle | insert(BranchInstruction i)
Insert a branch instruction at start of this list. |
InstructionHandle | insert(Instruction i,
Instruction j)
Insert a single instruction j before another instruction i, which must be in this list of course! |
InstructionHandle | insert(Instruction i,
CompoundInstruction c)
Insert a compound instruction before instruction i. |
InstructionHandle | insert(CompoundInstruction c)
Insert a compound instruction. |
InstructionHandle | insert(InstructionHandle ih,
Instruction i)
Insert an instruction before instruction (handle) ih contained in this list. |
boolean | isEmpty()
Test for empty list. |
void | redirectBranches(InstructionHandle old_target,
InstructionHandle new_target)
Redirect all references from old_target to new_target, i.e. update targets of branch instructions. |
void | redirectExceptionHandlers(CodeExceptionGen[] exceptions,
InstructionHandle old_target,
InstructionHandle new_target)
Redirect all references of exception handlers from old_target to new_target. |
void | redirectLocalVariables(LocalVariableGen[] lg,
InstructionHandle old_target,
InstructionHandle new_target)
Redirect all references of local variables from old_target to new_target. |
void | setPositions()
Give all instructions their position number (offset in byte stream), i.e. make the list ready to be dumped. |
int | size()
|
java.lang.String | toString()
|
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public InstructionList()
public InstructionList(Instruction i)
i
- initial instructionpublic InstructionList(CompoundInstruction c)
c
- compound instruction (list)public InstructionList(byte[] code)
code
- byte array containing the instructionsMethod Detail |
public final boolean isEmpty()
public static final InstructionHandle findHandle(InstructionHandle[] ihs, int[] pos, int count, int target)
ihs
- array of instruction handles
pos
- array of positions corresponding to ihs
count
- length of arrays
target
- target position to search forpublic final InstructionHandle findHandle(int pos)
pos
- byte code position to search forpublic final InstructionHandle append(InstructionHandle ih, InstructionList il)
ih
- where to append the instruction list
il
- Instruction list to append to this onepublic final InstructionHandle append(Instruction i, InstructionList il)
i
- where to append the instruction list
il
- Instruction list to append to this onepublic final InstructionHandle append(InstructionList il)
il
- list to append to end of this listpublic final InstructionHandle append(Instruction i)
i
- instruction to appendpublic final BranchHandle append(BranchInstruction i)
i
- branch instruction to appendpublic final InstructionHandle append(Instruction i, Instruction j)
i
- Instruction in list
j
- Instruction to append after i in listpublic final InstructionHandle append(Instruction i, CompoundInstruction c)
i
- Instruction in list
c
- The composite instruction (containing an InstructionList)public final InstructionHandle append(CompoundInstruction c)
c
- The composite instruction (containing an InstructionList)public final InstructionHandle append(InstructionHandle ih, Instruction i)
ih
- where to append the instruction list
i
- Instruction to appendpublic final InstructionHandle insert(InstructionHandle ih, InstructionList il)
i
- where to append the instruction list
il
- Instruction list to insertpublic final InstructionHandle insert(InstructionList il)
il
- list to insert before start of this listpublic final InstructionHandle insert(Instruction i, InstructionList il)
i
- where to append the instruction list
il
- Instruction list to insertpublic final InstructionHandle insert(Instruction i)
i
- instruction to insertpublic final BranchHandle insert(BranchInstruction i)
i
- branch instruction to insertpublic InstructionHandle insert(Instruction i, Instruction j)
i
- Instruction in list
j
- Instruction to insert before i in listpublic final InstructionHandle insert(Instruction i, CompoundInstruction c)
i
- Instruction in list
c
- The composite instruction (containing an InstructionList)public final InstructionHandle insert(CompoundInstruction c)
c
- The composite instruction (containing an InstructionList)public final InstructionHandle insert(InstructionHandle ih, Instruction i)
ih
- where to insert to the instruction list
i
- Instruction to insertpublic final void delete(InstructionHandle ih)
ih
- instruction (handle) to removepublic final void delete(Instruction i)
i
- instruction to removepublic final void delete(InstructionHandle from, InstructionHandle to)
from
- where to start deleting (inclusive)
to
- where to end deleting (inclusive)public final void delete(Instruction from, Instruction to)
from
- where to start deleting (inclusive)
to
- where to end deleting (inclusive)public final void setPositions()
public byte[] getByteCode()
public java.lang.String toString()
public java.util.Enumeration elements()
public final InstructionHandle[] getInstructionHandles()
public final int[] getInstructionPositions()
public InstructionList copy()
public void redirectBranches(InstructionHandle old_target, InstructionHandle new_target)
old_target
- the old target instruction handle
new_target
- the new target instruction handlepublic void redirectLocalVariables(LocalVariableGen[] lg, InstructionHandle old_target, InstructionHandle new_target)
lg
- array of local variables
old_target
- the old target instruction handle
new_target
- the new target instruction handlepublic void redirectExceptionHandlers(CodeExceptionGen[] exceptions, InstructionHandle old_target, InstructionHandle new_target)
exceptions
- array of exception handlers
old_target
- the old target instruction handle
new_target
- the new target instruction handlepublic InstructionHandle getStart()
public InstructionHandle getEnd()
public int getLength()
public int size()
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |