From 08c49621a5271efcd34c0007aa2e2fbc3f6f7763 Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Fri, 6 Sep 2019 18:48:15 -0700 Subject: [PATCH] [interp] Assign sp once is enough in leave. (mono/mono#16694) Move vt_sp there too. Commit migrated from https://github.com/mono/mono/commit/b18840e92cb5b1afef6c0e5df05cc026eb32efbf --- src/mono/mono/mini/interp/interp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index ff55fe56..acc05e7 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -5905,7 +5905,9 @@ main_loop: // but not have to change how exception handling macros access labels and locals. g_assert (sp >= frame->stack); - sp = frame->stack; + sp = frame->stack; /* spec says stack should be empty at endfinally so it should be at the start too */ + vt_sp = (unsigned char*)sp + frame->imethod->stack_size; + frame->ip = ip; int opcode = *ip; @@ -5955,8 +5957,6 @@ main_loop: if (old_list != finally_ips && finally_ips) { ip = (const guint16*)finally_ips->data; finally_ips = g_slist_remove (finally_ips, ip); - sp = frame->stack; /* spec says stack should be empty at endfinally so it should be at the start too */ - vt_sp = (unsigned char *) sp + frame->imethod->stack_size; // goto main_loop instead of MINT_IN_DISPATCH helps the compiler and therefore conserves stack. // This is a slow/rare path and conserving stack is preferred over its performance otherwise. goto main_loop; -- 2.7.4