|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.dms.util.Utils | +--at.dms.kjc.CodeSequence
Code sequence is used as a bag to hold lists of instructions until it is time to put them into a class file. Note: Local variables are currently not used.
Inner Class Summary | |
(package private) class |
CodeSequence.LabelResolvingTransformer
Helper class to resolve labels. |
Fields inherited from class at.dms.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
Method Summary | |
void |
addExceptionHandler(HandlerInfo info)
Add an exception handler to this code. |
boolean |
discardValue()
|
static void |
endSession()
... |
static CodeSequence |
getCodeSequence()
Constructs a code sequence. |
HandlerInfo[] |
getHandlers()
Returns an array of all exception handler. |
Instruction[] |
getInstructionArray()
Return the instruction as a list. |
Instruction |
getInstructionAt(int pc)
Returns the instruction at a given position. |
LineNumberInfo[] |
getLineNumbers()
|
LocalVariableInfo[] |
getLocalVariableInfos()
|
int |
getPC()
Gets the location in code sequence. |
void |
plantBreak(JStatement top)
Ask the code handler to generate the necessary code to call every finally and monitorexit. |
void |
plantInstruction(Instruction instruction)
Adds an instruction to the code of the current method. |
void |
plantLabel(CodeLabel label)
Adds an instruction to the code of the current method. |
void |
plantLabelRef(int opcode,
CodeLabel label)
Adds an instruction to the code of the current method. |
void |
plantLabelRef(java.lang.String debugIdent,
int opcode,
CodeLabel label)
|
void |
plantLoadThis()
Adds a load of this (local var 0) |
void |
plantLocalVar(int opcode,
JLocalVariable var)
Adds a local var instruction to the code of the current method. |
void |
plantReturn(JReturnStatement ret)
Ask the code handler to generate the necessary code to call every finally clause of all try statements. |
void |
popContext(JStatement statement)
Informs the code handlers that we exit a breakable code. |
void |
pushContext(JStatement statement)
Informs the code handlers that we begin a portion of breakable code. |
void |
release()
Release a code sequence. |
void |
setDiscardValue(boolean discardValue)
|
void |
setLineNumber(int lineNumber)
|
int |
size()
Returns the actual size of code. |
Methods inherited from class at.dms.util.Utils |
assert, assert, fail, fail, hasFlag, hasMoreThanOneFlag, hasOtherFlags, splitQualifiedName, splitQualifiedName, vectorToArray, vectorToIntArray |
Methods inherited from class java.lang.Object |
|
Method Detail |
public static CodeSequence getCodeSequence()
public void release()
public static void endSession()
public final void plantInstruction(Instruction instruction)
instruction
- the instruction to appendpublic final void plantLocalVar(int opcode, JLocalVariable var)
instruction
- the instruction to appendpublic final void plantLoadThis()
instruction
- the instruction to appendpublic final void plantLabelRef(int opcode, CodeLabel label)
instruction
- the instruction to appendpublic final void plantLabelRef(java.lang.String debugIdent, int opcode, CodeLabel label)
public final void plantLabel(CodeLabel label)
instruction
- the instruction to appendpublic final void setLineNumber(int lineNumber)
lineNumber
- the current line number in source code.public final LineNumberInfo[] getLineNumbers()
public final LocalVariableInfo[] getLocalVariableInfos()
public final void setDiscardValue(boolean discardValue)
discardValue
- Set if the value of subexpression should be discarded.public final boolean discardValue()
public final void plantReturn(JReturnStatement ret)
public final void plantBreak(JStatement top)
public final void pushContext(JStatement statement)
public final void popContext(JStatement statement)
public final void addExceptionHandler(HandlerInfo info)
public final HandlerInfo[] getHandlers()
public final int getPC()
public final int size()
public final Instruction getInstructionAt(int pc)
public Instruction[] getInstructionArray()
instruction
- the instruction to append.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |