]> Nishi Git Mirror - gwion.git/commitdiff
:art: Optimize call for final classes
authorJérémie Astor <fennecdjay@gmail.com>
Thu, 18 Feb 2021 15:00:16 +0000 (16:00 +0100)
committerJérémie Astor <fennecdjay@gmail.com>
Thu, 18 Feb 2021 15:00:16 +0000 (16:00 +0100)
src/lib/object_op.c

index 089f00df0068a1d631298d051e9bc14a0d87afd8..8b90f6d5d649a972014f9aac3e6e8a2846e6d7c9 100644 (file)
@@ -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;