@@ -71,9 +71,10 @@ memory_getptr2(struct exec_context *ctx, uint32_t memidx, uint32_t ptr,
7171 goto do_trap ;
7272 }
7373 uint32_t need = ea + size ;
74- xlog_trace ("memory access: at %04" PRIx32 " %08" PRIx32 " + %08" PRIx32
75- ", size %" PRIu32 ", meminst size %" PRIu32 ,
76- memidx , ptr , offset , size , meminst -> size_in_pages );
74+ xlog_trace_insn ("memory access: at %04" PRIx32 " %08" PRIx32
75+ " + %08" PRIx32 ", size %" PRIu32
76+ ", meminst size %" PRIu32 ,
77+ memidx , ptr , offset , size , meminst -> size_in_pages );
7778 uint32_t need_in_pages =
7879 ((uint64_t )need + WASM_PAGE_SIZE - 1 ) / WASM_PAGE_SIZE ;
7980 if (need_in_pages > meminst -> size_in_pages ) {
@@ -313,19 +314,19 @@ frame_enter(struct exec_context *ctx, struct instance *inst, uint32_t funcidx,
313314#endif
314315 cells_zero (locals + nparams , nlocals - nparams );
315316
316- xlog_trace ("frame enter: maxlabels %u maxvals %u" , ei -> maxlabels ,
317- ei -> maxvals );
317+ xlog_trace_insn ("frame enter: maxlabels %u maxvals %u" , ei -> maxlabels ,
318+ ei -> maxvals );
318319 uint32_t i ;
319320 for (i = 0 ; i < nlocals ; i ++ ) {
320321 if (i == nparams ) {
321- xlog_trace ("-- ^-params v-locals" );
322+ xlog_trace_insn ("-- ^-params v-locals" );
322323 }
323324#if defined(TOYWASM_USE_SMALL_CELLS )
324- xlog_trace ("local [%" PRIu32 "] %08" PRIx32 , i ,
325- frame_locals (ctx , frame )[i ].x );
325+ xlog_trace_insn ("local [%" PRIu32 "] %08" PRIx32 , i ,
326+ frame_locals (ctx , frame )[i ].x );
326327#else
327- xlog_trace ("local [%" PRIu32 "] %08" PRIx64 , i ,
328- frame_locals (ctx , frame )[i ].x );
328+ xlog_trace_insn ("local [%" PRIu32 "] %08" PRIx64 , i ,
329+ frame_locals (ctx , frame )[i ].x );
329330#endif
330331 }
331332
@@ -610,7 +611,7 @@ do_branch(struct exec_context *ctx, uint32_t labelidx, bool goto_else)
610611 }
611612 if (ctx -> labels .lsize - labelidx == frame -> labelidx ) {
612613 /* exit the function */
613- xlog_trace ("do_branch: exiting function" );
614+ xlog_trace_insn ("do_branch: exiting function" );
614615 frame_exit (ctx );
615616 height = frame -> height ;
616617 arity = frame -> nresults ;
@@ -640,7 +641,7 @@ do_branch(struct exec_context *ctx, uint32_t labelidx, bool goto_else)
640641 */
641642 const struct expr_exec_info * ei = ctx -> ei ;
642643 if (ei -> jumps != NULL ) {
643- xlog_trace ("jump w/ table" );
644+ xlog_trace_insn ("jump w/ table" );
644645 bool stay_in_block = false;
645646 const struct jump * jump ;
646647 jump = jump_lookup (ctx , ei , blockpc );
@@ -663,7 +664,7 @@ do_branch(struct exec_context *ctx, uint32_t labelidx, bool goto_else)
663664 goto_else , true, 0 ,
664665 0 , ctx -> p );
665666#endif
666- xlog_trace ("jump inside a block" );
667+ xlog_trace_insn ("jump inside a block" );
667668 return ;
668669 }
669670 }
@@ -686,7 +687,7 @@ do_branch(struct exec_context *ctx, uint32_t labelidx, bool goto_else)
686687 * do a jump. (w/o jump table)
687688 */
688689 if (ei -> jumps == NULL ) {
689- xlog_trace ("jump w/o table" );
690+ xlog_trace_insn ("jump w/o table" );
690691 if (op == FRAME_OP_LOOP ) {
691692 ctx -> p = blockp ;
692693 } else {
@@ -747,13 +748,13 @@ fetch_exec_next_insn(const uint8_t *p, struct cell *stack,
747748#endif
748749 assert (ctx -> event == EXEC_EVENT_NONE );
749750 assert (ctx -> frames .lsize > 0 );
750- #if defined(TOYWASM_ENABLE_TRACING )
751+ #if defined(TOYWASM_ENABLE_TRACING_INSN )
751752 uint32_t pc = ptr2pc (ctx -> instance -> module , p );
752753#endif
753754 uint32_t op = * p ++ ;
754755#if defined(TOYWASM_USE_SEPARATE_EXECUTE )
755- xlog_trace ("exec %06" PRIx32 ": %s (%02" PRIx32 ")" , pc ,
756- instructions [op ].name , op );
756+ xlog_trace_insn ("exec %06" PRIx32 ": %s (%02" PRIx32 ")" , pc ,
757+ instructions [op ].name , op );
757758 const struct exec_instruction_desc * desc = & exec_instructions [op ];
758759#if defined(TOYWASM_USE_TAILCALL )
759760 __musttail
0 commit comments