|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CodeSequence
| Field Summary | |
private Stack |
contexts
|
private boolean |
discardValue
|
private ArrayList |
handlers
|
private Instruction[] |
instructions
|
private boolean |
labelAtEnd
|
private int |
lastLine
|
private int |
lineNumber
|
private ArrayList |
lines
|
private int |
pc
|
private static Stack |
stack
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
private |
CodeSequence()
Constructs a code attribute. |
| Method Summary | |
void |
addExceptionHandler(HandlerInfo info)
Add an exception handler to this code |
private void |
addLocalVarInfo(LocalVarInstruction insn,
JLocalVariable var)
Add a local variable name information |
boolean |
discardValue()
|
void |
ensureFinalReturn()
Ensures that the code block ends with a no-argument return statement. |
static CodeSequence |
getCodeSequence()
Constructs a code sequence. |
HandlerInfo[] |
getHandlers()
Returns an array of all exception handler |
Instruction[] |
getInstructionArray()
Return the instruction as a list WARNING: AFTER a call to release() this array will be reused |
Instruction |
getInstructionAt(int pc)
Returns the instruction at a given position |
LineNumberInfo[] |
getLineNumbers()
|
LocalVariableInfo[] |
getLocalVariableInfos()
|
int |
getPC()
Gets the location in code sequence |
static void |
initSession()
|
void |
plantBreak(JStatement top)
Ask the code handler to generate the necessary code to call every finally and monitorexit |
void |
plantInstruction(Instruction insn)
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 |
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 |
plantSwap()
Plants a swap instruction on the end of this code sequence. |
void |
popContext(JStatement stmt)
Informs the code handlers that we exit a breakable code. |
void |
pushContext(JStatement stmt)
Informs the code handlers that we begin a portion of breakable code. |
void |
release()
Release a code sequence |
private void |
resolveLabels()
|
void |
setDiscardValue(boolean discardValue)
|
void |
setLineNumber(int lineNumber)
|
int |
size()
Returns the actual size of code (number of instruction) |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Instruction[] instructions
private ArrayList handlers
private ArrayList lines
private int pc
private boolean discardValue
private boolean labelAtEnd
private int lineNumber
private int lastLine
private Stack contexts
private static final Stack stack
| Constructor Detail |
private CodeSequence()
| Method Detail |
public static CodeSequence getCodeSequence()
public void release()
public static void initSession()
public final void plantInstruction(Instruction insn)
insn - the instruction to append
public final void plantLocalVar(int opcode,
JLocalVariable var)
public final void plantLoadThis()
public final void plantLabelRef(int opcode,
CodeLabel label)
public final void plantLabel(CodeLabel label)
public final void plantSwap()
public final void setLineNumber(int lineNumber)
lineNumber - the current line number in source codepublic final LineNumberInfo[] getLineNumbers()
public final LocalVariableInfo[] getLocalVariableInfos()
public final void setDiscardValue(boolean discardValue)
discardValue - set if the value of subexpression
should be discardedpublic final boolean discardValue()
public final void plantReturn(JReturnStatement ret)
public final void plantBreak(JStatement top)
public final void ensureFinalReturn()
public final void pushContext(JStatement stmt)
public final void popContext(JStatement stmt)
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()
private void resolveLabels()
private final void addLocalVarInfo(LocalVarInstruction insn,
JLocalVariable var)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||