|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectserp.bytecode.Attributes
serp.bytecode.Attribute
serp.bytecode.LineNumberTable
public class LineNumberTable
Code blocks compiled from source have line number tables mapping opcodes to source lines. This table automatically maintains line numbers in ascending order by their start program counter position at all times.
Method Summary | |
---|---|
void |
acceptVisit(BCVisitor visit)
Accept a visit from a BCVisitor , calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one. |
LineNumber |
addLineNumber()
Add a new line number to this table. |
LineNumber |
addLineNumber(Instruction start,
int line)
Add a new line number to this table. |
LineNumber |
addLineNumber(int startPc,
int line)
Add a new line number to this table. |
LineNumber |
addLineNumber(LineNumber ln)
Import a line number from another method. |
void |
clear()
Clear the line numbers. |
Code |
getCode()
Returns the Code block that owns the Instruction(s) this InstructionPtr points to. |
LineNumber |
getLineNumber(Instruction ins)
Return the line number for the given instruction, or null if none. |
LineNumber |
getLineNumber(int pc)
Return the line number for the given program counter, or null if none. |
LineNumber[] |
getLineNumbers()
Return the line numbers held in this table. |
boolean |
removeLineNumber(Instruction ins)
Remove the line number for the given instruction. |
boolean |
removeLineNumber(int pc)
Remove the line number for the given program counter. |
boolean |
removeLineNumber(LineNumber ln)
Remove the given line. |
void |
replaceTarget(Instruction oldTarget,
Instruction newTarget)
Replace the given old, likely invalid, target with a new target. |
void |
setLineNumbers(LineNumber[] lines)
Set the line numbers for the table. |
void |
updateTargets()
Use the byte indexes read from the class file to calculate and set references to the target instruction(s) for this ptr. |
Methods inherited from class serp.bytecode.Attribute |
---|
getClassLoader, getName, getNameIndex, getOwner, getPool, getProject, isValid |
Methods inherited from class serp.bytecode.Attributes |
---|
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public LineNumber[] getLineNumbers()
public LineNumber getLineNumber(int pc)
public LineNumber getLineNumber(Instruction ins)
public void setLineNumbers(LineNumber[] lines)
public LineNumber addLineNumber(LineNumber ln)
public LineNumber addLineNumber()
public LineNumber addLineNumber(int startPc, int line)
public LineNumber addLineNumber(Instruction start, int line)
public void clear()
public boolean removeLineNumber(LineNumber ln)
public boolean removeLineNumber(int pc)
public boolean removeLineNumber(Instruction ins)
public void updateTargets()
InstructionPtr
updateTargets
in interface InstructionPtr
public void replaceTarget(Instruction oldTarget, Instruction newTarget)
InstructionPtr
replaceTarget
in interface InstructionPtr
public void acceptVisit(BCVisitor visit)
VisitAcceptor
BCVisitor
, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one.
acceptVisit
in interface VisitAcceptor
public Code getCode()
InstructionPtr
getCode
in interface InstructionPtr
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |