Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Compil3r.BytecodeAnalysis
Class Bytecodes.InstructionHandle  view Bytecodes.InstructionHandle download Bytecodes.InstructionHandle.java

java.lang.Object
  extended byCompil3r.BytecodeAnalysis.Bytecodes.InstructionHandle
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Bytecodes.BranchHandle
Enclosing class:
Bytecodes

public static class Bytecodes.InstructionHandle
extends java.lang.Object
implements java.io.Serializable


Field Summary
private  java.util.Map attributes
           
protected  int i_position
           
private static Bytecodes.InstructionHandle ih_list
           
(package private)  Bytecodes.Instruction instruction
           
(package private)  Bytecodes.InstructionHandle next
           
(package private)  Bytecodes.InstructionHandle prev
           
private  java.util.Set targeters
           
 
Constructor Summary
protected Bytecodes.InstructionHandle(Bytecodes.Instruction i)
           
 
Method Summary
 void accept(Bytecodes.Visitor v)
          Convenience method, simply calls accept() on the contained instruction.
 void addAttribute(java.lang.Object key, java.lang.Object attr)
          Add an attribute to an instruction handle.
protected  void addHandle()
          Overridden in BranchHandle
 void addTargeter(Bytecodes.InstructionTargeter t)
          Denote this handle is being referenced by t.
(package private)  void dispose()
          Delete contents, i.e., remove user access and make handle reusable.
 java.lang.Object getAttribute(java.lang.Object key)
          Get attribute of an instruction handle.
 Bytecodes.Instruction getInstruction()
           
(package private) static Bytecodes.InstructionHandle getInstructionHandle(Bytecodes.Instruction i)
          Factory method.
 Bytecodes.InstructionHandle getNext()
           
 int getPosition()
           
 Bytecodes.InstructionHandle getPrev()
           
 java.util.Set getTargeters()
           
 boolean hasTargeters()
           
 void removeAllTargeters()
          Remove all targeters, if any.
 void removeAttribute(java.lang.Object key)
          Delete an attribute of an instruction handle.
 void removeTargeter(Bytecodes.InstructionTargeter t)
          Denote this handle isn't referenced anymore by t.
 void setInstruction(Bytecodes.Instruction i)
          Replace current instruction contained in this handle.
(package private)  void setPosition(int pos)
          Set the position, i.e., the byte code offset of the contained instruction.
 Bytecodes.Instruction swapInstruction(Bytecodes.Instruction i)
          Temporarily swap the current instruction, without disturbing anything.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 java.lang.String toString(boolean verbose)
           
protected  int updatePosition(int offset, int max_offset)
          Called by InstructionList.setPositions when setting the position for every instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

next

Bytecodes.InstructionHandle next

prev

Bytecodes.InstructionHandle prev

instruction

Bytecodes.Instruction instruction

i_position

protected int i_position

targeters

private java.util.Set targeters

attributes

private java.util.Map attributes

ih_list

private static Bytecodes.InstructionHandle ih_list
Constructor Detail

Bytecodes.InstructionHandle

protected Bytecodes.InstructionHandle(Bytecodes.Instruction i)
Method Detail

getNext

public final Bytecodes.InstructionHandle getNext()

getPrev

public final Bytecodes.InstructionHandle getPrev()

getInstruction

public final Bytecodes.Instruction getInstruction()

setInstruction

public void setInstruction(Bytecodes.Instruction i)
Replace current instruction contained in this handle. Old instruction is disposed using Instruction.dispose().


swapInstruction

public Bytecodes.Instruction swapInstruction(Bytecodes.Instruction i)
Temporarily swap the current instruction, without disturbing anything. Meant to be used by a debugger, implementing breakpoints. Current instruction is returned.


getInstructionHandle

static final Bytecodes.InstructionHandle getInstructionHandle(Bytecodes.Instruction i)
Factory method.


updatePosition

protected int updatePosition(int offset,
                             int max_offset)
Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable length instructions `setPositions()' performs multiple passes over the instruction list to calculate the correct (byte) positions and offsets by calling this function.


getPosition

public int getPosition()

setPosition

void setPosition(int pos)
Set the position, i.e., the byte code offset of the contained instruction.


addHandle

protected void addHandle()
Overridden in BranchHandle


dispose

void dispose()
Delete contents, i.e., remove user access and make handle reusable.


removeAllTargeters

public void removeAllTargeters()
Remove all targeters, if any.


removeTargeter

public void removeTargeter(Bytecodes.InstructionTargeter t)
Denote this handle isn't referenced anymore by t.


addTargeter

public void addTargeter(Bytecodes.InstructionTargeter t)
Denote this handle is being referenced by t.


hasTargeters

public boolean hasTargeters()

getTargeters

public java.util.Set getTargeters()

toString

public java.lang.String toString(boolean verbose)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


addAttribute

public void addAttribute(java.lang.Object key,
                         java.lang.Object attr)
Add an attribute to an instruction handle.


removeAttribute

public void removeAttribute(java.lang.Object key)
Delete an attribute of an instruction handle.


getAttribute

public java.lang.Object getAttribute(java.lang.Object key)
Get attribute of an instruction handle.


accept

public void accept(Bytecodes.Visitor v)
Convenience method, simply calls accept() on the contained instruction.