com.joanju.cg.bytecode
Class AbstractCall

java.lang.Object
  extended by com.joanju.cg.bytecode.Bytecode
      extended by com.joanju.cg.bytecode.Endpoint
          extended by com.joanju.cg.bytecode.AbstractCall
Direct Known Subclasses:
CallInstr, CallsuperInstr

public abstract class AbstractCall
extends Endpoint


Field Summary
protected  int bitfield1
          Stored.
protected  java.util.HashSet<ProcedureInstr> externalMatching
          Note stored.
protected  java.util.HashSet<ProcedureInstr> externalUnmatched
          Note stored.
protected  java.util.HashSet<java.lang.Integer> localTargets
          Stored.
protected  int methodSigID
          Stored.
protected  int targetType
          Stored: int encoding for PROCEDURE/METHOD/FUNCTION.
protected  int whereUsedAddr
          Stored, address where this expression term is used.
 
Fields inherited from class com.joanju.cg.bytecode.Endpoint
longSignature
 
Fields inherited from class com.joanju.cg.bytecode.Bytecode
address, cuid, instrSet, nodeNum, xrefs
 
Constructor Summary
AbstractCall()
           
AbstractCall(int cuid, int address)
           
 
Method Summary
 void addWhereUsed(int addr)
          Called by the code generator if this expression term is used by another instruction.
 void beforeWrite(boolean isNewBuild)
          Create checkval records for this call instruction.
 void calcValueSets()
          This is a wrapper for calcValueSets2.
protected abstract  void calcValueSets2()
           
 void enableUserIgnoreMismatch()
          A user script may enable the ignore mismatches flag.
 void enableUserIgnoreUnresolved()
          A user script may enable the ignore unresolved flag.
 java.util.ArrayList<ProcedureInstr> getAllTargetProcedures()
          Get a list of all ProcedureInstr call targets, including those with mismatched method signatures.
abstract  int getColumn()
           
abstract  int getFileID()
           
abstract  int getLine()
           
abstract  java.util.HashSet<java.lang.Integer> getLocalTargets()
           
 java.lang.String getMethodSig()
           
 int getMethodSigID()
           
 int getTargetType()
           
 java.util.HashSet<java.lang.Integer> getValues()
          Get the return values for a function/method, or an empty set for a PROCEDURE.
 boolean hasLocalTarget(int procAddress)
           
 boolean isUserIgnoreMismatch()
          Has a user script enabled the ignore mismatches flag? Only read within Analyst for reporting purposes.
 boolean isUserIgnoreUnresolved()
          Has a user script enabled the ignore unresolved flag? Only read within Analyst for reporting purposes.
 void setTargetType(int targetType)
           
 
Methods inherited from class com.joanju.cg.bytecode.Endpoint
getLongSignature, setLongSignature
 
Methods inherited from class com.joanju.cg.bytecode.Bytecode
addSource, calcValuesAgain, compareTo, equals, fetchBytesFromDB, fetchInCu, generateDataForDB, getAddress, getCuID, getNodeNum, getOpcode, getSources, getValuesCalcLocal, getWhereUsed, getXrefs, hashCode, initData, isDataModified, isFromDB, setAddress, setCuID, setDataBytesFromDB, setDataModified, setFromDB, setInstructionSet, setNodeNum, setValuesFromByteStream, shouldLoadData, sourcesForXrefTarget, storeIfModified, toString, toStringFromComments, toStringFromData, toStringFromName, toStringFromSet, writeValuesToByteStream
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

bitfield1

protected int bitfield1
Stored.


methodSigID

protected int methodSigID
Stored.


targetType

protected int targetType
Stored: int encoding for PROCEDURE/METHOD/FUNCTION.


whereUsedAddr

protected int whereUsedAddr
Stored, address where this expression term is used. May be zero, indicating a call whos return value is unused. Because this is an expression term, its where-used is a single address rather than a set.


externalMatching

protected transient java.util.HashSet<ProcedureInstr> externalMatching
Note stored.


externalUnmatched

protected transient java.util.HashSet<ProcedureInstr> externalUnmatched
Note stored.


localTargets

protected java.util.HashSet<java.lang.Integer> localTargets
Stored.

Constructor Detail

AbstractCall

public AbstractCall()

AbstractCall

public AbstractCall(int cuid,
                    int address)
Method Detail

addWhereUsed

public final void addWhereUsed(int addr)
                        throws java.sql.SQLException,
                               java.io.IOException
Called by the code generator if this expression term is used by another instruction.

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

beforeWrite

public void beforeWrite(boolean isNewBuild)
                 throws java.sql.SQLException,
                        java.io.IOException
Create checkval records for this call instruction. If this is from the database (rather than a newly built record) then check for xref changes. If this is newly built, then add checkval records for all new xref targets. Any changes to local targets were processed as they were found in calcValueSets. Any procedure at the other end of a dropped or added xref record needs to have checkVals done. There's no processing for the special CUID_CALLNAME instruction addresses. Records of unresolved calls are not added to checkvals. Procedures deal with their own pop instructions.

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

calcValueSets

public void calcValueSets()
                   throws java.sql.SQLException,
                          java.io.IOException
This is a wrapper for calcValueSets2. This method only deals with tracking changes. It wraps calcValueSets2, which does the actual value set calculations.

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

calcValueSets2

protected abstract void calcValueSets2()
                                throws java.sql.SQLException,
                                       java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

enableUserIgnoreMismatch

public void enableUserIgnoreMismatch()
                              throws java.sql.SQLException,
                                     java.io.IOException
A user script may enable the ignore mismatches flag. Never set within Analyst itself.

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

enableUserIgnoreUnresolved

public void enableUserIgnoreUnresolved()
                                throws java.sql.SQLException,
                                       java.io.IOException
A user script may enable the ignore unresolved flag. Never set within Analyst itself.

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

getAllTargetProcedures

public java.util.ArrayList<ProcedureInstr> getAllTargetProcedures()
                                                           throws java.sql.SQLException,
                                                                  java.io.IOException
Get a list of all ProcedureInstr call targets, including those with mismatched method signatures. This is used for querying the database directly, and should never be used during a build for this CU.

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

getFileID

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

getLine

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

getColumn

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

getLocalTargets

public abstract java.util.HashSet<java.lang.Integer> getLocalTargets()
                                                              throws java.sql.SQLException,
                                                                     java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

getMethodSig

public java.lang.String getMethodSig()
                              throws java.sql.SQLException,
                                     java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

getMethodSigID

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

getTargetType

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

getValues

public final java.util.HashSet<java.lang.Integer> getValues()
                                                     throws java.sql.SQLException,
                                                            java.io.IOException
Get the return values for a function/method, or an empty set for a PROCEDURE. This returns getValues() from the last pop instruction of the call. I set this method to "final", just because I want to remember to add comments here if any subclasses override it.

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

hasLocalTarget

public boolean hasLocalTarget(int procAddress)
                       throws java.sql.SQLException,
                              java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

isUserIgnoreMismatch

public boolean isUserIgnoreMismatch()
                             throws java.sql.SQLException,
                                    java.io.IOException
Has a user script enabled the ignore mismatches flag? Only read within Analyst for reporting purposes.

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

isUserIgnoreUnresolved

public boolean isUserIgnoreUnresolved()
                               throws java.sql.SQLException,
                                      java.io.IOException
Has a user script enabled the ignore unresolved flag? Only read within Analyst for reporting purposes.

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

setTargetType

public void setTargetType(int targetType)


Copyright © 2008 Joanju Software. All Rights Reserved.