Example #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();
 }
Example #2
0
 /** Set the index into the code byte array at which this local starts. */
 public void setStartPc(int startPc) {
   _target.setByteIndex(startPc);
 }
Example #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);
 }
Example #4
0
 /** Return the instruction marking the beginning of this local. */
 public Instruction getStart() {
   return _target.getTargetInstruction();
 }
Example #5
0
 /** Return the index into the code byte array at which this local starts. */
 public int getStartPc() {
   return _target.getByteIndex();
 }
Example #6
0
 public void replaceTarget(Instruction oldTarget, Instruction newTarget) {
   _target.replaceTarget(oldTarget, newTarget);
   if (getEnd() == oldTarget) setEnd(newTarget);
 }
Example #7
0
 public void updateTargets() {
   _target.updateTargets();
   _end = getEnd();
 }
Example #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;
 }