Exemplo n.º 1
0
 /** The last {@link Instruction} for which this local is in scope. */
 public Instruction getEnd() {
   if (_end != null) return _end;
   int idx = _target.getByteIndex() + _length;
   Instruction end = getCode().getInstruction(idx);
   if (end != null && (end.prev instanceof Instruction)) {
     return (Instruction) end.prev;
   }
   return getCode().getLastInstruction();
 }
Exemplo n.º 2
0
 /** Set the index into the code byte array at which this local starts. */
 public void setStartPc(int startPc) {
   _target.setByteIndex(startPc);
 }
Exemplo n.º 3
0
 /**
  * Set the {@link Instruction} marking the beginning this local. The instruction must already be a
  * part of the method. WARNING: if this instruction is deleted, the results are undefined.
  */
 public void setStart(Instruction instruction) {
   _target.setTargetInstruction(instruction);
 }
Exemplo n.º 4
0
 /** Return the instruction marking the beginning of this local. */
 public Instruction getStart() {
   return _target.getTargetInstruction();
 }
Exemplo n.º 5
0
 /** Return the index into the code byte array at which this local starts. */
 public int getStartPc() {
   return _target.getByteIndex();
 }
Exemplo n.º 6
0
 public void replaceTarget(Instruction oldTarget, Instruction newTarget) {
   _target.replaceTarget(oldTarget, newTarget);
   if (getEnd() == oldTarget) setEnd(newTarget);
 }
Exemplo n.º 7
0
 public void updateTargets() {
   _target.updateTargets();
   _end = getEnd();
 }
Exemplo n.º 8
0
 /** Get the number of bytes for which this local has a value in the code byte array. */
 public int getLength() {
   if (_end != null) return _end.getByteIndex() + _end.getLength() - _target.getByteIndex();
   return _length;
 }