public class InstructionList
extends java.lang.Object
Constructor and Description |
---|
InstructionList() |
Modifier and Type | Method and Description |
---|---|
void |
add(Instruction i)
Adds an Instruction to this InstructionList
|
void |
add(InstructionList il)
Adds all the Instructions in given list to this list.
|
void |
clear()
Clears this InstructionList.
|
InstructionList |
createEmptyList()
Create an empty list.
|
InstructionList |
createView(int start)
Creates a view.
|
InstructionList |
createView(int start,
int end)
Creates a view.
|
java.util.List |
findBranchesForTarget(Instruction target) |
Instruction |
get(int i)
Gets an Instruction at given index.
|
byte[] |
getBytes()
Gets this InstructionList as a byte array.
|
JiapiMethod |
getDeclaringMethod()
Gets the declaring JiapiMethod of this InstructionList
|
InstructionFactory |
getInstructionFactory()
Get the InstructionFactory, that is associated with this
InstructionList.
|
int |
indexOf(byte opcode)
Scans this InstructionList for a opcode.
|
int |
indexOf(byte[] opcodes,
int fromIndex)
Scans this InstructionList for opcodes.
|
int |
indexOf(byte opcode,
int fromIndex)
Scans this InstructionList for a opcode.
|
int |
indexOf(Instruction ins)
Scans this InstructionList for a opcode.
|
boolean |
insert(int idx,
Instruction i)
Insert an Instruction to this InstructionList
|
boolean |
insert(int idx,
InstructionList il)
Insert an InstructionList to this InstructionList
|
void |
replace(InstructionList il) |
void |
replace(int idx,
Instruction i)
Replace an Instruction at given index
|
void |
replace(int start,
int end,
InstructionList il)
Replaces instructions with given range.
|
int |
size()
Gets the size of this InstructionList.
|
int |
stackUsage()
Calculates stack-usage of this InstructionList
|
java.lang.String |
toString() |
public void add(Instruction i)
public void add(InstructionList il)
il
- InstructionList to addpublic void clear()
public InstructionList createEmptyList()
public InstructionList createView(int start)
start
to the
end of this list.start
- start of the view, inclusivepublic InstructionList createView(int start, int end)
start
- start of the view, inclusiveend
- end of the view, exclusivepublic java.util.List findBranchesForTarget(Instruction target)
public Instruction get(int i)
i
- indexpublic byte[] getBytes()
public JiapiMethod getDeclaringMethod()
public InstructionFactory getInstructionFactory()
public int indexOf(byte opcode)
opcode
- Opcode to look forpublic int indexOf(byte[] opcodes, int fromIndex)
fromIndex
- Index to start scanning fromopcodes
- opcode to look forpublic int indexOf(byte opcode, int fromIndex)
start
- Index to start scanning fromopcode
- Opcode to look forpublic int indexOf(Instruction ins)
ins
- Instruction to look forpublic boolean insert(int idx, Instruction i)
idx
- index of the Instructioni
- Instruction to insertpublic boolean insert(int idx, InstructionList il)
idx
- index of the InstructionListi
- Instruction to insertpublic void replace(InstructionList il)
public void replace(int idx, Instruction i)
idx
- Index of the Instruction to replacei
- Instruction to replacepublic void replace(int start, int end, InstructionList il)
Note, that exception table might get corrupted with this method.
start
- start of old Instructions, inclusiveend
- end of old Instructions, exclusiveil
- InstructionList containing new Instructions.java.lang.IllegalArgumentException
- is thrown, if stack-usages
do not matchjava.lang.IllegalArgumentException
- is thrown, if there is
an instruction in the range, that is a target to some
other entity.public int size()
public int stackUsage()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2001. Documenation generated February 9 2016.