daikon.dcomp
Class DCRuntime

Object
  extended by DCRuntime

public final class DCRuntime
extends Object


Nested Class Summary
static class DCRuntime.BranchInfo
          Information about a value encountered at a branch.
static class DCRuntime.FieldTag
          Abstract base class for code that gets the tag associated with a particular field.
static class DCRuntime.PrimitiveArrayTag
          Class that gets the list of tags for primitive arrays.
static class DCRuntime.PrimitiveTag
          Class that gets the tag for a primitive instance field.
static class DCRuntime.ReferenceTag
          Class that returns the tag for a reference instance field.
static class DCRuntime.StaticPrimitiveTag
          Class that gets the tag for static primitive fields.
static class DCRuntime.StaticReferenceTag
          Class that gets the tag for a static reference variable.
 
Field Summary
static List<DCRuntime.BranchInfo> branch_tags
          Information about each of the values encountered at a frontier branch
static Class<?> dcompmarker
          Either java.lang.DCompMarker or daikon.dcomp.DCompMarker
static boolean debug
           
static SimpleLog debug_arr_index
           
static SimpleLog debug_decl_print
           
static SimpleLog debug_df
           
static SimpleLog debug_df_branch
           
static SimpleLog debug_merge_comp
           
static boolean debug_objects
           
static SimpleLog debug_primitive
           
static boolean debug_tag_frame
           
static SimpleLog debug_timing
           
static int depth
          Depth to follow fields in classes
static WeakIdentityHashMap<Object,ValueSource> df_arrlen_map
          Map from tag to dataflow values for the length of an array.
static Throwable exit_exception
          If the application exits with an exception, it should be placed here
static WeakIdentityHashMap<Object,Object[]> field_map
          Map from each object to the tags used for each primitive value in the object.
static SimpleLog merge_dv
           
static Object method_marker
          Object used to mark procedure entries in the tag stack.
static List<MethodInfo> methods
          List of all instrumented methods
static List<Object> static_tags
          Storage for each static tag
static WeakIdentityHashMap<Object,ValueSource> tag_map
          Map in Dataflow from tag to the set of valus that have contributed to its current value
static Stack<Object> tag_stack
          Tag stack
static SimpleLog time_decl
           
 
Constructor Summary
DCRuntime()
           
 
Method Summary
static void aastore_df(Object[] arr, int index, Object val)
          Execute an aastore instruction and mark the array and its index as comparable.
static void aastore(Object[] arr, int index, Object val)
          Execute an aastore instruction and mark the array and its index as comparable.
static void arraylen_df(Object arr)
          Finds the DF for the length of the specified array and pushes a tag on the tag stack that refers to that DF.
static void bastore_df(byte[] arr, int index, byte val)
          Execute an bastore instruction and manipulate the tags accordingly.
static void bastore(byte[] arr, int index, byte val)
          Execute an bastore instruction and manipulate the tags accordingly.
static void binary_tag_df()
          Handle a binary operation on the two items at the top of the tag stack.
static void binary_tag_op()
          Handle a binary operation on the two items at the top of the tag stack.
static Boolean Boolean_valueOf(boolean val)
          DF of result is equal to DF of argument
static void castore_df(char[] arr, int index, char val)
          Execute an castore instruction and manipulate the tags accordingly.
static void castore(char[] arr, int index, char val)
          Execute an castore instruction and manipulate the tags accordingly.
static void class_init(String classname)
          Marks the specified class as initialized.
static String clean_decl_name(String decl_name)
          Removes DCompMarker from the signature
static void cmp_op()
          Handles an i_cmpXX operation.
static Object[] create_tag_frame(String params)
          Create the tag frame for this method.
static void dastore_df(double[] arr, int index, double val)
          Execute an dastore instruction and manipulate the tags accordingly.
static void dastore(double[] arr, int index, double val)
          Execute an dastore instruction and manipulate the tags accordingly.
static Object dcomp_clone(Object o)
          Handles clone() calls.
static boolean dcomp_equals(Object o1, Object o2)
          Handles calls to instrumented equals() methods.
static Object dcomp_super_clone(Object o)
          Handles super.clone() calls.
static boolean dcomp_super_equals(Object o1, Object o2)
          Handles super.equals(Object) calls.
static void decl_stats()
          prints statistics about the number of decls to stdout
static void discard_tag(int cnt)
          Discard the tag on the top of the tag stack.
static Double Double_valueOf(double val)
          DF of result is equal to DF of argument
static void dup_obj_tag_val(Object obj)
          Determines the values associated with the object and pushes a new tag on the tag stack that refers to those same values.
static void dup_x1()
          Handles a dup_x1 opcode on a primitive
static void dup_x2()
          Handles a dup_x2 opcode on a primitive.
static void dup()
          Handles a dup opcode on a primitive
static void dup2_x1()
           
static void dup2_x2()
           
static void dup2()
           
static void enter_refs_only(Object obj, int mi_index, Object[] args)
          Called when a user method is entered.
static void enter(Object[] tag_frame, Object obj, int mi_index, Object[] args)
          Called when a user method is entered.
static boolean equals_df(Object o1, Object o2)
          Calculates dataflow for o1.equals(o2).
static void exception_exit_refs_only()
          Clean up the tag stack on an exception exit from a method.
static void exception_exit()
          Clean up the tag stack on an exception exit from a method.
static void exit_refs_only(Object obj, int mi_index, Object[] args, Object ret_val, int exit_line_number)
          Called when a user method exits.
static void exit(Object[] tag_frame, Object obj, int mi_index, Object[] args, Object ret_val, int exit_line_number)
          Called when a user method exits.
static void fastore_df(float[] arr, int index, float val)
          Execute an fastore instruction and manipulate the tags accordingly.
static void fastore(float[] arr, int index, float val)
          Execute an fastore instruction and manipulate the tags accordingly.
static Float Float_valueOf(float val)
          DF of result is equal to DF of argument
static Object get_object_field(Field f, Object obj)
          Gets the object in field f in object obj.
static boolean has_instrumented(Class<?> c, String method_name)
          Returns true if c or any of its superclasses has an instrumented version of method.
static void iastore_df(int[] arr, int index, int val)
          Execute an iastore instruction and manipulate the tags accordingly.
static void iastore(int[] arr, int index, int val)
          Execute an iastore instruction and manipulate the tags accordingly.
static void init()
          Perform any initialization required before instrumentation begins
static void int2_branch_df(int val1, int val2)
          Captures the DF information for a frontier branch over two integers
static Integer Integer_decode(String str)
          DF of result is equal to DF of argument
static int Integer_intValue(Integer obj)
          DF of result is equal to DF of argument
static Integer Integer_valueOf(int val)
          DF of result is equal to DF of argument
static boolean is_class_init(Class<?> clazz)
          Returns whether or not the specified class is initialized
static void lastore_df(long[] arr, int index, long val)
          Execute an lastore instruction and manipulate the tags accordingly.
static void lastore(long[] arr, int index, long val)
          Execute an lastore instruction and manipulate the tags accordingly.
static Long Long_valueOf(long val)
          DF of result is equal to DF of argument
static void multianewarray2(int count1, int count2, Object[] arr)
          Make the count arguments to multianewarray comparable to the corresponding array indices. count1 is made comparable to the index of the given array (arr), and count2 is made comparable to the index of each array that is an element of arr.
static void normal_exit_primitive()
          Called for exits from methods with a primitive return type.
static void normal_exit_refs_only()
          Used when we are only interested in references.
static void normal_exit()
          Make sure the tag stack for this method is empty before exit
static int num_prim_fields(Class<?> clazz)
          Return the number of primitive fields in clazz and all of its superclasses
static boolean object_eq(Object obj1, Object obj2)
          Handle object comparison.
static boolean object_ne(Object obj1, Object obj2)
          Handle object comparison.
static void pop_field_tag(Object obj, int field_num)
          Pops the tag from the top of the tag stack and stores it in the tag storage for the specified field of the specified object.
static void pop_local_obj_df(Object obj, int index)
          Adds the specified local to the DataFlow for obj.
static void pop_local_tag_df(Object[] tag_frame, int index)
          Pops the top of the tag stack into tag_frame[index].
static void pop_local_tag(Object[] tag_frame, int index)
          Pops the top of the tag stack into tag_frame[index]
static void pop_static_tag(int static_num)
          Pops the top of the tag stack into the tag storage for static_num
static Object pop_tag()
          Pops the top tag from the tag stack and returns it
static void prim_branch_df(int compared_to)
          Prints the DF for the tag on the top of the tag stack
static void primitive_array_load_df(Object arr_ref, int index)
          Handles the various primitive (int, double, etc) array load instructions.
static void primitive_array_load_null_ok(Object arr_ref, int index)
          Handles the various primitive (int, double, etc) array load instructions.
static void primitive_array_load(Object arr_ref, int index)
          Handles the various primitive (int, double, etc) array load instructions.
static void print_all_comparable_refs_only(PrintWriter ps)
          Dumps out comparability information for all classes that were processed.
static void print_all_comparable(PrintWriter ps)
          Dumps out comparability information for all classes that were processed.
static void print_class_decl(PrintWriter ps, ClassInfo ci)
          Calculates and prints the declarations for the specified class
static void print_comparable_refs_only(PrintWriter ps, MethodInfo mi)
          Prints comparability information for the enter and exit points of the specified method.
static void print_comparable_traced(PrintWriter ps, MethodInfo mi)
           
static void print_comparable(PrintWriter ps, MethodInfo mi)
          Prints comparability information for the enter and exit points of the specified method.
static void print_decl_file(PrintWriter ps)
           
static List<DCRuntime.DVSet> print_decl(PrintWriter ps, MethodInfo mi)
          Prints a decl ENTER/EXIT records with comparability.
static void process_all_vars_refs_only(MethodInfo mi, RootInfo root, Object obj, Object[] args, Object ret_val)
          Process all of the daikon variables in the tree starting at root.
static void process_all_vars(MethodInfo mi, RootInfo root, Object[] tag_frame, Object obj, Object[] args, Object ret_val)
          Process all of the daikon variables in the tree starting at root.
static void push_array_tag(Object arr_ref)
          Pushes an array reference on the tag stack
static void push_const_obj_src(Object obj, String descr)
          Builds a new value set that contains only this value (as described in descr).
static void push_const_src(String descr)
          Builds a new value set that contains only this value (as described in descr).
static void push_const()
          Allocate a new tag for the constant and push it on the tag stack.
static void push_field_tag_null_ok(Object obj, int field_num)
          Pushes the tag associated with field_num in obj on the tag stack.
static void push_field_tag(Object obj, int field_num)
          Pushes the tag associated with field_num in obj on the tag stack.
static void push_local_tag(Object[] tag_frame, int index)
          Pushes the tag at tag_frame[index] on the tag stack
static void push_static_tag(int static_num)
          Pushes the tag associated with the static static_num on the tag stack
static void push_tag(Object tag)
          Pushes the argument tag on the tag stack
static void ref_array_load_df(Object arr_ref, int index)
          Handles the aaload instruction.
static void ref_array_load(Object arr_ref, int index)
          Handles the aaload instruction.
static Object ref_cmp_null_df(Object obj)
          Captures the DF information for a branch that compares the specified object to null.
static void ref2_branch_df(Object obj1, Object obj2)
          Captures the DF information for a branch that compares the two specified objects.
static void sastore_df(short[] arr, int index, short val)
          Execute an sastore instruction and manipulate the tags accordingly.
static void sastore(short[] arr, int index, short val)
          Execute an sastore instruction and manipulate the tags accordingly.
static void setup_array_df(Object arr_ref, String descr)
          Sets up the dataflow information for an array allocation.
static void setup_multiarray_df(Object arr, int dims, String descr)
          Sets up the dataflow information for an multi-dimensional array allocation.
static void setup_obj_df(Object obj, String descr)
          Sets up the dataflow information for a new object.
static Short Short_valueOf(short val)
          DF of result is equal to DF of argument
static String String_valueOf(Object obj)
          DF of result is equal to DF of argument
static StringBuffer StringBuffer_append(StringBuffer buff, CharSequence s)
          DF of result is equal to the union of the DF of the two arguments
static StringBuffer StringBuffer_append(StringBuffer buff, String s)
          DF of result is equal to the union of the DF of the two arguments
static void super_equals_df(Object o1, Object o2)
          Handles a call to an uninstrumented super equals.
static void swap()
          swaps the two elements on the top of the tag stack
static String tag_field_name(String field_name)
          Returns the name of the tag field that corresponds to the specified field
static void throw_op()
          Cleans up the tag stack when an exception is thrown
static void trace_all_comparable(PrintWriter ps)
           
static Object uninstrumented_clone_df(Object orig_obj, Object clone_obj)
          Handle an uninstrumented clone call by transferring the dataflow from the original object to the clone.
static Object uninstrumented_clone(Object orig_obj, Object clone_obj)
          Handle an uninstrumented clone call by making the two objects comparable.
static String uninstrumented_toString_df(Object orig_obj, String result)
          Handle an uninstrumented toString call.
static String uninstrumented_toString(Object orig_obj, String result)
          Handle an uninstrumented toString call.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

methods

public static final List<MethodInfo> methods
List of all instrumented methods


depth

public static int depth
Depth to follow fields in classes


exit_exception

public static Throwable exit_exception
If the application exits with an exception, it should be placed here


static_tags

public static List<Object> static_tags
Storage for each static tag


tag_stack

public static Stack<Object> tag_stack
Tag stack


method_marker

public static Object method_marker
Object used to mark procedure entries in the tag stack. It is pushed on the stack at entry and checked on exit to make sure it is in on the top of the stack. That allows us to determine which method caused a tag stack problem.


debug

public static final boolean debug
See Also:
Constant Field Values

debug_tag_frame

public static final boolean debug_tag_frame
See Also:
Constant Field Values

debug_objects

public static final boolean debug_objects
See Also:
Constant Field Values

merge_dv

public static final SimpleLog merge_dv

debug_arr_index

public static final SimpleLog debug_arr_index

debug_primitive

public static final SimpleLog debug_primitive

debug_merge_comp

public static final SimpleLog debug_merge_comp

debug_timing

public static final SimpleLog debug_timing

debug_decl_print

public static final SimpleLog debug_decl_print

time_decl

public static final SimpleLog time_decl

debug_df

public static final SimpleLog debug_df

debug_df_branch

public static final SimpleLog debug_df_branch

field_map

public static WeakIdentityHashMap<Object,Object[]> field_map
Map from each object to the tags used for each primitive value in the object.


tag_map

public static WeakIdentityHashMap<Object,ValueSource> tag_map
Map in Dataflow from tag to the set of valus that have contributed to its current value


df_arrlen_map

public static WeakIdentityHashMap<Object,ValueSource> df_arrlen_map
Map from tag to dataflow values for the length of an array. There should only be entries for arrays


branch_tags

public static List<DCRuntime.BranchInfo> branch_tags
Information about each of the values encountered at a frontier branch


dcompmarker

public static Class<?> dcompmarker
Either java.lang.DCompMarker or daikon.dcomp.DCompMarker

Constructor Detail

DCRuntime

public DCRuntime()
Method Detail

init

public static void init()
Perform any initialization required before instrumentation begins


dcomp_equals

public static boolean dcomp_equals(Object o1,
                                   Object o2)
Handles calls to instrumented equals() methods.


dcomp_super_equals

public static boolean dcomp_super_equals(Object o1,
                                         Object o2)
Handles super.equals(Object) calls.

See Also:
active_equals_calls

dcomp_clone

public static Object dcomp_clone(Object o)
                          throws Throwable
Handles clone() calls.

This method throws Throwable because it may throw any checked exception that is thrown by o.clone().

Throws:
Throwable

dcomp_super_clone

public static Object dcomp_super_clone(Object o)
                                throws Throwable
Handles super.clone() calls.

Throws:
Throwable
See Also:
active_clone_calls

has_instrumented

public static boolean has_instrumented(Class<?> c,
                                       String method_name)
Returns true if c or any of its superclasses has an instrumented version of method. method should be an Object method with no arguments


uninstrumented_clone

public static Object uninstrumented_clone(Object orig_obj,
                                          Object clone_obj)
Handle an uninstrumented clone call by making the two objects comparable. Really should make all of their fields comparable instead. Returns the cloned object.


uninstrumented_toString

public static String uninstrumented_toString(Object orig_obj,
                                             String result)
Handle an uninstrumented toString call. Since comparability doesn't seem to be related to toString, this does nothing.


object_eq

public static boolean object_eq(Object obj1,
                                Object obj2)
Handle object comparison. Marks the two objects as comparable and returns whether or not they are equal. Used as part of a replacement for IF_ACMPEQ


object_ne

public static boolean object_ne(Object obj1,
                                Object obj2)
Handle object comparison. Marks the two objects as comparable and returns whether or not they are equal. Used as part of a replacement for IF_ACMPNE


create_tag_frame

public static Object[] create_tag_frame(String params)
Create the tag frame for this method. Pop the tags for any primitive parameters off of the tag stack and store them in the tag frame.

Parameters:
params - Encodes the position of the primitive parameters into a string. The first character is size of the tag frame. The remaining characters indicate where each parameter on the tag stack should be stored into the frame. For example "20" allocates a tag frame with two elements and stores the top of the tag stack into element 0. A string is used for simplicity in code generation since strings can easily be placed into the constant portion of the class file. Note that characters are determined by adding the integer value to '0'. Values greater than 9 will have unintuitive (but printable) values.
Returns:
the allocated and initialized tag frame

normal_exit

public static void normal_exit()
Make sure the tag stack for this method is empty before exit


normal_exit_primitive

public static void normal_exit_primitive()
Called for exits from methods with a primitive return type. Pop the return type off of the tag stack, make sure the tags stack is empty for this method and then put the return value back on the tag stack


normal_exit_refs_only

public static void normal_exit_refs_only()
Used when we are only interested in references. We don't use the tag stack, so nothing needs to be done here. (Reference comparability only.)


exception_exit

public static void exception_exit()
Clean up the tag stack on an exception exit from a method. Pops items off of the tag stack until the method marker is found


exception_exit_refs_only

public static void exception_exit_refs_only()
Clean up the tag stack on an exception exit from a method. Pops items off of the tag stack until the method marker is found (Reference comparability only.)


throw_op

public static void throw_op()
Cleans up the tag stack when an exception is thrown


push_local_tag

public static void push_local_tag(Object[] tag_frame,
                                  int index)
Pushes the tag at tag_frame[index] on the tag stack


pop_local_tag

public static void pop_local_tag(Object[] tag_frame,
                                 int index)
Pops the top of the tag stack into tag_frame[index]


push_tag

public static void push_tag(Object tag)
Pushes the argument tag on the tag stack


pop_tag

public static Object pop_tag()
Pops the top tag from the tag stack and returns it


push_static_tag

public static void push_static_tag(int static_num)
Pushes the tag associated with the static static_num on the tag stack


push_array_tag

public static void push_array_tag(Object arr_ref)
Pushes an array reference on the tag stack


pop_static_tag

public static void pop_static_tag(int static_num)
Pops the top of the tag stack into the tag storage for static_num


discard_tag

public static void discard_tag(int cnt)
Discard the tag on the top of the tag stack. Called when primitives are pushed but not used in expressions (such as when allocating arrays)


aastore

public static void aastore(Object[] arr,
                           int index,
                           Object val)
Execute an aastore instruction and mark the array and its index as comparable.


bastore

public static void bastore(byte[] arr,
                           int index,
                           byte val)
Execute an bastore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


castore

public static void castore(char[] arr,
                           int index,
                           char val)
Execute an castore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


dastore

public static void dastore(double[] arr,
                           int index,
                           double val)
Execute an dastore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


fastore

public static void fastore(float[] arr,
                           int index,
                           float val)
Execute an fastore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


iastore

public static void iastore(int[] arr,
                           int index,
                           int val)
Execute an iastore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


lastore

public static void lastore(long[] arr,
                           int index,
                           long val)
Execute an lastore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


sastore

public static void sastore(short[] arr,
                           int index,
                           short val)
Execute an sastore instruction and manipulate the tags accordingly. The tag at the top of stack is stored into the tag storage for the array.


multianewarray2

public static void multianewarray2(int count1,
                                   int count2,
                                   Object[] arr)
Make the count arguments to multianewarray comparable to the corresponding array indices. count1 is made comparable to the index of the given array (arr), and count2 is made comparable to the index of each array that is an element of arr.


enter

public static void enter(Object[] tag_frame,
                         Object obj,
                         int mi_index,
                         Object[] args)
Called when a user method is entered. Any daikon variables whose current values are comparable are marked as comparable.

Parameters:
tag_frame - tag_frame containing the tags for the primitive arguments of this method.
obj - value of 'this'. Null if the method is static
mi_index - index into the list of all methods (methods)
args - Array of the arguments to the method.

enter_refs_only

public static void enter_refs_only(Object obj,
                                   int mi_index,
                                   Object[] args)
Called when a user method is entered. Any daikon variables whose current values are comparable are marked as comparable. (Reference comparability only.)

Parameters:
obj - value of 'this'. Null if the method is static
mi_index - index into the list of all methods (methods)
args - Array of the arguments to the method.

exit

public static void exit(Object[] tag_frame,
                        Object obj,
                        int mi_index,
                        Object[] args,
                        Object ret_val,
                        int exit_line_number)
Called when a user method exits. Any daikon variables whose current values are comparable are marked as comparable.

Parameters:
tag_frame - tag_frame containing the tags for the primitive arguments of this method.
obj - value of 'this'. Null if the method is static
mi_index - index into the list of all methods (methods)
args - Array of the arguments to the method.
ret_val - Value returned by the method. Null if the method is a constructor or void,
exit_line_number - the source line number of this exit point

exit_refs_only

public static void exit_refs_only(Object obj,
                                  int mi_index,
                                  Object[] args,
                                  Object ret_val,
                                  int exit_line_number)
Called when a user method exits. Any daikon variables whose current values are comparable are marked as comparable. (Reference comparability only.)

Parameters:
obj - value of 'this'. Null if the method is static
mi_index - index into the list of all methods (methods)
args - Array of the arguments to the method.
ret_val - Value returned by the method. Null if the method is a constructor or void,
exit_line_number - the source line number of this exit point

process_all_vars

public static void process_all_vars(MethodInfo mi,
                                    RootInfo root,
                                    Object[] tag_frame,
                                    Object obj,
                                    Object[] args,
                                    Object ret_val)
Process all of the daikon variables in the tree starting at root. If the values referenced by those variables are comparable mark the variables as comparable.


process_all_vars_refs_only

public static void process_all_vars_refs_only(MethodInfo mi,
                                              RootInfo root,
                                              Object obj,
                                              Object[] args,
                                              Object ret_val)
Process all of the daikon variables in the tree starting at root. If the values referenced by those variables are comparable mark the variables as comparable. (Reference comparability only.)


get_object_field

public static Object get_object_field(Field f,
                                      Object obj)
Gets the object in field f in object obj. Exceptions are turned into Errors


print_all_comparable

public static void print_all_comparable(PrintWriter ps)
Dumps out comparability information for all classes that were processed.


print_all_comparable_refs_only

public static void print_all_comparable_refs_only(PrintWriter ps)
Dumps out comparability information for all classes that were processed. (Reference comparability only.)


trace_all_comparable

public static void trace_all_comparable(PrintWriter ps)

print_decl_file

public static void print_decl_file(PrintWriter ps)

decl_stats

public static void decl_stats()
prints statistics about the number of decls to stdout


print_class_decl

public static void print_class_decl(PrintWriter ps,
                                    ClassInfo ci)
Calculates and prints the declarations for the specified class


print_decl

public static List<DCRuntime.DVSet> print_decl(PrintWriter ps,
                                               MethodInfo mi)
Prints a decl ENTER/EXIT records with comparability. Returns the list of comparabile DVSets for the exit.


print_comparable

public static void print_comparable(PrintWriter ps,
                                    MethodInfo mi)
Prints comparability information for the enter and exit points of the specified method. By default, outputs to foo.txt-cset


print_comparable_refs_only

public static void print_comparable_refs_only(PrintWriter ps,
                                              MethodInfo mi)
Prints comparability information for the enter and exit points of the specified method. By default, outputs to foo.txt-cset (Reference comparability only.)


print_comparable_traced

public static void print_comparable_traced(PrintWriter ps,
                                           MethodInfo mi)

push_field_tag

public static void push_field_tag(Object obj,
                                  int field_num)
Pushes the tag associated with field_num in obj on the tag stack. A tag value must have been previously stored for this field. Use push_field_tag_null_ok() if the tag may not have been previously stored.


push_field_tag_null_ok

public static void push_field_tag_null_ok(Object obj,
                                          int field_num)
Pushes the tag associated with field_num in obj on the tag stack. If tag storage for this object has not been previously allocated it is allocated now and a tag is allocated for this field. This should only be called for objects whose fields can be read without having been previously written (in java)


pop_field_tag

public static void pop_field_tag(Object obj,
                                 int field_num)
Pops the tag from the top of the tag stack and stores it in the tag storage for the specified field of the specified object. If tag storage was not previously allocated, it is allocated now


num_prim_fields

public static int num_prim_fields(Class<?> clazz)
Return the number of primitive fields in clazz and all of its superclasses


binary_tag_op

public static void binary_tag_op()
Handle a binary operation on the two items at the top of the tag stack. Binary operations pop the two items off of the top of the stack perform an operation and push the result back on the stack. The tags of the two items on the top of the stack must thus be merged and a representative tag pushed back on the stack.


cmp_op

public static void cmp_op()
Handles an i_cmpXX operation. This opcode compares the two integers on the top of the stack and jumps accordingly. Thus the two tags on the top of the stack are popped from the tag stack and merged. Very similar to binary_tag_op except that nothing is pushed back on the tag stack.


dup

public static void dup()
Handles a dup opcode on a primitive


dup_x1

public static void dup_x1()
Handles a dup_x1 opcode on a primitive


dup_x2

public static void dup_x2()
Handles a dup_x2 opcode on a primitive. Currently only support category 1 computational types


dup2

public static void dup2()

dup2_x1

public static void dup2_x1()

dup2_x2

public static void dup2_x2()

swap

public static void swap()
swaps the two elements on the top of the tag stack


primitive_array_load

public static void primitive_array_load(Object arr_ref,
                                        int index)
Handles the various primitive (int, double, etc) array load instructions. The array and its index are made comparable. The tag for the index is removed from the tag stack and the tag for the array element is pushed on the stack. The tag for the specified index must exist. If it is reasonable for the tag not to exist, then primitive_array_load_null_ok() should be used instead.


primitive_array_load_null_ok

public static void primitive_array_load_null_ok(Object arr_ref,
                                                int index)
Handles the various primitive (int, double, etc) array load instructions. The array and its index are made comparable. The tag for the index is removed from the tag stack and the tag for the array element is pushed on the stack. Unlike primitive_array_load(), this method handles array elements whose tags have not previously been set. This can happen when the JVM sets an array element directly and there is no corresponding java code that can set the tag.


ref_array_load

public static void ref_array_load(Object arr_ref,
                                  int index)
Handles the aaload instruction. The arry and its index are made comparable. The tag for the index is removed from the tag stack.


push_const

public static void push_const()
Allocate a new tag for the constant and push it on the tag stack. Note that this allocates a new tag each time the constant is pushed. If the same code is executed multiple time (eg, in a loop), and different values interact with the constant each time, those values will not end up comparable to each other.


class_init

public static void class_init(String classname)
Marks the specified class as initialized. We don't look at static variables in classes until they are initialized


is_class_init

public static boolean is_class_init(Class<?> clazz)
Returns whether or not the specified class is initialized


tag_field_name

public static String tag_field_name(String field_name)
Returns the name of the tag field that corresponds to the specified field


clean_decl_name

public static String clean_decl_name(String decl_name)
Removes DCompMarker from the signature


dup_obj_tag_val

public static void dup_obj_tag_val(Object obj)
Determines the values associated with the object and pushes a new tag on the tag stack that refers to those same values. Used when the result value of an operation on an object has the same dataflow as that of the object


arraylen_df

public static void arraylen_df(Object arr)
Finds the DF for the length of the specified array and pushes a tag on the tag stack that refers to that DF. Used for arraylength opcodes


push_const_src

public static void push_const_src(String descr)
Builds a new value set that contains only this value (as described in descr). Allocates a new tag, associates it with the value set and pushes it on the tag stack. Used when a constant is pushed


push_const_obj_src

public static void push_const_obj_src(Object obj,
                                      String descr)
Builds a new value set that contains only this value (as described in descr). Associates the object with the value set Used when a constant string/class (ldc) is pushed


binary_tag_df

public static void binary_tag_df()
Handle a binary operation on the two items at the top of the tag stack. Binary operations pop the two items off of the top of the stack perform an operation and push the result back on the stack. The tags of the two items on the top of the stack must be popped off and a new tag created and pushed that refers to the sources of each of the operands.


pop_local_tag_df

public static void pop_local_tag_df(Object[] tag_frame,
                                    int index)
Pops the top of the tag stack into tag_frame[index]. Adds the local's index to the DF. Used to determine what variables in the test sequence have seen this value. Should only be called if the pop is in the test sequence method


pop_local_obj_df

public static void pop_local_obj_df(Object obj,
                                    int index)
Adds the specified local to the DataFlow for obj. Should only be called if the store is in the test sequence method


setup_obj_df

public static void setup_obj_df(Object obj,
                                String descr)
Sets up the dataflow information for a new object. The object is associated with the specified description


setup_array_df

public static void setup_array_df(Object arr_ref,
                                  String descr)
Sets up the dataflow information for an array allocation. The length of the array is associated with the size argument (on the top of the tag stack). The array itself is associated wit the specified description


setup_multiarray_df

public static void setup_multiarray_df(Object arr,
                                       int dims,
                                       String descr)
Sets up the dataflow information for an multi-dimensional array allocation. The multi-dimensional array allocate instruction takes the size of each dimension from the stack. The tags for each of these sizes are thus on the tag stack. The length of each allocated array is associated with its size argument. The array itself is associated wit the specified description


primitive_array_load_df

public static void primitive_array_load_df(Object arr_ref,
                                           int index)
Handles the various primitive (int, double, etc) array load instructions. The tag for the index is removed from the tag stack and the tag for the array element is pushed on the stack. The resulting DF value is the union of the index DF and the array element DF (since the changing the index, will definitely change the value). This method handles array elements whose tags have not previously been set. This can happen when the JVM sets an array element directly and there is no corresponding java code that can set the tag.


ref_array_load_df

public static void ref_array_load_df(Object arr_ref,
                                     int index)
Handles the aaload instruction. The tag for the index is popped from the tag stack. The DF value for the result is the union of the index DF and the array element DF (since the changing the index, will definitely change the value). Note that no tag is pushed on the tag stack because the result is not a primitive.


aastore_df

public static void aastore_df(Object[] arr,
                              int index,
                              Object val)
Execute an aastore instruction and mark the array and its index as comparable.


bastore_df

public static void bastore_df(byte[] arr,
                              int index,
                              byte val)
Execute an bastore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

castore_df

public static void castore_df(char[] arr,
                              int index,
                              char val)
Execute an castore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

dastore_df

public static void dastore_df(double[] arr,
                              int index,
                              double val)
Execute an dastore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

fastore_df

public static void fastore_df(float[] arr,
                              int index,
                              float val)
Execute an fastore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

iastore_df

public static void iastore_df(int[] arr,
                              int index,
                              int val)
Execute an iastore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

lastore_df

public static void lastore_df(long[] arr,
                              int index,
                              long val)
Execute an lastore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

sastore_df

public static void sastore_df(short[] arr,
                              int index,
                              short val)
Execute an sastore instruction and manipulate the tags accordingly.

See Also:
primitive_array_store_df(java.lang.Object, int, int)

prim_branch_df

public static void prim_branch_df(int compared_to)
Prints the DF for the tag on the top of the tag stack


int2_branch_df

public static void int2_branch_df(int val1,
                                  int val2)
Captures the DF information for a frontier branch over two integers


ref_cmp_null_df

public static Object ref_cmp_null_df(Object obj)
Captures the DF information for a branch that compares the specified object to null. Returns the object so it can be used in the comparison


ref2_branch_df

public static void ref2_branch_df(Object obj1,
                                  Object obj2)
Captures the DF information for a branch that compares the two specified objects. Used for if_acmpeq and if_acmpne. This should really put the DF of the object being compared to in BranchInfo, but right now it only accepts a single string. We find the dataflow of both objects that are compared, because a BranchInfo is added to the list for both of the objects.


uninstrumented_clone_df

public static Object uninstrumented_clone_df(Object orig_obj,
                                             Object clone_obj)
Handle an uninstrumented clone call by transferring the dataflow from the original object to the clone. Really should transfer the dataflow of each primitive field instead. Returns the cloned object.


uninstrumented_toString_df

public static String uninstrumented_toString_df(Object orig_obj,
                                                String result)
Handle an uninstrumented toString call. Transfers the dataflow from the orig object to the string.


Integer_intValue

public static int Integer_intValue(Integer obj)
DF of result is equal to DF of argument


Integer_valueOf

public static Integer Integer_valueOf(int val)
DF of result is equal to DF of argument


Float_valueOf

public static Float Float_valueOf(float val)
DF of result is equal to DF of argument


Double_valueOf

public static Double Double_valueOf(double val)
DF of result is equal to DF of argument


Boolean_valueOf

public static Boolean Boolean_valueOf(boolean val)
DF of result is equal to DF of argument


Integer_decode

public static Integer Integer_decode(String str)
DF of result is equal to DF of argument


Long_valueOf

public static Long Long_valueOf(long val)
DF of result is equal to DF of argument


Short_valueOf

public static Short Short_valueOf(short val)
DF of result is equal to DF of argument


String_valueOf

public static String String_valueOf(Object obj)
DF of result is equal to DF of argument


StringBuffer_append

public static StringBuffer StringBuffer_append(StringBuffer buff,
                                               CharSequence s)
DF of result is equal to the union of the DF of the two arguments


StringBuffer_append

public static StringBuffer StringBuffer_append(StringBuffer buff,
                                               String s)
DF of result is equal to the union of the DF of the two arguments


equals_df

public static boolean equals_df(Object o1,
                                Object o2)
Calculates dataflow for o1.equals(o2). If o1 is instrumented the instrumentedversion calculates the dataflow. If o2 is not instrumented, we set the dataflow of the result to the union of the DF of each object. This may not be optimum if o1 implements equals.


super_equals_df

public static void super_equals_df(Object o1,
                                   Object o2)
Handles a call to an uninstrumented super equals. Makes the result DF depend on the DF of the two input objects. Does not execute the super call itself, that must be done in the caller.