further comments
[cacao.git] / jit / parseRTprint.h
1 /*
2  * Defines of debug / trace /info  prints 
3  *     to make the actual code more readable
4  *
5  * COtest prints are just debug
6  * RTAprint prints are trace /info prints
7  */
8
9
10 #include "parseRTstats.h"
11
12
13 #define XTAPRINTcallgraph1  if(pWhenMarked>=1) \
14         {printf("\n XTA Added to Call Graph #%i:",  \
15         methXTAlast); \
16         printf("\t <used flags c/m> <%i/%i> %i\t",  \
17           submeth->class->classUsed, \
18           submeth->methodUsed, \
19           USED);  \
20         printf(" method name =");   \
21         utf_display(submeth->class->name);printf("."); \
22         method_display(submeth);fflush(stdout);}
23
24 #define XTAPRINTcallgraph2  if(pWhenMarked>=1) { \
25         printf("\n XTA Added to Call Graph #%i:", \
26                 methXTAlast); \
27         printf(" method name ="); fflush(stdout);\
28         utf_display(mi->class->name);printf(".");fflush(stdout); \
29         method_display(mi);fflush(stdout); \
30         }
31
32 #define RTAPRINTcallgraph1  if(pWhenMarked>=1) \
33         {printf("\n Added to Call Graph #%i:",  \
34         methRTlast); \
35         printf("\t <used flags c/m> <%i/%i> %i\t",  \
36           meth->class->classUsed, \
37           meth->methodUsed, \
38           USED);  \
39         printf(" method name =");   \
40         utf_display(meth->class->name);printf("."); \
41         method_display(meth);fflush(stdout);} 
42
43
44 #define RTAPRINTmarkMethod1 if (pWhenMarked >= 2) { \
45         printf("<%i> Just Marking Method - class: <index=%i>\n",   \
46         submeth->methodUsed,  \
47         submeth->class->index); \
48         utf_display(submeth->class->name); \
49         method_display(submeth);        \
50         }
51
52 #define RTAPRINTmarkMethod1aa if (pWhenMarked >= 2) { \
53         printf("Top Method/Class Abstract --  init found\n"); \
54         method_display(submeth);        \
55         }
56
57 #define RTAPRINTmarkMethod1A if (pWhenMarked >= 2) { \
58         printf("Top Method/Class Abstract -- Marking Method & init - & marking class used <%i>\n",class->index); \
59         method_display(submeth);        \
60         }
61
62 #define RTAPRINTmarkMethod2 if (pWhenMarked >= 2) { \
63         printf("Class marked Used by Subtype :");utf_display(submeth->name);printf("\n");}
64
65 #define RTAPRINTmarkSubs1 if (pWhenMarked>=3) { \
66   utf *name = topmethod -> name; \
67         printf("markMethod: "); utf_display(class->name); \
68         printf(".");utf_display(name); printf("\n");}
69
70 #define RTAPRINTmarkSubs2 if (pWhenMarked>=3) { \
71         printf("markSubs: "); utf_display(subs->name);printf("."); \
72         utf_display(name); printf("\n");}
73
74 #define RTAPRINT01method if ((pOpcodes == 1) || (pOpcodes == 3)) \
75         {printf("*********************************\n"); fflush(stdout); \
76         printf("PARSE RT method name = <%i/%i>",rt_method->class->classUsed,rt_method->methodUsed); fflush(stdout);\
77         utf_display(rt_method->class->name);printf(".");fflush(stdout); \
78         utf_display(rt_method->name);printf("\n\n"); fflush(stdout);\
79         method_display(rt_method); printf(">\n\n");fflush(stdout);}
80
81 #define RTAPRINT02opcode if ((pOpcodes == 1) || (pOpcodes == 3)) \
82         {printf("Parse RT p=%i<%i<   opcode=<%i> %s\n", \
83                 p,rt_jcodelength,opcode,opcode_names[opcode]); \
84         fflush(stdout); }
85
86 #define RTAPRINT03putstatic1  if (pWhenMarked >= 1) { \
87         class_showconstanti(rt_class,i); \
88         }
89
90 #define RTAPRINT03putstatic1o_OLD  if (pWhenMarked >= 1) { \
91         class_showconstanti(rt_class,i); \
92         printf("FMIref = ");  \
93         utf_display ( fr->class->name );  \
94         printf (".");  \
95         utf_display ( fr->name);  \
96         printf (" type=");  \
97         utf_display ( fr->descriptor );  \
98         printf("\n Field =");  \
99         field_display (fi);  \
100         printf(" in class.field =");utf_display(ci->name); printf(".");  \
101         utf_display(fr->name);printf("\tPUT/GET STATIC\n"); fflush(stdout);  \
102         printf("For %s:",ci->name->text);fflush(stdout);  \
103         printf("#methods=%i\n",ci->methodscount); fflush(stdout); \
104         }
105
106 #define RTAPRINT04invokestatic1  if (((pOpcodes == 1)  ||(pOpcodes == 3))  || (pWhenMarked >= 2)) { \
107         printf(" method name ="); \
108         utf_display(mi->class->name); printf("."); \
109         utf_display(mi->name);printf("\t<%i>INVOKE STATIC\n",mi->methodUsed); \
110         fflush(stdout);}
111
112 #define RTAPRINT05invokestatic2  if (pWhenMarked >= 2) { \
113         printf("Class marked Used :"); \
114         utf_display(rt_class->name); \
115         printf("INVOKESTATIC\n"); fflush(stdout);}
116
117
118 #define RTAPRINT06Ainvoke_spec_super1 if (pWhenMarked >= 1) { \
119         printf("class flags:"); fflush(stdout); \
120         utf_display(ci->name); \
121         printflags(ci->flags); \
122         printf("\n"); fflush(stdout); \
123         printf("method flags:"); fflush(stdout); \
124         utf_display(mi->name); \
125         printflags(mi->flags); \
126         printf("\n"); fflush(stdout); \
127         }
128
129 #define RTAPRINT06Binvoke_spec_super2 if (pWhenMarked >= 1) { \
130         printf("SUPERRRRRRRRRRRRRRR");  \
131         utf_display(mi->descriptor);  \
132         printf("  class super ="); fflush(stdout); \
133         utf_display(rt_class->super->name); fflush(stdout); \
134         printf("\t ==?  ");     fflush(stdout); \
135         printf("  class =");fflush(stdout); \
136         utf_display(mi->class->name); fflush(stdout); \
137         printf("\n");   fflush(stdout); \
138         printf("Ainterface count = "); fflush(stdout); \
139         printf(" %i\n", ci -> interfacescount); \
140         fflush(stdout); \
141         }
142
143 #define RTAPRINT06Binvoke_spec_init if (pWhenMarked >= 1) { \
144         printf("Binterface count = "); fflush(stdout); \
145         printf(" %i\n", ci -> interfacescount); \
146         fflush(stdout); \
147         }
148
149 #define RTAPRINT06CXTAinvoke_spec_init1 if (pWhenMarked >= 1) { \
150         printf("\n XTA Added to Call Graph #%i:", \
151         methXTAlast); \
152         printf(" method name ="); \
153         utf_display(mi->class->name);printf("."); \
154         method_display(mi);fflush(stdout); \
155         }
156
157
158 #define RTAPRINT06invoke_spec_virt1 if ((pOpcodes == 1) ||(pOpcodes == 3)  || (pWhenMarked >= 2)) { \
159         printf("INVOKE method name <%i/%i> =",mi->class->classUsed,mi->methodUsed); \
160         utf_display(mi->class->name); printf("."); \
161         method_display(mi); \
162         fflush(stdout); }
163
164 #define RTAPRINT07invoke_spec_virt2 if ((pOpcodes == 1) ||(pOpcodes == 3)  || (pWhenMarked >= 1)) { \
165         utf_display(mi->class->name);printf("."); \
166         method_display(mi); }
167
168 #define RTAPRINT08AinvokeInterface0 if (pWhenMarked >= 2) { \
169         utf_display(mi->class->name); \
170         method_display(mi); printf("\n");} \
171         if (pWhenMarked >= 1) { \
172                 printf("INTERFACE CLASS <");fflush(stdout); \
173                 utf_display(mi->class->name); fflush(stdout); \
174                 printf("> used flag=%i\n", mi->class->classUsed); \
175                 fflush(stdout); \
176                 method_display(mi); \
177                 fflush(stdout); \
178         }
179
180 #define RTAPRINT08invokeInterface1  if (pWhenMarked >= 1) { \
181         printf("Implemented By classes :\n");  \
182                 fflush(stdout); \
183         if (subs == NULL) printf(" \tNOT IMPLEMENTED !!!\n"); \
184                 fflush(stdout); \
185         }
186
187 #define RTAPRINT09invokeInterface2  if (pWhenMarked >= 3) { \
188         printf("\t");utf_display(isubs->name);  printf(" <%i>\n",isubs->classUsed); \
189         }
190
191 #define RTAPRINT10new  if (pWhenMarked >= 2) { \
192         printf("NEW Class marked Used :"); fflush(stdout);\
193         utf_display(ci->name); \
194         fflush(stdout);}
195
196 #define RTAPRINT10newXTA  if (pWhenMarked >= 1) { \
197         utf_display(ci->name);printf(" XTA_NEW\n"); \
198         printSet(rt_method->xta->XTAclassSet->head); \
199         }
200
201 #define RTAPRINT11addedtoCallgraph  if (pWhenMarked >= 1){ \
202         printf("\n<Added to Call Graph #%i:",methRTlast); \
203         method_display(m); \
204         printf(" method name =");utf_display(m->class->name); printf("."); \
205         utf_display(m->name);printf("\n"); \
206         }
207
208 #define RTAPRINT11addedtoCallgraph2  if (pWhenMarked >= 1){ \
209         utf_display(ci->name); printf("."); \
210         method_display(m); printf("\t\t"); \
211         printf("<init> W/O new -- Add marked methods...\n<"); \
212         }
213
214 #define RTAPRINT12aNative if (pWhenMarked >= 1) { \
215         printf("Native = ");                       fflush(stdout); \
216         utf_display(rt_class->name);  printf("."); fflush(stdout); \
217         utf_display(rt_method->name); printf(" "); fflush(stdout); \
218         utf_display(rt_descriptor);                fflush(stdout); printf("\n"); \
219         }
220
221 #define RTAPRINT12bAbstractNative if (pOpcodes == 1) { \
222                   printf("\nPROCESS_abstract or native\n"); \
223                   utf_display(rt_method->class->name); printf("."); \
224                   method_display(rt_method); printf("\n"); fflush(stdout); \
225                   }
226
227 #define RTAPRINT12Callgraph  if (pCallgraph >= 3) { \
228         printf("RTA Callgraph after RTA Call\n"); \
229         printCallgraph (); \
230         }
231
232 #define RTAPRINT13Heirarchy  if (pClassHeir >= 3) { \
233         printf("RTA Classheirarchy after RTA Call\n"); \
234                 printRThierarchyInfo(m); \
235         } 
236
237 #define RTAPRINT14CallgraphLast  if (pCallgraph >= 2) { \
238         printf("RTA Callgraph after last method in callgraph - so far >888888888888888888\n"); \
239         printCallgraph (); \
240         }
241
242 #define RTAPRINT15HeirarchyiLast if (pClassHeir >= 2) { \
243         printf("RTA Classheirarchy after last method in callgraph - so far >888888888888888888\n"); \
244                 printRThierarchyInfo(m); \
245         } 
246
247 #define RTAPRINT16stats1 if (pStats == 2) { \
248         printf("OBJECT SUBS ARE_THERE 1\n"); \
249                 printObjectClassHeirarchy(class_java_lang_Object); \
250         }