Skip to content

Commit

Permalink
[interp] Move label outside of main loop (#35778)
Browse files Browse the repository at this point in the history
Wasm has control flow limitations which don't go well with gotos. Move label outside of main loop because it translates to very poor wasm code. Other gotos don't seem to negatively impact instruction dispatch code, so leave them alone, for now ..
  • Loading branch information
BrzVlad authored May 4, 2020
1 parent 8527a99 commit 626819d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3438,13 +3438,13 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs
#if defined(ENABLE_HYBRID_SUSPEND) || defined(ENABLE_COOP_SUSPEND)
mono_threads_safepoint ();
#endif
main_loop:
/*
* using while (ip < end) may result in a 15% performance drop,
* but it may be useful for debug
*/
while (1) {
MintOpcode opcode;
main_loop:
/* g_assert (sp >= frame->stack); */
/* g_assert(vt_sp - vtalloc <= frame->imethod->vt_stack_size); */
DUMP_INSTR();
Expand Down

0 comments on commit 626819d

Please sign in to comment.