tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=adbc534703347631ef7ba4027f80246224325f60

commit adbc534703347631ef7ba4027f80246224325f60
Author: Tom Hacohen <t...@stosb.com>
Date:   Mon Oct 12 17:20:02 2015 +0100

    Eo: Remove useless optimisation that is more harm than good.
    
    It seems that the idea behind that optimisation, is to save object data
    fetching when calling functions implemented by the object's class inside
    functions implemented by the object's class. This should be rare enough
    not to worth the upkeep, memory reads and memory writes, especially
    since for all cases apart of mixins (for which this optimisation won't
    work for anyway), the upkeep is more costly than fetching the data
    again.
---
 src/lib/eo/eo.c | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 6d5ea30..2d9b760 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -242,7 +242,6 @@ _eo_kls_itr_next(const _Eo_Class *orig_kls, const _Eo_Class 
*cur_klass, Eo_Op op
 
 /************************************ EO ************************************/
 
-#define EO_INVALID_DATA (void *) -1
 // 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023
 // imbricated/recursive calls it can handle before barfing. i'd say that's ok
 #define EO_CALL_STACK_DEPTH_MIN 1024
@@ -256,7 +255,6 @@ typedef struct _Eo_Stack_Frame
         const _Eo_Class   *kls;
    } o;
    const _Eo_Class   *cur_klass;
-   void              *obj_data;
 } Eo_Stack_Frame;
 
 #define EO_CALL_STACK_SIZE (EO_CALL_STACK_DEPTH_MIN * sizeof(Eo_Stack_Frame))
@@ -444,7 +442,6 @@ _eo_do_internal(const Eo *eo_id, const Eo_Class 
*cur_klass_id,
    else
      {
         fptr->eo_id = eo_id;
-        fptr->obj_data = EO_INVALID_DATA;
         if (is_klass)
           {
              EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, EINA_FALSE);
@@ -461,8 +458,6 @@ _eo_do_internal(const Eo *eo_id, const Eo_Class 
*cur_klass_id,
    if (is_super)
      {
         EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE);
-        if (fptr->cur_klass == cur_klass)
-          fptr->obj_data = EO_INVALID_DATA;
         fptr->cur_klass = cur_klass;
      }
    else
@@ -512,8 +507,6 @@ _eo_do_end(void *eo_stack)
    if (!_eo_is_a_class(fptr->eo_id) && fptr->o.obj)
      _eo_unref(fptr->o.obj);
 
-   fptr->obj_data = EO_INVALID_DATA;
-
    stack->frame_ptr--;
 
    if (fptr == stack->shrink_frame)
@@ -574,14 +567,7 @@ _eo_call_resolve(const char *func_name, Eo_Op_Call_Data 
*call, Eo_Call_Cache *ca
                   if (is_obj)
                     {
                        call->obj = (Eo *)fptr->eo_id;
-                       if (func->src == fptr->o.obj->klass)
-                         {
-                            if (fptr->obj_data == EO_INVALID_DATA)
-                              fptr->obj_data = (char *)fptr->o.obj + 
cache->off[i].off;
-                            call->data = fptr->obj_data;
-                         }
-                       else
-                         call->data = (char *)fptr->o.obj + cache->off[i].off;
+                       call->data = (char *)fptr->o.obj + cache->off[i].off;
                     }
                   else
                     {
@@ -606,15 +592,7 @@ _eo_call_resolve(const char *func_name, Eo_Op_Call_Data 
*call, Eo_Call_Cache *ca
         if (is_obj)
           {
              call->obj = (Eo *)fptr->eo_id;
-             if (func->src == fptr->o.obj->klass)
-               {
-                  if (fptr->obj_data == EO_INVALID_DATA)
-                    fptr->obj_data = _eo_data_scope_get(fptr->o.obj, 
func->src);
-
-                  call->data = fptr->obj_data;
-               }
-             else
-               call->data = _eo_data_scope_get(fptr->o.obj, func->src);
+             call->data = _eo_data_scope_get(fptr->o.obj, func->src);
           }
         else
           {

-- 


Reply via email to