From 695506ce75cffeba3ff64756cd6547bafe5848c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 5 Sep 2021 22:12:15 +0200 Subject: [PATCH] :art: Improve mutual recursion --- src/emit/emit.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 95bf9944..18d55e6b 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1503,20 +1503,16 @@ ANN m_bool emit_exp_call1(const Emitter emit, const Func f, } } else if (emit->env->func != f && !f->value_ref->from->owner_class && !f->code && !is_fptr(emit->gwion, f->value_ref->type)) { - CHECK_BB(emit_ensure_func(emit, f)); if (fbflag(f->def->base, fbflag_op)) { + if(f->def->base->tmpl) + CHECK_BB(emit_ensure_func(emit, f)); const Instr back = (Instr)vector_back(&emit->code->instr); assert(back->execute == SetFunc); if(f->code) { back->opcode = eRegPushImm; back->m_val = (m_uint)f->code; - // back->m_val2 = SZ_INT; } else back->m_val = (m_uint)f; - } else { - const Instr instr = emit_add_instr(emit, RegSetImm); - instr->m_val = (m_uint)f->code; - instr->m_val2 = -SZ_INT; } } } else if ((f->value_ref->from->owner_class && @@ -1563,7 +1559,7 @@ ANN m_bool emit_exp_call1(const Emitter emit, const Func f, instr->execute = SetFunc; instr->m_val = (m_uint)f; } else { - const Instr back = (Instr)vector_back(&emit->code->instr); + const Instr back = (Instr)vector_back(&emit->code->instr); if(back->execute != SetFunc) { const Instr instr = emit_add_instr(emit, SetFunc); instr->m_val = (m_uint)f; -- 2.43.0