forked from enlightenment/efl
eo: there is no reason to equip for calls to classes
calls to classes are not needed anymore, since class inheritance is not a thing anymore. After removing is_obj from the function the compile can optimize the code better, since assignments to fields are not conditionally anymore. Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com> Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11591
This commit is contained in:
parent
43ac889bc1
commit
790a63c15f
|
@ -544,17 +544,12 @@ _efl_object_call_resolve(Eo *eo_id, const char *func_name, Efl_Object_Op_Call_Da
|
|||
_Eo_Object *obj = NULL;
|
||||
const Eo_Vtable *vtable = NULL;
|
||||
const op_type_funcs *func;
|
||||
Eina_Bool is_obj;
|
||||
Eina_Bool super = EINA_TRUE;
|
||||
|
||||
if (EINA_UNLIKELY(!eo_id)) goto on_null;
|
||||
|
||||
call->eo_id = eo_id;
|
||||
|
||||
is_obj = _eo_is_a_obj(eo_id);
|
||||
|
||||
if (EINA_LIKELY(is_obj == EINA_TRUE))
|
||||
{
|
||||
EO_OBJ_POINTER_RETURN_VAL_PROXY(eo_id, _obj, EINA_FALSE);
|
||||
|
||||
obj = _obj;
|
||||
|
@ -571,15 +566,6 @@ _efl_object_call_resolve(Eo *eo_id, const char *func_name, Efl_Object_Op_Call_Da
|
|||
obj_super_back:
|
||||
call->obj = obj;
|
||||
_efl_ref(_obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
// YES this is a goto with a label to return. this is a
|
||||
// micro-optimization to move infrequent code out of the
|
||||
// hot path of the function
|
||||
goto ok_klass;
|
||||
}
|
||||
ok_klass_back:
|
||||
|
||||
main_klass = klass;
|
||||
|
||||
|
@ -604,8 +590,7 @@ ok_cur_klass_back:
|
|||
if (EINA_LIKELY(func->func && func->src))
|
||||
{
|
||||
call->func = func->func;
|
||||
|
||||
if (is_obj) call->data = _efl_data_scope_get(obj, func->src);
|
||||
call->data = _efl_data_scope_get(obj, func->src);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -616,7 +601,6 @@ ok_cur_klass_back:
|
|||
|
||||
end:
|
||||
/* Try composite objects */
|
||||
if (is_obj)
|
||||
{
|
||||
Eina_List *itr;
|
||||
Eo *emb_obj_id;
|
||||
|
@ -665,12 +649,10 @@ err_func_src:
|
|||
ERR("in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'.",
|
||||
file, line, func_name, op, klass->desc->name);
|
||||
err:
|
||||
if (is_obj)
|
||||
{
|
||||
_apply_auto_unref(obj, eo_id);
|
||||
_efl_unref(obj);
|
||||
_eo_obj_pointer_done((Eo_Id)eo_id);
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
|
||||
// yes - special "move out of hot path" code blobs with goto's for
|
||||
|
@ -681,18 +663,6 @@ ok_cur_klass:
|
|||
klass = func->src;
|
||||
goto ok_cur_klass_back;
|
||||
|
||||
ok_klass:
|
||||
{
|
||||
EO_CLASS_POINTER_GOTO_PROXY(eo_id, _klass, err_klass);
|
||||
klass = _klass;
|
||||
vtable = &klass->vtable;
|
||||
cur_klass = _super_klass;
|
||||
if (cur_klass) _super_klass = NULL;
|
||||
call->obj = NULL;
|
||||
call->data = NULL;
|
||||
}
|
||||
goto ok_klass_back;
|
||||
|
||||
obj_super:
|
||||
{
|
||||
cur_klass = obj->cur_klass;
|
||||
|
@ -711,10 +681,6 @@ obj_super:
|
|||
}
|
||||
goto obj_super_back;
|
||||
|
||||
err_klass:
|
||||
_EO_POINTER_ERR(eo_id, "in %s:%d: func '%s': obj_id=%p is an invalid ref.", file, line, func_name, eo_id);
|
||||
return EINA_FALSE;
|
||||
|
||||
on_null:
|
||||
if (EINA_UNLIKELY(efl_del_api_generation != _efl_object_init_generation))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue