changeset 48:585f22dcc6aa

fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 09 Dec 2018 16:04:54 +0900
parents e3cd4e21b560
children 2d03fdcd8b7f
files src/core/cbc-interp.cbc src/core/interp.c
diffstat 2 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/cbc-interp.cbc	Sat Dec 08 22:57:55 2018 +0900
+++ b/src/core/cbc-interp.cbc	Sun Dec 09 16:04:54 2018 +0900
@@ -60,15 +60,12 @@
 static int cbctrace=0;
 
 // #define ddd(x) printf("count=%d op=%d cur_op=%p reg[0]=%p reg[2]=%p \n", op_count++, *i->cur_op, i->cur_op, GET_REG(i->cur_op, 0,i).o, GET_REG(i->cur_op, 2,i).o)
-#define ddd(x) printf("count=%d op=%d\n", op_count++, *(MVMuint16 *)i->cur_op)
+#define ddd(x) (op_count++>200?printf("count=%d op=%d\n", op_count, *(MVMuint16 *)i->cur_op):0)
 // #define ddd(x) 0
 
 __code cbc_next(INTERP i){
     __code (*c)(INTERP);
-    if (cbctrace)
-        ddd(0); 
-    else op_count++;
-    if (op_count>343724) cbctrace = 1;
+    ddd(0); 
     c = CODES[NEXT_OP(i)];
     i->tc->gc_status=0;
     goto c(i);
--- a/src/core/interp.c	Sat Dec 08 22:57:55 2018 +0900
+++ b/src/core/interp.c	Sun Dec 09 16:04:54 2018 +0900
@@ -42,7 +42,7 @@
 #define GET_UI32(pc, idx)   *((MVMuint32 *)(pc + idx))
 #define GET_N32(pc, idx)    *((MVMnum32 *)(pc + idx))
 
-#define ddd(x) (op_count++>343724?printf("count=%d op=%d\n", op_count, *(MVMuint16 *)cur_op):0)
+#define ddd(x) (op_count++>200?printf("count=%d op=%d\n", op_count, *(MVMuint16 *)cur_op):0)
 
 #define NEXT_OP (ddd(0), op = *(MVMuint16 *)(cur_op), cur_op += 2, op)
 
@@ -59,6 +59,7 @@
 static int tracing_enabled = 0;
 
 int use_cbc = 0;
+int op_count = 0;
 extern void MVM_interp_run_cbc(MVMThreadContext *tc);
 typedef struct interp {
      MVMuint16 op;