CACAO
inline_debug.inc
Go to the documentation of this file.
1 #if 0
2 static void debug_dump_inline_context(inline_node *iln)
3 {
4  assert(iln->indent);
5 
6  printf("%sinline_context @%p: \n",
7  iln->indent, (void*)iln->ctx);
8 }
9 #endif
10 
11 
12 static void dump_inline_tree(inline_node *iln, s4 blocknr)
13 {
14  char indent[100];
15  int i;
16  inline_node *child;
17  s4 nr;
18  s4 lastnr;
19 
20  if (!iln) {
21  printf("(inline_node *)null\n");
22  return;
23  }
24 
25  for (i=0; i<iln->depth; ++i)
26  indent[i] = '\t';
27  indent[i] = 0;
28 
29  assert(iln->m);
30  if (iln->depth) {
31  if (!iln->parent) {
32  printf("parent unset");
33  }
34  else {
35  printf("%s[%d] (°%d) start L%03d %c%c (caller L%03d pc %d)"
36  " (pt=%d+%d,lofs=%d,exh %d) cum(ins %d,bb %d,etl %d) sync=%d(%d) ",
37  indent, iln->depth, iln->debugnr, blocknr,
38  (iln->blockbefore) ? 'B' : '-',
39  (iln->blockafter) ? 'A' : '-',
40  iln->callerblock->nr, iln->callerpc,
43  iln->localsoffset,
44  iln->n_handlercount,
47  iln->synchronize, iln->synclocal
48  );
49  }
50  }
51  else {
52  printf("%s[%d] ROOT cum(ins %d,bb %d,etl %d) ",
53  indent, iln->depth,
56  }
57  method_println(iln->m);
58 
59  child = iln->children;
60  lastnr = 0;
61  nr = blocknr;
62  if (child) {
63  do {
64  nr += (child->callerblock->nr - lastnr);
65  lastnr = child->callerblock->nr;
66 
67  if (child->blockbefore)
68  nr++;
69 
70  dump_inline_tree(child, nr);
71 
72  nr += child->cumul_basicblockcount - 1;
73  if (!child->blockbefore)
74  nr++;
75  if (child->blockafter)
76  nr++;
77  }
78  while ((child = child->next) != iln->children);
79  }
80 
81  if (iln->depth) {
82  printf("%s[%d] (°%d) end L%03d\n",
83  indent, iln->depth, iln->debugnr,
84  blocknr + iln->cumul_basicblockcount
85  - ((iln->blockbefore) ? 1 : 0));
86  }
87 }
88 
89 
90 /* vim:noexpandtab:sw=4:ts=4:ft=c:
91  */
bool blockbefore
Definition: inline.cpp:162
int cumul_exceptiontablelength
Definition: inline.cpp:182
int localsoffset
Definition: inline.cpp:166
methodinfo * m
Definition: inline.cpp:142
inline_node * parent
Definition: inline.cpp:149
inline_node * children
Definition: inline.cpp:143
Indent indent
Definition: OStream.cpp:54
int synclocal
Definition: inline.cpp:159
void method_println(methodinfo *m)
Definition: method.cpp:1218
int cumul_instructioncount
Definition: inline.cpp:176
MIIterator i
int32_t s4
Definition: types.hpp:45
int n_selfpassthroughcount
Definition: inline.cpp:155
bool synchronize
Definition: inline.cpp:171
bool blockafter
Definition: inline.cpp:163
inline_node * next
Definition: inline.cpp:144
int cumul_basicblockcount
Definition: inline.cpp:177
s4 nr
Definition: jit.hpp:312
int n_handlercount
Definition: inline.cpp:157
basicblock * callerblock
Definition: inline.cpp:150
int debugnr
Definition: inline.cpp:200
char * indent
Definition: inline.cpp:199
#define printf(...)
Definition: ssa2.cpp:40
int n_passthroughcount
Definition: inline.cpp:154
inline_context * ctx
Definition: inline.cpp:139