From: Jérémie Astor Date: Thu, 18 Feb 2021 15:00:16 +0000 (+0100) Subject: :art: Optimize call for final classes X-Git-Tag: nightly~943 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=5b519b7a69200252ec679f7fcd1e450920cd3fe2;p=gwion.git :art: Optimize call for final classes --- diff --git a/src/lib/object_op.c b/src/lib/object_op.c index 089f00df..8b90f6d5 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -98,8 +98,7 @@ ANN static void emit_member_func(const Emitter emit, const Exp_Dot* member) { const Func f = exp_self(member)->type->info->func; if(f->def->base->tmpl) emit_add_instr(emit, DotTmplVal); -else - if(is_class(emit->gwion, member->base->type) || member->base->exp_type == ae_exp_cast) { + else if(GET_FLAG(member->base->type, final) || is_class(emit->gwion, member->base->type) || member->base->exp_type == ae_exp_cast) { const Instr func_i = emit_add_instr(emit, f->code ? RegPushImm : SetFunc); func_i->m_val = (m_uint)f->code ?: (m_uint)f; return;