com.joanju.cg.bytecode
Class DefsharedInstr

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

public class DefsharedInstr
extends Bytecode


Field Summary
static DefsharedInstr SAMPLE_OBJECT
          Can be used as an argument for some templated/generic methods.
 
Fields inherited from class com.joanju.cg.bytecode.Bytecode
address, cuid, instrSet, nodeNum, xrefs
 
Constructor Summary
DefsharedInstr()
           
DefsharedInstr(int cuid, int address)
           
DefsharedInstr(int cuid, int address, int strID)
           
 
Method Summary
 void beforeWrite(boolean isNewBuild)
          Called when a build or checkval is done processing a CU, before writing the new/changed records.
 void calcValueSets()
          Calculate the value sets for the instruction.
 java.util.HashSet<java.lang.Integer> getContributedValues()
          These are the values that are contributed to the shared var.
 int getDefglobalAddr()
           
 Opcode getOpcode()
           
 java.util.HashSet<java.lang.Integer> getSources()
          Returns null.
 java.util.HashSet<java.lang.Integer> getValues()
          Get the global values as well as the locally contributed ones.
 java.util.HashSet<java.lang.Integer> getWhereUsed()
          Returns null.
 void setDefglobalAddr(int defglobalAddr)
           
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()
          All Bytecode instruction subclasses should override this eventually.
 java.lang.String toStringFromName(InstructionSet instrs)
          Some subclasses should override this to return the string literal, var name, procedure name, etc.
protected  void writeValuesToByteStream(java.io.DataOutputStream out)
           
 
Methods inherited from class com.joanju.cg.bytecode.Bytecode
addSource, addWhereUsed, calcValuesAgain, compareTo, equals, fetchBytesFromDB, fetchInCu, generateDataForDB, getAddress, getCuID, getNodeNum, 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

SAMPLE_OBJECT

public static final DefsharedInstr SAMPLE_OBJECT
Can be used as an argument for some templated/generic methods.

Constructor Detail

DefsharedInstr

public DefsharedInstr()

DefsharedInstr

public DefsharedInstr(int cuid,
                      int address)

DefsharedInstr

public DefsharedInstr(int cuid,
                      int address,
                      int strID)
Method Detail

beforeWrite

public void beforeWrite(boolean isNewBuild)
                 throws java.sql.SQLException,
                        java.io.IOException
Description copied from class: Bytecode
Called when a build or checkval is done processing a CU, before writing the new/changed records. This base class implementation is a no-op.

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

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

getDefglobalAddr

public int getDefglobalAddr()
                     throws java.sql.SQLException,
                            java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

getContributedValues

public java.util.HashSet<java.lang.Integer> getContributedValues()
                                                          throws java.sql.SQLException,
                                                                 java.io.IOException
These are the values that are contributed to the shared var.

Throws:
java.sql.SQLException
java.io.IOException

getSources

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

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

getValues

public java.util.HashSet<java.lang.Integer> getValues()
                                               throws java.sql.SQLException,
                                                      java.io.IOException
Get the global values as well as the locally contributed ones. Most of the times when this is called, the locally contributed values will already be included in the global values.

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

setDefglobalAddr

public void setDefglobalAddr(int defglobalAddr)

getOpcode

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

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)
Description copied from class: Bytecode
All Bytecode instruction subclasses should override this eventually.

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

toStringFromData

public java.lang.String toStringFromData()
Description copied from class: Bytecode
All Bytecode instruction subclasses should override this eventually.

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

toStringFromName

public java.lang.String toStringFromName(InstructionSet instrs)
Description copied from class: Bytecode
Some subclasses should override this to return the string literal, var name, procedure name, etc.

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.