summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-10-12 17:20:02 +0100
committerTom Hacohen <tom@stosb.com>2015-10-19 10:22:41 +0100
commitb1e424d34eea2c2c06917841ae9d22686642c41c (patch)
tree7fbfa6e021974a5b8da08450aa36c77e5584a8b1 /src
parent631330482fdb30527bcecbc0fa6f41fa785e261c (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/eo.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index fbae720..0d9f269 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -245,7 +245,6 @@ _eo_kls_itr_next(const _Eo_Class *orig_kls, const _Eo_Class *cur_klass, Eo_Op op
245EAPI Eo_Hook_Call eo_hook_call_pre = NULL; 245EAPI Eo_Hook_Call eo_hook_call_pre = NULL;
246EAPI Eo_Hook_Call eo_hook_call_post = NULL; 246EAPI Eo_Hook_Call eo_hook_call_post = NULL;
247 247
248#define EO_INVALID_DATA (void *) -1
249// 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023 248// 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023
250// imbricated/recursive calls it can handle before barfing. i'd say that's ok 249// imbricated/recursive calls it can handle before barfing. i'd say that's ok
251#define EO_CALL_STACK_DEPTH_MIN 1024 250#define EO_CALL_STACK_DEPTH_MIN 1024
@@ -259,7 +258,6 @@ typedef struct _Eo_Stack_Frame
259 const _Eo_Class *kls; 258 const _Eo_Class *kls;
260 } o; 259 } o;
261 const _Eo_Class *cur_klass; 260 const _Eo_Class *cur_klass;
262 void *obj_data;
263} Eo_Stack_Frame; 261} Eo_Stack_Frame;
264 262
265#define EO_CALL_STACK_SIZE (EO_CALL_STACK_DEPTH_MIN * sizeof(Eo_Stack_Frame)) 263#define EO_CALL_STACK_SIZE (EO_CALL_STACK_DEPTH_MIN * sizeof(Eo_Stack_Frame))
@@ -447,7 +445,6 @@ _eo_do_internal(const Eo *eo_id, const Eo_Class *cur_klass_id,
447 else 445 else
448 { 446 {
449 fptr->eo_id = eo_id; 447 fptr->eo_id = eo_id;
450 fptr->obj_data = EO_INVALID_DATA;
451 if (is_klass) 448 if (is_klass)
452 { 449 {
453 EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, EINA_FALSE); 450 EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, EINA_FALSE);
@@ -464,8 +461,6 @@ _eo_do_internal(const Eo *eo_id, const Eo_Class *cur_klass_id,
464 if (is_super) 461 if (is_super)
465 { 462 {
466 EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE); 463 EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE);
467 if (fptr->cur_klass == cur_klass)
468 fptr->obj_data = EO_INVALID_DATA;
469 fptr->cur_klass = cur_klass; 464 fptr->cur_klass = cur_klass;
470 } 465 }
471 else 466 else
@@ -515,8 +510,6 @@ _eo_do_end(void *eo_stack)
515 if (!_eo_is_a_class(fptr->eo_id) && fptr->o.obj) 510 if (!_eo_is_a_class(fptr->eo_id) && fptr->o.obj)
516 _eo_unref(fptr->o.obj); 511 _eo_unref(fptr->o.obj);
517 512
518 fptr->obj_data = EO_INVALID_DATA;
519
520 stack->frame_ptr--; 513 stack->frame_ptr--;
521 514
522 if (fptr == stack->shrink_frame) 515 if (fptr == stack->shrink_frame)
@@ -575,15 +568,7 @@ _eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, c
575 if (is_obj) 568 if (is_obj)
576 { 569 {
577 call->obj = (Eo *)fptr->eo_id; 570 call->obj = (Eo *)fptr->eo_id;
578 if (func->src == fptr->o.obj->klass) 571 call->data = _eo_data_scope_get(fptr->o.obj, func->src);
579 {
580 if (fptr->obj_data == EO_INVALID_DATA)
581 fptr->obj_data = _eo_data_scope_get(fptr->o.obj, func->src);
582
583 call->data = fptr->obj_data;
584 }
585 else
586 call->data = _eo_data_scope_get(fptr->o.obj, func->src);
587 } 572 }
588 else 573 else
589 { 574 {