SandMark version 3.0


sandmark.watermark.ct.trace.callforest
Class Build

java.lang.Object
  |
  +--sandmark.watermark.ct.trace.callforest.Build

public class Build
extends java.lang.Object


Nested Class Summary
(package private) static class Build.Data
           
 
Field Summary
(package private)  TracePoint[] annotationPoints
           
(package private)  java.lang.String annotatorClass
           
(package private)  ClassHierarchy classHierarchy
           
(package private) static int DEFAULT_WEIGHT
           
(package private)  java.util.Vector forest
           
(package private)  java.util.Properties props
           
(package private)  java.util.Hashtable root2Graph
           
(package private)  StorageClass[] storageClasses
           
 
Constructor Summary
Build(TracePoint[] annotationPoints, ClassHierarchy classHierarchy, java.util.Properties props)
           
 
Method Summary
(package private)  java.util.Vector build()
          Build the information flow graph.
(package private)  boolean isMarkMethod(MethodID method)
          Return true if method is one of the mark()-methods in the annotator class.
(package private)  Graph newGraph(StackFrame root)
          Create a new graph (if necessary) corresponding to the bottom (root) stack frame of a thread.
(package private)  boolean okToAddStorageArgument(MethodID method)
          Return true if it OK to add a storage argument to this method.
(package private)  boolean sameStackFrame(StackFrame s1, StackFrame s2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

annotationPoints

TracePoint[] annotationPoints

props

java.util.Properties props

annotatorClass

java.lang.String annotatorClass

classHierarchy

ClassHierarchy classHierarchy

storageClasses

StorageClass[] storageClasses

forest

java.util.Vector forest

root2Graph

java.util.Hashtable root2Graph

DEFAULT_WEIGHT

static final int DEFAULT_WEIGHT
See Also:
Constant Field Values
Constructor Detail

Build

public Build(TracePoint[] annotationPoints,
             ClassHierarchy classHierarchy,
             java.util.Properties props)
Method Detail

build

java.util.Vector build()
Build the information flow graph. Add the following edges to the graph: callerEntryNode -> callerCallNode callerCallNode -> calleeEntryNode calleeExitNode -> callerReturnNode callerReturnNode -> callerExitNode calleeEnterNode -> calleeExitNode The top of the stack is in stack[0]. This holds the sm$mark()-call. The array of stacks looks like this:
      j==0              j==1
 =============================================================
                      +-------+
                    0 |sm$mark|   <--- topFrame
    +-------+         +-------+                              ^^
  0 |sm$mark|       1 |       |                              ||
    +-------+         +-------+                              ||
  1 |       |       2 |callee |   <--- calleeFrame  <-- i    ||
    +-------+         +-------+                              ||
  2 |       |       3 |caller |   <--- callerFrame           ||
    +-------+         +-------+                              ||
  3 |       |       4 |       |                              ||
    +-------+         +-------+                              
  4 | main  |       5 | main  |   <-- bottomFrame
    +-------+         +-------+
    lastStack        currentStack
 
Note that, for some retarded reason, sm$mark is at the bottom of the stack, not the top. In other words, stacks grow from high indices to low. This means that the lastStack and the currentStack are indexed differently.

lastStackCurrentFrameIndex holds the index of the frame in the last stack corresponding to the current frame in the current stack.

data is a matrix that holds data for each stack frame. data[j][i] holds the nodes created for frame i in stack j.


newGraph

Graph newGraph(StackFrame root)
Create a new graph (if necessary) corresponding to the bottom (root) stack frame of a thread.

Parameters:
root - The first (bottom) call frame of a thread

isMarkMethod

boolean isMarkMethod(MethodID method)
Return true if method is one of the mark()-methods in the annotator class.

Parameters:
method - the method

okToAddStorageArgument

boolean okToAddStorageArgument(MethodID method)
Return true if it OK to add a storage argument to this method. At this point we don't know exactly which type of storage we are going to use, so we'll try all of them.

Parameters:
method - the method

sameStackFrame

boolean sameStackFrame(StackFrame s1,
                       StackFrame s2)

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003