From 5b519b7a69200252ec679f7fcd1e450920cd3fe2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 18 Feb 2021 16:00:16 +0100 Subject: [PATCH] :art: Optimize call for final classes --- src/lib/object_op.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.43.0