GNU header update.
[cacao.git] / src / vm / jit / inline / 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_flags_last(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_flags_last(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_flags_last(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("<%i/%i>PARSE RT method name = <%i/%i>", \
77                 methRT,methRTlast,rt_method->class->classUsed,rt_method->methodUsed); fflush(stdout);\
78         utf_display(rt_method->class->name);printf(".");fflush(stdout); \
79         utf_display(rt_method->name);printf("\n\n"); fflush(stdout);\
80         method_display(rt_method); printf(">\n\n");fflush(stdout);}
81
82 #define RTAPRINT02opcode if ((pOpcodes == 1) || (pOpcodes == 3)) \
83         {printf("Parse RT p=%i<%i<   opcode=<%i> %s\n", \
84                 p,rt_jcodelength,opcode,opcode_names[opcode]); \
85         fflush(stdout); }
86
87 #define RTAPRINT03putstatic1  if (pWhenMarked >= 1) { \
88         class_showconstanti(rt_class,i); \
89         }
90
91 #define RTAPRINT03putstatic1o_OLD  if (pWhenMarked >= 1) { \
92         class_showconstanti(rt_class,i); \
93         printf("FMIref = ");  \
94         utf_display ( fr->class->name );  \
95         printf (".");  \
96         utf_display ( fr->name);  \
97         printf (" type=");  \
98         utf_display ( fr->descriptor );  \
99         printf("\n Field =");  \
100         field_display (fi);  \
101         printf(" in class.field =");utf_display(ci->name); printf(".");  \
102         utf_display(fr->name);printf("\tPUT/GET STATIC\n"); fflush(stdout);  \
103         printf("For %s:",ci->name->text);fflush(stdout);  \
104         printf("#methods=%i\n",ci->methodscount); fflush(stdout); \
105         }
106
107 #define RTAPRINT04invokestatic1  if (((pOpcodes == 1)  ||(pOpcodes == 3))  || (pWhenMarked >= 2)) { \
108         printf(" method name ="); \
109         utf_display(mi->class->name); printf("."); \
110         utf_display(mi->name);printf("\t<%i>INVOKE STATIC\n",mi->methodUsed); \
111         fflush(stdout);}
112
113 #define RTAPRINT05invokestatic2  if (pWhenMarked >= 2) { \
114         printf("Class marked Used :"); \
115         utf_display(rt_class->name); \
116         printf("INVOKESTATIC\n"); fflush(stdout);}
117
118
119 #define RTAPRINT06Ainvoke_spec_super1 if (pWhenMarked >= 1) { \
120         printf("class flags:"); fflush(stdout); \
121         utf_display(ci->name); \
122         printflags(ci->flags); \
123         printf("\n"); fflush(stdout); \
124         printf("method flags:"); fflush(stdout); \
125         utf_display(mi->name); \
126         printflags(mi->flags); \
127         printf("\n"); fflush(stdout); \
128         }
129
130 #define RTAPRINT06Binvoke_spec_super2 if (pWhenMarked >= 1) { \
131         printf("SUPERRRRRRRRRRRRRRR");  \
132         utf_display(mi->descriptor);  \
133         printf("  class super ="); fflush(stdout); \
134         utf_display(rt_class->super->name); fflush(stdout); \
135         printf("\t ==?  ");     fflush(stdout); \
136         printf("  class =");fflush(stdout); \
137         utf_display(mi->class->name); fflush(stdout); \
138         printf("\n");   fflush(stdout); \
139         printf("Ainterface count = "); fflush(stdout); \
140         printf(" %i\n", ci -> interfacescount); \
141         fflush(stdout); \
142         }
143
144 #define RTAPRINT06Binvoke_spec_init if (pWhenMarked >= 1) { \
145         printf("Binterface count = "); fflush(stdout); \
146         printf(" %i\n", ci -> interfacescount); \
147         fflush(stdout); \
148         }
149
150 #define RTAPRINT06CXTAinvoke_spec_init1 if (pWhenMarked >= 1) { \
151         printf("\n XTA Added to Call Graph #%i:", \
152         methXTAlast); \
153         printf(" method name ="); \
154         utf_display(mi->class->name);printf("."); \
155         method_display(mi);fflush(stdout); \
156         }
157
158
159 #define RTAPRINT06invoke_spec_virt1 if ((pOpcodes == 1) ||(pOpcodes == 3)  || (pWhenMarked >= 2)) { \
160         printf("INVOKE method name <%i/%i> =",mi->class->classUsed,mi->methodUsed); \
161         utf_display(mi->class->name); printf("."); \
162         method_display(mi); \
163         fflush(stdout); }
164
165 #define RTAPRINT07invoke_spec_virt2 if ((pOpcodes == 1) ||(pOpcodes == 3)  || (pWhenMarked >= 1)) { \
166         utf_display(mi->class->name);printf("."); \
167         method_display(mi); }
168
169 #define RTAPRINT08AinvokeInterface0 if (pWhenMarked >= 2) { \
170         utf_display(mi->class->name); \
171         method_display(mi); printf("\n");} \
172         if (pWhenMarked >= 1) { \
173                 printf("INTERFACE CLASS <");fflush(stdout); \
174                 utf_display(mi->class->name); fflush(stdout); \
175                 printf("> used flag=%i\n", mi->class->classUsed); \
176                 fflush(stdout); \
177                 method_display(mi); \
178                 fflush(stdout); \
179         }
180
181 #define RTAPRINT08invokeInterface1  if (pWhenMarked >= 1) { \
182         printf("Implemented By classes :\n");  \
183                 fflush(stdout); \
184         if (subs == NULL) printf(" \tNOT IMPLEMENTED !!!\n"); \
185                 fflush(stdout); \
186         }
187
188 #define RTAPRINT09invokeInterface2  if (pWhenMarked >= 3) { \
189         printf("\t");utf_display(isubs->name);  printf(" <%i>\n",isubs->classUsed); \
190         }
191
192 #define RTAPRINT10new  if (pWhenMarked >= 2) { \
193         printf("NEW Class marked Used :"); fflush(stdout);\
194         utf_display(ci->name); \
195         fflush(stdout);}
196
197 #define RTAPRINT10newXTA  if (pWhenMarked >= 1) { \
198         utf_display(ci->name);printf(" XTA_NEW\n"); \
199         printSet(rt_method->xta->XTAclassSet->head); \
200         }
201
202 #define RTAPRINT11addedtoCallgraph  if (pWhenMarked >= 1){ \
203         printf("\n<Added to Call Graph #%i:",methRTlast); \
204         method_display(m); \
205         printf("<%i> method name =",methRTlast);utf_display(m->class->name); printf("."); \
206         utf_display(m->name);printf("\n"); \
207         }
208
209 #define RTAPRINT11addedtoCallgraph2  if (pWhenMarked >= 1){ \
210         utf_display(ci->name); printf("."); \
211         method_display(m); printf("\t\t"); \
212         printf("<init> W/O new -- Add marked methods...\n<"); \
213         }
214
215 #define RTAPRINT12aNative if (pWhenMarked >= 1) { \
216         printf("Native = ");                       fflush(stdout); \
217         utf_display(rt_class->name);  printf("."); fflush(stdout); \
218         utf_display(rt_method->name); printf(" "); fflush(stdout); \
219         utf_display(rt_descriptor);                fflush(stdout); printf("\n"); \
220         }
221
222 #define RTAPRINT12bAbstractNative if (pOpcodes == 1) { \
223                   printf("\nPROCESS_abstract or native\n"); \
224                   utf_display(rt_method->class->name); printf("."); \
225                   method_display(rt_method); printf("\n"); fflush(stdout); \
226                   }
227
228 #define RTAPRINT12Callgraph  if (pCallgraph >= 3) { \
229         printf("RTA Callgraph after RTA Call\n"); \
230         printCallgraph (); \
231         }
232
233 #define RTAPRINT13Heirarchy  if (pClassHeir >= 3) { \
234         printf("RTA Classheirarchy after RTA Call\n"); \
235                 printRThierarchyInfo(m); \
236         } 
237
238 #define RTAPRINT14CallgraphLast  if (pCallgraph >= 2) { \
239         printf("RTA Callgraph after last method in callgraph - so far >888888888888888888\n"); \
240         printCallgraph (); \
241         }
242
243 #define RTAPRINT15HeirarchyiLast if (pClassHeir >= 2) { \
244         printf("RTA Classheirarchy after last method in callgraph - so far >888888888888888888\n"); \
245                 printRThierarchyInfo(m); \
246         } 
247
248 #define RTAPRINT16stats1 if (pStats == 2) { \
249         printf("OBJECT SUBS ARE_THERE 1\n"); \
250                 printObjectClassHeirarchy(class_java_lang_Object); \
251         }