com.joanju.cg.bytecode
Class SyshandleInstr

java.lang.Object
  extended by com.joanju.cg.bytecode.Bytecode
      extended by com.joanju.cg.bytecode.SyshandleInstr

public class SyshandleInstr
extends Bytecode

The built-in system handles for TARGET-PROCEDURE and SOURCE-PROCEDURE. The handleType field (see setHandleType()) determines which type of system handle this record represents.


Field Summary
static int HDL_TYPE_SOURCE_PROCEDURE
           
static int HDL_TYPE_TARGET_PROCEDURE
           
 
Fields inherited from class com.joanju.cg.bytecode.Bytecode
address, cuid, instrSet, nodeNum, xrefs
 
Constructor Summary
SyshandleInstr()
           
SyshandleInstr(int cuid, int address)
           
 
Method Summary
 void calcValueSets()
          Calculate the value sets for the instruction.
 int getHandleType()
           
 Opcode getOpcode()
           
 java.util.HashSet<java.lang.Integer> getValues()
          Get the set of values for this instruction.
 java.util.HashSet<java.lang.Integer> getWhereUsed()
          Returns null.
 void setHandleType(int newHandleType)
          Set the handle type.
protected  void setValuesFromByteStream(java.io.DataInputStream in)
           
 java.lang.String toStringFromComments(InstructionSet instrs)
          All Bytecode instruction subclasses should override this eventually.
 java.lang.String toStringFromData()
          Displays integer handle type, whereUsed, values.
 java.lang.String toStringFromName(InstructionSet instrs)
          Returns SOURCE-PROCEDURE or TARGET-PROCEDURE.
protected  void writeValuesToByteStream(java.io.DataOutputStream out)
           
 
Methods inherited from class com.joanju.cg.bytecode.Bytecode
addSource, addWhereUsed, beforeWrite, calcValuesAgain, compareTo, equals, fetchBytesFromDB, fetchInCu, generateDataForDB, getAddress, getCuID, getNodeNum, getSources, getValuesCalcLocal, getXrefs, hashCode, initData, isDataModified, isFromDB, setAddress, setCuID, setDataBytesFromDB, setDataModified, setFromDB, setInstructionSet, setNodeNum, shouldLoadData, sourcesForXrefTarget, storeIfModified, toString, toStringFromSet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HDL_TYPE_SOURCE_PROCEDURE

public static final int HDL_TYPE_SOURCE_PROCEDURE
See Also:
setHandleType(int), Constant Field Values

HDL_TYPE_TARGET_PROCEDURE

public static final int HDL_TYPE_TARGET_PROCEDURE
See Also:
setHandleType(int), Constant Field Values
Constructor Detail

SyshandleInstr

public SyshandleInstr()

SyshandleInstr

public SyshandleInstr(int cuid,
                      int address)
Method Detail

calcValueSets

public void calcValueSets()
                   throws java.sql.SQLException,
                          java.io.IOException
Description copied from class: Bytecode
Calculate the value sets for the instruction.

Called during build, build-recalc, checkvals, and checkvals-recalc. Implementations should only build from external values once. Calculates which xref records are needed as well.

IMPORTANT: Should only ever be called for instructions belonging to an InstructionSet.

Specified by:
calcValueSets in class Bytecode
Throws:
java.sql.SQLException
java.io.IOException

getHandleType

public int getHandleType()
See Also:
setHandleType(int)

getOpcode

public Opcode getOpcode()
Specified by:
getOpcode in class Bytecode

getValues

public java.util.HashSet<java.lang.Integer> getValues()
                                               throws java.sql.SQLException,
                                                      java.io.IOException
Description copied from class: Bytecode
Get the set of values for this instruction. Should be overridden by most subclasses. This default implementation returns a set containing one Layout.UNRESOLVED_VALUE.

Overrides:
getValues in class Bytecode
Throws:
java.sql.SQLException
java.io.IOException

getWhereUsed

public java.util.HashSet<java.lang.Integer> getWhereUsed()
                                                  throws java.sql.SQLException,
                                                         java.io.IOException
Description copied from class: Bytecode
Returns null. May be overridden by subclasses.

Overrides:
getWhereUsed in class Bytecode
Throws:
java.sql.SQLException
java.io.IOException

setHandleType

public void setHandleType(int newHandleType)
Set the handle type. Must be one of the HDL_TYPE_* integer values. Must be called when the record is created.


setValuesFromByteStream

protected void setValuesFromByteStream(java.io.DataInputStream in)
                                throws java.io.IOException
Specified by:
setValuesFromByteStream in class Bytecode
Throws:
java.io.IOException

toStringFromComments

public java.lang.String toStringFromComments(InstructionSet instrs)
                                      throws java.sql.SQLException
Description copied from class: Bytecode
All Bytecode instruction subclasses should override this eventually.

Overrides:
toStringFromComments in class Bytecode
Returns:
"" if not overridden.
Throws:
java.sql.SQLException

toStringFromData

public java.lang.String toStringFromData()
Displays integer handle type, whereUsed, values.

Overrides:
toStringFromData in class Bytecode
Returns:
"" if not overridden.

toStringFromName

public java.lang.String toStringFromName(InstructionSet instrs)
Returns SOURCE-PROCEDURE or TARGET-PROCEDURE.

Overrides:
toStringFromName in class Bytecode
Returns:
"" if not overridden.

writeValuesToByteStream

protected void writeValuesToByteStream(java.io.DataOutputStream out)
                                throws java.io.IOException
Specified by:
writeValuesToByteStream in class Bytecode
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.