gnu.bytecode
Class Label
java.lang.Object
|
+--gnu.bytecode.Label
- Direct Known Subclasses:
- CodeFragment
- public class Label
- extends java.lang.Object
A Label represents a location in a Code attribute.
|
Method Summary |
void |
define(CodeAttr code)
Define the value of a label as having the current location. |
boolean |
defined()
|
void |
emit_wide(CodeAttr code,
int start_pc)
Emit a wide reference to the current label. |
void |
emit(CodeAttr code)
Emit a reference to the current label. |
boolean |
hasFixups()
Return true if there are references to this Label. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Label
public Label(Method method)
Label
public Label(CodeAttr code)
defined
public final boolean defined()
define
public void define(CodeAttr code)
- Define the value of a label as having the current location.
- Parameters:
code - the "Code" attribute of the current method
hasFixups
public boolean hasFixups()
- Return true if there are references to this Label.
We assume !defined().
emit
public void emit(CodeAttr code)
- Emit a reference to the current label.
- Parameters:
method - the current method
Emit the reference as a 2-byte difference relative to PC-1.
emit_wide
public void emit_wide(CodeAttr code,
int start_pc)
- Emit a wide reference to the current label.
- Parameters:
code - the current methodstart_pc - the PC at the start of this instruction
Emit the reference as a 4-byte difference relative to PC-offset.