# HG changeset patch # User Shinji KONO # Date 1544339094 -32400 # Node ID 585f22dcc6aa1b4a2059aee09c3d2cdf6e21af02 # Parent e3cd4e21b5601d290e5279829469364b6a5d6738 fix diff -r e3cd4e21b560 -r 585f22dcc6aa src/core/cbc-interp.cbc --- 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); diff -r e3cd4e21b560 -r 585f22dcc6aa src/core/interp.c --- 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;