|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectDCRuntime
public final class DCRuntime
| 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 |
|---|
public static final List<MethodInfo> methods
public static int depth
public static Throwable exit_exception
public static List<Object> static_tags
public static Stack<Object> tag_stack
public static Object method_marker
public static final boolean debug
public static final boolean debug_tag_frame
public static final boolean debug_objects
public static final SimpleLog merge_dv
public static final SimpleLog debug_arr_index
public static final SimpleLog debug_primitive
public static final SimpleLog debug_merge_comp
public static final SimpleLog debug_timing
public static final SimpleLog debug_decl_print
public static final SimpleLog time_decl
public static final SimpleLog debug_df
public static final SimpleLog debug_df_branch
public static WeakIdentityHashMap<Object,Object[]> field_map
public static WeakIdentityHashMap<Object,ValueSource> tag_map
public static WeakIdentityHashMap<Object,ValueSource> df_arrlen_map
public static List<DCRuntime.BranchInfo> branch_tags
public static Class<?> dcompmarker
| Constructor Detail |
|---|
public DCRuntime()
| Method Detail |
|---|
public static void init()
public static boolean dcomp_equals(Object o1,
Object o2)
public static boolean dcomp_super_equals(Object o1,
Object o2)
super.equals(Object) calls.
active_equals_calls
public static Object dcomp_clone(Object o)
throws Throwable
clone() calls.
This method throws Throwable because it may throw any checked
exception that is thrown by o.clone().
Throwable
public static Object dcomp_super_clone(Object o)
throws Throwable
super.clone() calls.
Throwableactive_clone_calls
public static boolean has_instrumented(Class<?> c,
String method_name)
public static Object uninstrumented_clone(Object orig_obj,
Object clone_obj)
public static String uninstrumented_toString(Object orig_obj,
String result)
public static boolean object_eq(Object obj1,
Object obj2)
public static boolean object_ne(Object obj1,
Object obj2)
public static Object[] create_tag_frame(String params)
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.
public static void normal_exit()
public static void normal_exit_primitive()
public static void normal_exit_refs_only()
public static void exception_exit()
public static void exception_exit_refs_only()
public static void throw_op()
public static void push_local_tag(Object[] tag_frame,
int index)
public static void pop_local_tag(Object[] tag_frame,
int index)
public static void push_tag(Object tag)
public static Object pop_tag()
public static void push_static_tag(int static_num)
public static void push_array_tag(Object arr_ref)
public static void pop_static_tag(int static_num)
public static void discard_tag(int cnt)
public static void aastore(Object[] arr,
int index,
Object val)
public static void bastore(byte[] arr,
int index,
byte val)
public static void castore(char[] arr,
int index,
char val)
public static void dastore(double[] arr,
int index,
double val)
public static void fastore(float[] arr,
int index,
float val)
public static void iastore(int[] arr,
int index,
int val)
public static void lastore(long[] arr,
int index,
long val)
public static void sastore(short[] arr,
int index,
short val)
public static void multianewarray2(int count1,
int count2,
Object[] arr)
public static void enter(Object[] tag_frame,
Object obj,
int mi_index,
Object[] args)
tag_frame - tag_frame containing the tags for the primitive
arguments of this method.obj - value of 'this'. Null if the method is staticmi_index - index into the list of all methods (methods)args - Array of the arguments to the method.
public static void enter_refs_only(Object obj,
int mi_index,
Object[] args)
obj - value of 'this'. Null if the method is staticmi_index - index into the list of all methods (methods)args - Array of the arguments to the method.
public static void exit(Object[] tag_frame,
Object obj,
int mi_index,
Object[] args,
Object ret_val,
int exit_line_number)
tag_frame - tag_frame containing the tags for the primitive
arguments of this method.obj - value of 'this'. Null if the method is staticmi_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
public static void exit_refs_only(Object obj,
int mi_index,
Object[] args,
Object ret_val,
int exit_line_number)
obj - value of 'this'. Null if the method is staticmi_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
public static void process_all_vars(MethodInfo mi,
RootInfo root,
Object[] tag_frame,
Object obj,
Object[] args,
Object ret_val)
public static void process_all_vars_refs_only(MethodInfo mi,
RootInfo root,
Object obj,
Object[] args,
Object ret_val)
public static Object get_object_field(Field f,
Object obj)
public static void print_all_comparable(PrintWriter ps)
public static void print_all_comparable_refs_only(PrintWriter ps)
public static void trace_all_comparable(PrintWriter ps)
public static void print_decl_file(PrintWriter ps)
public static void decl_stats()
public static void print_class_decl(PrintWriter ps,
ClassInfo ci)
public static List<DCRuntime.DVSet> print_decl(PrintWriter ps,
MethodInfo mi)
public static void print_comparable(PrintWriter ps,
MethodInfo mi)
public static void print_comparable_refs_only(PrintWriter ps,
MethodInfo mi)
public static void print_comparable_traced(PrintWriter ps,
MethodInfo mi)
public static void push_field_tag(Object obj,
int field_num)
public static void push_field_tag_null_ok(Object obj,
int field_num)
public static void pop_field_tag(Object obj,
int field_num)
public static int num_prim_fields(Class<?> clazz)
public static void binary_tag_op()
public static void cmp_op()
public static void dup()
public static void dup_x1()
public static void dup_x2()
public static void dup2()
public static void dup2_x1()
public static void dup2_x2()
public static void swap()
public static void primitive_array_load(Object arr_ref,
int index)
public static void primitive_array_load_null_ok(Object arr_ref,
int index)
public static void ref_array_load(Object arr_ref,
int index)
public static void push_const()
public static void class_init(String classname)
public static boolean is_class_init(Class<?> clazz)
public static String tag_field_name(String field_name)
public static String clean_decl_name(String decl_name)
public static void dup_obj_tag_val(Object obj)
public static void arraylen_df(Object arr)
public static void push_const_src(String descr)
public static void push_const_obj_src(Object obj,
String descr)
public static void binary_tag_df()
public static void pop_local_tag_df(Object[] tag_frame,
int index)
public static void pop_local_obj_df(Object obj,
int index)
public static void setup_obj_df(Object obj,
String descr)
public static void setup_array_df(Object arr_ref,
String descr)
public static void setup_multiarray_df(Object arr,
int dims,
String descr)
public static void primitive_array_load_df(Object arr_ref,
int index)
public static void ref_array_load_df(Object arr_ref,
int index)
public static void aastore_df(Object[] arr,
int index,
Object val)
public static void bastore_df(byte[] arr,
int index,
byte val)
primitive_array_store_df(java.lang.Object, int, int)
public static void castore_df(char[] arr,
int index,
char val)
primitive_array_store_df(java.lang.Object, int, int)
public static void dastore_df(double[] arr,
int index,
double val)
primitive_array_store_df(java.lang.Object, int, int)
public static void fastore_df(float[] arr,
int index,
float val)
primitive_array_store_df(java.lang.Object, int, int)
public static void iastore_df(int[] arr,
int index,
int val)
primitive_array_store_df(java.lang.Object, int, int)
public static void lastore_df(long[] arr,
int index,
long val)
primitive_array_store_df(java.lang.Object, int, int)
public static void sastore_df(short[] arr,
int index,
short val)
primitive_array_store_df(java.lang.Object, int, int)public static void prim_branch_df(int compared_to)
public static void int2_branch_df(int val1,
int val2)
public static Object ref_cmp_null_df(Object obj)
public static void ref2_branch_df(Object obj1,
Object obj2)
public static Object uninstrumented_clone_df(Object orig_obj,
Object clone_obj)
public static String uninstrumented_toString_df(Object orig_obj,
String result)
public static int Integer_intValue(Integer obj)
public static Integer Integer_valueOf(int val)
public static Float Float_valueOf(float val)
public static Double Double_valueOf(double val)
public static Boolean Boolean_valueOf(boolean val)
public static Integer Integer_decode(String str)
public static Long Long_valueOf(long val)
public static Short Short_valueOf(short val)
public static String String_valueOf(Object obj)
public static StringBuffer StringBuffer_append(StringBuffer buff,
CharSequence s)
public static StringBuffer StringBuffer_append(StringBuffer buff,
String s)
public static boolean equals_df(Object o1,
Object o2)
public static void super_equals_df(Object o1,
Object o2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||