w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

codedump.c
Go to the documentation of this file.
1 #include <mruby.h>
2 #include <mruby/irep.h>
3 #include <mruby/debug.h>
4 #include <mruby/opcode.h>
5 #include <mruby/string.h>
6 #include <mruby/proc.h>
7 #include <mruby/dump.h>
8 
9 #ifndef MRB_NO_STDIO
10 static void
11 print_r(mrb_state *mrb, const mrb_irep *irep, size_t n)
12 {
13  if (n == 0) return;
14  if (n >= irep->nlocals) return;
15  if (!irep->lv[n-1]) return;
16  printf(" R%d:%s", (int)n, mrb_sym_dump(mrb, irep->lv[n-1]));
17 }
18 
19 static void
20 print_lv_a(mrb_state *mrb, const mrb_irep *irep, uint16_t a)
21 {
22  if (!irep->lv || a >= irep->nlocals || a == 0) {
23  printf("\n");
24  return;
25  }
26  printf("\t;");
27  print_r(mrb, irep, a);
28  printf("\n");
29 }
30 
31 static void
33 {
34  if (!irep->lv || (a >= irep->nlocals && b >= irep->nlocals) || a+b == 0) {
35  printf("\n");
36  return;
37  }
38  printf("\t;");
39  if (a > 0) print_r(mrb, irep, a);
40  if (b > 0) print_r(mrb, irep, b);
41  printf("\n");
42 }
43 
44 static void
46 {
47  int32_t line;
48 
49  line = mrb_debug_get_line(mrb, irep, i);
50  if (line < 0) {
51  printf(" ");
52  }
53  else {
54  printf("%5d ", line);
55  }
56 
57  printf("%03d ", (int)i);
58 }
59 
60 #define CASE(insn,ops) case insn: FETCH_ ## ops ();
61 
62 static void
63 codedump(mrb_state *mrb, const mrb_irep *irep)
64 {
65  int ai;
66  const mrb_code *pc, *pcend;
67  mrb_code ins;
68  const char *file = NULL, *next_file;
69 
70  if (!irep) return;
71  printf("irep %p nregs=%d nlocals=%d pools=%d syms=%d reps=%d iseq=%d\n", (void*)irep,
72  irep->nregs, irep->nlocals, (int)irep->plen, (int)irep->slen, (int)irep->rlen, (int)irep->ilen);
73 
74  if (irep->lv) {
75  int i;
76 
77  printf("local variable names:\n");
78  for (i = 1; i < irep->nlocals; ++i) {
79  char const *s = mrb_sym_dump(mrb, irep->lv[i - 1]);
80  printf(" R%d:%s\n", i, s ? s : "");
81  }
82  }
83 
84  if (irep->clen > 0) {
85  int i = irep->clen;
87 
88  for (; i > 0; i --, e ++) {
92  char buf[20];
93  const char *type;
94 
95  switch (e->type) {
96  case MRB_CATCH_RESCUE:
97  type = "rescue";
98  break;
99  case MRB_CATCH_ENSURE:
100  type = "ensure";
101  break;
102  default:
103  buf[0] = '\0';
104  snprintf(buf, sizeof(buf), "0x%02x <unknown>", (int)e->type);
105  type = buf;
106  break;
107  }
108  printf("catch type: %-8s begin: %04" PRIu32 " end: %04" PRIu32 " target: %04" PRIu32 "\n", type, begin, end, target);
109  }
110  }
111 
112  pc = irep->iseq;
113  pcend = pc + irep->ilen;
114  while (pc < pcend) {
115  ptrdiff_t i;
116  uint32_t a;
117  uint16_t b;
118  uint16_t c;
119 
120  ai = mrb_gc_arena_save(mrb);
121 
122  i = pc - irep->iseq;
123  next_file = mrb_debug_get_filename(mrb, irep, (uint32_t)i);
124  if (next_file && file != next_file) {
125  printf("file: %s\n", next_file);
126  file = next_file;
127  }
128  print_header(mrb, irep, (uint32_t)i);
129  ins = READ_B();
130  switch (ins) {
131  CASE(OP_NOP, Z);
132  printf("OP_NOP\n");
133  break;
134  CASE(OP_MOVE, BB);
135  printf("OP_MOVE\tR%d\tR%d\t", a, b);
136  print_lv_ab(mrb, irep, a, b);
137  break;
138  CASE(OP_LOADL16, BS);
139  goto op_loadl;
140  CASE(OP_LOADL, BB);
141  op_loadl:
142  switch (irep->pool[b].tt) {
143  case IREP_TT_FLOAT:
144 #ifndef MRB_NO_FLOAT
145  printf("OP_LOADL\tR%d\tL(%d)\t; %f", a, b, (double)irep->pool[b].u.f);
146 #endif
147  break;
148  case IREP_TT_INT32:
149  printf("OP_LOADL\tR%d\tL(%d)\t; %" PRId32, a, b, irep->pool[b].u.i32);
150  break;
151 #ifdef MRB_64BIT
152  case IREP_TT_INT64:
153  printf("OP_LOADL\tR%d\tL(%d)\t; %" PRId64, a, b, irep->pool[b].u.i64);
154  break;
155 #endif
156  default:
157  printf("OP_LOADL\tR%d\tL(%d)\t", a, b);
158  break;
159  }
160  print_lv_a(mrb, irep, a);
161  break;
162  CASE(OP_LOADI, BB);
163  printf("OP_LOADI\tR%d\t%d\t", a, b);
164  print_lv_a(mrb, irep, a);
165  break;
166  CASE(OP_LOADINEG, BB);
167  printf("OP_LOADI\tR%d\t-%d\t", a, b);
168  print_lv_a(mrb, irep, a);
169  break;
170  CASE(OP_LOADI16, BS);
171  printf("OP_LOADI16\tR%d\t%d\t", a, (int)(int16_t)b);
172  print_lv_a(mrb, irep, a);
173  break;
174  CASE(OP_LOADI32, BSS);
175  printf("OP_LOADI32\tR%d\t%d\t", a, (int32_t)(((uint32_t)b<<16)+c));
176  print_lv_a(mrb, irep, a);
177  break;
178  CASE(OP_LOADI__1, B);
179  printf("OP_LOADI__1\tR%d\t\t", a);
180  print_lv_a(mrb, irep, a);
181  break;
182  CASE(OP_LOADI_0, B); goto L_LOADI;
183  CASE(OP_LOADI_1, B); goto L_LOADI;
184  CASE(OP_LOADI_2, B); goto L_LOADI;
185  CASE(OP_LOADI_3, B); goto L_LOADI;
186  CASE(OP_LOADI_4, B); goto L_LOADI;
187  CASE(OP_LOADI_5, B); goto L_LOADI;
188  CASE(OP_LOADI_6, B); goto L_LOADI;
189  CASE(OP_LOADI_7, B);
190  L_LOADI:
191  printf("OP_LOADI_%d\tR%d\t\t", ins-(int)OP_LOADI_0, a);
192  print_lv_a(mrb, irep, a);
193  break;
194  CASE(OP_LOADSYM16, BS);
195  goto op_loadsym;
196  CASE(OP_LOADSYM, BB);
197  op_loadsym:
198  printf("OP_LOADSYM\tR%d\t:%s\t", a, mrb_sym_dump(mrb, irep->syms[b]));
199  print_lv_a(mrb, irep, a);
200  break;
201  CASE(OP_LOADNIL, B);
202  printf("OP_LOADNIL\tR%d\t\t", a);
203  print_lv_a(mrb, irep, a);
204  break;
205  CASE(OP_LOADSELF, B);
206  printf("OP_LOADSELF\tR%d\t\t", a);
207  print_lv_a(mrb, irep, a);
208  break;
209  CASE(OP_LOADT, B);
210  printf("OP_LOADT\tR%d\t\t", a);
211  print_lv_a(mrb, irep, a);
212  break;
213  CASE(OP_LOADF, B);
214  printf("OP_LOADF\tR%d\t\t", a);
215  print_lv_a(mrb, irep, a);
216  break;
217  CASE(OP_GETGV, BB);
218  printf("OP_GETGV\tR%d\t:%s", a, mrb_sym_dump(mrb, irep->syms[b]));
219  print_lv_a(mrb, irep, a);
220  break;
221  CASE(OP_SETGV, BB);
222  printf("OP_SETGV\t:%s\tR%d", mrb_sym_dump(mrb, irep->syms[b]), a);
223  print_lv_a(mrb, irep, a);
224  break;
225  CASE(OP_GETSV, BB);
226  printf("OP_GETSV\tR%d\t:%s", a, mrb_sym_dump(mrb, irep->syms[b]));
227  print_lv_a(mrb, irep, a);
228  break;
229  CASE(OP_SETSV, BB);
230  printf("OP_SETSV\t:%s\tR%d", mrb_sym_dump(mrb, irep->syms[b]), a);
231  print_lv_a(mrb, irep, a);
232  break;
233  CASE(OP_GETCONST, BB);
234  printf("OP_GETCONST\tR%d\t:%s", a, mrb_sym_dump(mrb, irep->syms[b]));
235  print_lv_a(mrb, irep, a);
236  break;
237  CASE(OP_SETCONST, BB);
238  printf("OP_SETCONST\t:%s\tR%d", mrb_sym_dump(mrb, irep->syms[b]), a);
239  print_lv_a(mrb, irep, a);
240  break;
241  CASE(OP_GETMCNST, BB);
242  printf("OP_GETMCNST\tR%d\tR%d::%s", a, a, mrb_sym_dump(mrb, irep->syms[b]));
243  print_lv_a(mrb, irep, a);
244  break;
245  CASE(OP_SETMCNST, BB);
246  printf("OP_SETMCNST\tR%d::%s\tR%d", a+1, mrb_sym_dump(mrb, irep->syms[b]), a);
247  print_lv_a(mrb, irep, a);
248  break;
249  CASE(OP_GETIV, BB);
250  printf("OP_GETIV\tR%d\t%s", a, mrb_sym_dump(mrb, irep->syms[b]));
251  print_lv_a(mrb, irep, a);
252  break;
253  CASE(OP_SETIV, BB);
254  printf("OP_SETIV\t%s\tR%d", mrb_sym_dump(mrb, irep->syms[b]), a);
255  print_lv_a(mrb, irep, a);
256  break;
257  CASE(OP_GETUPVAR, BBB);
258  printf("OP_GETUPVAR\tR%d\t%d\t%d", a, b, c);
259  print_lv_a(mrb, irep, a);
260  break;
261  CASE(OP_SETUPVAR, BBB);
262  printf("OP_SETUPVAR\tR%d\t%d\t%d", a, b, c);
263  print_lv_a(mrb, irep, a);
264  break;
265  CASE(OP_GETCV, BB);
266  printf("OP_GETCV\tR%d\t%s", a, mrb_sym_dump(mrb, irep->syms[b]));
267  print_lv_a(mrb, irep, a);
268  break;
269  CASE(OP_SETCV, BB);
270  printf("OP_SETCV\t%s\tR%d", mrb_sym_dump(mrb, irep->syms[b]), a);
271  print_lv_a(mrb, irep, a);
272  break;
273  CASE(OP_JMP, S);
274  i = pc - irep->iseq;
275  printf("OP_JMP\t\t%03d\n", (int)i+(int16_t)a);
276  break;
277  CASE(OP_JMPUW, S);
278  i = pc - irep->iseq;
279  printf("OP_JMPUW\t\t%03d\n", (int)i+(int16_t)a);
280  break;
281  CASE(OP_JMPIF, BS);
282  i = pc - irep->iseq;
283  printf("OP_JMPIF\tR%d\t%03d\t", a, (int)i+(int16_t)b);
284  print_lv_a(mrb, irep, a);
285  break;
286  CASE(OP_JMPNOT, BS);
287  i = pc - irep->iseq;
288  printf("OP_JMPNOT\tR%d\t%03d\t", a, (int)i+(int16_t)b);
289  print_lv_a(mrb, irep, a);
290  break;
291  CASE(OP_JMPNIL, BS);
292  i = pc - irep->iseq;
293  printf("OP_JMPNIL\tR%d\t%03d\t", a, (int)i+(int16_t)b);
294  print_lv_a(mrb, irep, a);
295  break;
296  CASE(OP_SENDV, BB);
297  printf("OP_SENDV\tR%d\t:%s\n", a, mrb_sym_dump(mrb, irep->syms[b]));
298  break;
299  CASE(OP_SENDVB, BB);
300  printf("OP_SENDVB\tR%d\t:%s\n", a, mrb_sym_dump(mrb, irep->syms[b]));
301  break;
302  CASE(OP_SEND, BBB);
303  printf("OP_SEND\tR%d\t:%s\t%d\n", a, mrb_sym_dump(mrb, irep->syms[b]), c);
304  break;
305  CASE(OP_SENDB, BBB);
306  printf("OP_SENDB\tR%d\t:%s\t%d\n", a, mrb_sym_dump(mrb, irep->syms[b]), c);
307  break;
308  CASE(OP_CALL, Z);
309  printf("OP_CALL\n");
310  break;
311  CASE(OP_SUPER, BB);
312  printf("OP_SUPER\tR%d\t%d\n", a, b);
313  break;
314  CASE(OP_ARGARY, BS);
315  printf("OP_ARGARY\tR%d\t%d:%d:%d:%d (%d)", a,
316  (b>>11)&0x3f,
317  (b>>10)&0x1,
318  (b>>5)&0x1f,
319  (b>>4)&0x1,
320  (b>>0)&0xf);
321  print_lv_a(mrb, irep, a);
322  break;
323  CASE(OP_ENTER, W);
324  printf("OP_ENTER\t%d:%d:%d:%d:%d:%d:%d\n",
325  MRB_ASPEC_REQ(a),
326  MRB_ASPEC_OPT(a),
327  MRB_ASPEC_REST(a),
328  MRB_ASPEC_POST(a),
329  MRB_ASPEC_KEY(a),
331  MRB_ASPEC_BLOCK(a));
332  break;
333  CASE(OP_KEY_P, BB);
334  printf("OP_KEY_P\tR%d\t:%s\t", a, mrb_sym_dump(mrb, irep->syms[b]));
335  print_lv_a(mrb, irep, a);
336  break;
337  CASE(OP_KEYEND, Z);
338  printf("OP_KEYEND\n");
339  break;
340  CASE(OP_KARG, BB);
341  printf("OP_KARG\tR%d\t:%s\t", a, mrb_sym_dump(mrb, irep->syms[b]));
342  print_lv_a(mrb, irep, a);
343  break;
344  CASE(OP_RETURN, B);
345  printf("OP_RETURN\tR%d\t\t", a);
346  print_lv_a(mrb, irep, a);
347  break;
348  CASE(OP_RETURN_BLK, B);
349  printf("OP_RETURN_BLK\tR%d\t\t", a);
350  print_lv_a(mrb, irep, a);
351  break;
352  CASE(OP_BREAK, B);
353  printf("OP_BREAK\tR%d\t\t", a);
354  print_lv_a(mrb, irep, a);
355  break;
356  CASE(OP_BLKPUSH, BS);
357  printf("OP_BLKPUSH\tR%d\t%d:%d:%d:%d (%d)", a,
358  (b>>11)&0x3f,
359  (b>>10)&0x1,
360  (b>>5)&0x1f,
361  (b>>4)&0x1,
362  (b>>0)&0xf);
363  print_lv_a(mrb, irep, a);
364  break;
365  CASE(OP_LAMBDA, BB);
366  printf("OP_LAMBDA\tR%d\tI(%d:%p)\n", a, b, (void*)irep->reps[b]);
367  break;
368  CASE(OP_BLOCK, BB);
369  printf("OP_BLOCK\tR%d\tI(%d:%p)\n", a, b, (void*)irep->reps[b]);
370  break;
371  CASE(OP_METHOD, BB);
372  printf("OP_METHOD\tR%d\tI(%d:%p)\n", a, b, (void*)irep->reps[b]);
373  break;
374  CASE(OP_LAMBDA16, BS);
375  printf("OP_LAMBDA\tR%d\tI(%d:%p)\n", a, b, (void*)irep->reps[b]);
376  break;
377  CASE(OP_BLOCK16, BS);
378  printf("OP_BLOCK\tR%d\tI(%d:%p)\n", a, b, (void*)irep->reps[b]);
379  break;
380  CASE(OP_METHOD16, BS);
381  printf("OP_METHOD\tR%d\tI(%d:%p)\n", a, b, (void*)irep->reps[b]);
382  break;
383  CASE(OP_RANGE_INC, B);
384  printf("OP_RANGE_INC\tR%d\n", a);
385  break;
386  CASE(OP_RANGE_EXC, B);
387  printf("OP_RANGE_EXC\tR%d\n", a);
388  break;
389  CASE(OP_DEF, BB);
390  printf("OP_DEF\tR%d\t:%s\n", a, mrb_sym_dump(mrb, irep->syms[b]));
391  break;
392  CASE(OP_UNDEF, B);
393  printf("OP_UNDEF\t:%s\n", mrb_sym_dump(mrb, irep->syms[a]));
394  break;
395  CASE(OP_ALIAS, BB);
396  printf("OP_ALIAS\t:%s\t%s\n", mrb_sym_dump(mrb, irep->syms[a]), mrb_sym_dump(mrb, irep->syms[b]));
397  break;
398  CASE(OP_ADD, B);
399  printf("OP_ADD\tR%d\tR%d\n", a, a+1);
400  break;
401  CASE(OP_ADDI, BB);
402  printf("OP_ADDI\tR%d\t%d\n", a, b);
403  break;
404  CASE(OP_SUB, B);
405  printf("OP_SUB\tR%d\tR%d\n", a, a+1);
406  break;
407  CASE(OP_SUBI, BB);
408  printf("OP_SUBI\tR%d\t%d\n", a, b);
409  break;
410  CASE(OP_MUL, B);
411  printf("OP_MUL\tR%d\tR%d\n", a, a+1);
412  break;
413  CASE(OP_DIV, B);
414  printf("OP_DIV\tR%d\tR%d\n", a, a+1);
415  break;
416  CASE(OP_LT, B);
417  printf("OP_LT\t\tR%d\tR%d\n", a, a+1);
418  break;
419  CASE(OP_LE, B);
420  printf("OP_LE\t\tR%d\tR%d\n", a, a+1);
421  break;
422  CASE(OP_GT, B);
423  printf("OP_GT\t\tR%d\tR%d\n", a, a+1);
424  break;
425  CASE(OP_GE, B);
426  printf("OP_GE\t\tR%d\tR%d\n", a, a+1);
427  break;
428  CASE(OP_EQ, B);
429  printf("OP_EQ\t\tR%d\tR%d\n", a, a+1);
430  break;
431  CASE(OP_ARRAY, BB);
432  printf("OP_ARRAY\tR%d\t%d\t", a, b);
433  print_lv_a(mrb, irep, a);
434  break;
435  CASE(OP_ARRAY2, BBB);
436  printf("OP_ARRAY\tR%d\tR%d\t%d\t", a, b, c);
437  print_lv_ab(mrb, irep, a, b);
438  break;
439  CASE(OP_ARYCAT, B);
440  printf("OP_ARYCAT\tR%d\t", a);
441  print_lv_a(mrb, irep, a);
442  break;
443  CASE(OP_ARYPUSH, B);
444  printf("OP_ARYPUSH\tR%d\t", a);
445  print_lv_a(mrb, irep, a);
446  break;
447  CASE(OP_ARYDUP, B);
448  printf("OP_ARYDUP\tR%d\t", a);
449  print_lv_a(mrb, irep, a);
450  break;
451  CASE(OP_AREF, BBB);
452  printf("OP_AREF\tR%d\tR%d\t%d", a, b, c);
453  print_lv_ab(mrb, irep, a, b);
454  break;
455  CASE(OP_ASET, BBB);
456  printf("OP_ASET\tR%d\tR%d\t%d", a, b, c);
457  print_lv_ab(mrb, irep, a, b);
458  break;
459  CASE(OP_APOST, BBB);
460  printf("OP_APOST\tR%d\t%d\t%d", a, b, c);
461  print_lv_a(mrb, irep, a);
462  break;
463  CASE(OP_INTERN, B);
464  printf("OP_INTERN\tR%d", a);
465  print_lv_a(mrb, irep, a);
466  break;
467  CASE(OP_STRING16, BS);
468  goto op_string;
469  CASE(OP_STRING, BB);
470  op_string:
471  if ((irep->pool[b].tt & IREP_TT_NFLAG) == 0) {
472  printf("OP_STRING\tR%d\tL(%d)\t; %s", a, b, irep->pool[b].u.str);
473  }
474  else {
475  printf("OP_STRING\tR%d\tL(%d)\t", a, b);
476  }
477  print_lv_a(mrb, irep, a);
478  break;
479  CASE(OP_STRCAT, B);
480  printf("OP_STRCAT\tR%d\t", a);
481  print_lv_a(mrb, irep, a);
482  break;
483  CASE(OP_HASH, BB);
484  printf("OP_HASH\tR%d\t%d\t", a, b);
485  print_lv_a(mrb, irep, a);
486  break;
487  CASE(OP_HASHADD, BB);
488  printf("OP_HASHADD\tR%d\t%d\t", a, b);
489  print_lv_a(mrb, irep, a);
490  break;
491  CASE(OP_HASHCAT, B);
492  printf("OP_HASHCAT\tR%d\t", a);
493  print_lv_a(mrb, irep, a);
494  break;
495 
496  CASE(OP_OCLASS, B);
497  printf("OP_OCLASS\tR%d\t\t", a);
498  print_lv_a(mrb, irep, a);
499  break;
500  CASE(OP_CLASS, BB);
501  printf("OP_CLASS\tR%d\t:%s", a, mrb_sym_dump(mrb, irep->syms[b]));
502  print_lv_a(mrb, irep, a);
503  break;
504  CASE(OP_MODULE, BB);
505  printf("OP_MODULE\tR%d\t:%s", a, mrb_sym_dump(mrb, irep->syms[b]));
506  print_lv_a(mrb, irep, a);
507  break;
508  CASE(OP_EXEC, BB);
509  printf("OP_EXEC\tR%d\tI(%d:%p)", a, b, (void*)irep->reps[b]);
510  print_lv_a(mrb, irep, a);
511  break;
512  CASE(OP_SCLASS, B);
513  printf("OP_SCLASS\tR%d\t", a);
514  print_lv_a(mrb, irep, a);
515  break;
516  CASE(OP_TCLASS, B);
517  printf("OP_TCLASS\tR%d\t\t", a);
518  print_lv_a(mrb, irep, a);
519  break;
520  CASE(OP_ERR, B);
521  if ((irep->pool[a].tt & IREP_TT_NFLAG) == 0) {
522  printf("OP_ERR\t%s\n", irep->pool[a].u.str);
523  }
524  else {
525  printf("OP_ERR\tL(%d)\n", a);
526  }
527  break;
528  CASE(OP_EXCEPT, B);
529  printf("OP_EXCEPT\tR%d\t\t", a);
530  print_lv_a(mrb, irep, a);
531  break;
532  CASE(OP_RESCUE, BB);
533  printf("OP_RESCUE\tR%d\tR%d", a, b);
534  print_lv_ab(mrb, irep, a, b);
535  break;
536  CASE(OP_RAISEIF, B);
537  printf("OP_RAISEIF\tR%d\t\t", a);
538  print_lv_a(mrb, irep, a);
539  break;
540 
541  CASE(OP_DEBUG, BBB);
542  printf("OP_DEBUG\t%d\t%d\t%d\n", a, b, c);
543  break;
544 
545  CASE(OP_STOP, Z);
546  printf("OP_STOP\n");
547  break;
548 
549  default:
550  printf("OP_unknown (0x%x)\n", ins);
551  break;
552  }
553  mrb_gc_arena_restore(mrb, ai);
554  }
555  printf("\n");
556 }
557 
558 static void
560 {
561  int i;
562 
563  codedump(mrb, irep);
564  if (irep->reps) {
565  for (i=0; i<irep->rlen; i++) {
566  codedump_recur(mrb, irep->reps[i]);
567  }
568  }
569 }
570 #endif
571 
572 void
574 {
575 #ifndef MRB_NO_STDIO
576  codedump_recur(mrb, proc->body.irep);
577 #endif
578 }
int ptrdiff_t
Definition: CPAL.d:3845
#define type(a)
Definition: aptex-macros.h:171
#define n
Definition: t4ht.c:1290
static void print_lv_ab(mrb_state *mrb, const mrb_irep *irep, uint16_t a, uint16_t b)
Definition: codedump.c:32
static void codedump(mrb_state *mrb, const mrb_irep *irep)
Definition: codedump.c:63
#define CASE(insn, ops)
Definition: codedump.c:60
void mrb_codedump_all(mrb_state *mrb, struct RProc *proc)
Definition: codedump.c:573
static void print_r(mrb_state *mrb, const mrb_irep *irep, size_t n)
Definition: codedump.c:11
static void codedump_recur(mrb_state *mrb, const mrb_irep *irep)
Definition: codedump.c:559
static void print_lv_a(mrb_state *mrb, const mrb_irep *irep, uint16_t a)
Definition: codedump.c:20
static void print_header(mrb_state *mrb, const mrb_irep *irep, uint32_t i)
Definition: codedump.c:45
#define BSS
#define BBB
#define b
Definition: jpegint.h:372
long pc
Definition: disdvi.c:114
#define W
Definition: dtl.h:141
int printf()
#define s
Definition: afcover.h:80
static FIELD_PTR begin
Definition: genind.c:37
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
#define READ_B()
Definition: opcode.h:30
#define IREP_TT_NFLAG
Definition: irep.h:26
@ MRB_CATCH_RESCUE
Definition: irep.h:44
@ MRB_CATCH_ENSURE
Definition: irep.h:45
@ IREP_TT_INT32
Definition: irep.h:21
@ IREP_TT_FLOAT
Definition: irep.h:23
@ IREP_TT_INT64
Definition: irep.h:22
static const struct mrb_irep_catch_handler * mrb_irep_catch_handler_table(const struct mrb_irep *irep)
Definition: irep.h:132
#define mrb_irep_catch_handler_unpack(v)
Definition: irep.h:143
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific i
Definition: afcover.h:80
#define PRId32
Definition: inttypes.h:71
#define PRIu32
Definition: inttypes.h:119
#define PRId64
Definition: inttypes.h:78
signed short int16_t
Definition: stdint.h:76
unsigned short uint16_t
Definition: stdint.h:79
unsigned int uint32_t
Definition: stdint.h:80
signed int int32_t
Definition: stdint.h:77
#define buf
#define BS
Definition: nkf.c:70
#define snprintf
Definition: snprintf.c:41
#define target(code, i)
Definition: lpeg.c:1165
const char * mrb_sym_dump(mrb_state *, mrb_sym)
Definition: symbol.c:622
uint8_t mrb_code
Definition: mruby.h:122
static void mrb_gc_arena_restore(mrb_state *mrb, int idx)
Definition: mruby.h:1239
static int mrb_gc_arena_save(mrb_state *mrb)
Definition: mruby.h:1233
#define BB
Definition: nup.c:18
#define B(x, y)
#define Z
Definition: ppmforge.c:75
char line[1024]
Definition: process_score.c:29
const char * mrb_debug_get_filename(mrb_state *mrb, const mrb_irep *irep, uint32_t pc)
Definition: debug.c:54
int32_t mrb_debug_get_line(mrb_state *mrb, const mrb_irep *irep, uint32_t pc)
Definition: debug.c:67
#define MRB_ASPEC_REST(a)
Definition: proc.h:57
#define MRB_ASPEC_REQ(a)
Definition: proc.h:55
#define MRB_ASPEC_KEY(a)
Definition: proc.h:59
#define MRB_ASPEC_KDICT(a)
Definition: proc.h:60
#define MRB_ASPEC_OPT(a)
Definition: proc.h:56
#define MRB_ASPEC_POST(a)
Definition: proc.h:58
#define MRB_ASPEC_BLOCK(a)
Definition: proc.h:61
@ OP_CALL
Definition: lopcodes.h:216
@ OP_EQ
Definition: lopcodes.h:209
@ OP_LOADNIL
Definition: lopcodes.h:175
@ OP_SUB
Definition: lopcodes.h:190
@ OP_DIV
Definition: lopcodes.h:194
@ OP_LT
Definition: lopcodes.h:210
@ OP_ADD
Definition: lopcodes.h:189
@ OP_MUL
Definition: lopcodes.h:191
@ OP_LE
Definition: lopcodes.h:211
@ OP_RETURN
Definition: lopcodes.h:218
@ OP_MOVE
Definition: lopcodes.h:171
@ OP_JMP
Definition: lopcodes.h:208
ShellFileEnvironment e
Definition: sh6.c:388
Definition: proc.h:41
Definition: obx.h:103
Definition: filedef.h:30
Definition: bdf.c:133
Definition: irep.h:56
uint16_t plen
Definition: irep.h:77
uint16_t nregs
Definition: irep.h:58
uint16_t nlocals
Definition: irep.h:57
uint16_t slen
Definition: irep.h:77
const mrb_code * iseq
Definition: irep.h:62
uint32_t ilen
Definition: irep.h:76
const mrb_sym * lv
Definition: irep.h:72
const mrb_sym * syms
Definition: irep.h:69
uint16_t clen
Definition: irep.h:59
uint16_t rlen
Definition: irep.h:78
const mrb_pool_value * pool
Definition: irep.h:68
const struct mrb_irep *const * reps
Definition: irep.h:70
mrb_float f
Definition: irep.h:38
union mrb_pool_value::@1660 u
const char * str
Definition: irep.h:32
int32_t i32
Definition: irep.h:33
uint32_t tt
Definition: irep.h:30
int64_t i64
Definition: irep.h:35
#define ins
Definition: stack.c:13
@ S
Definition: ubidiimp.h:53
#define end(cp)
Definition: zic.c:71