summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-10-12 17:20:02 +0100
committerTom Hacohen <tom@stosb.com>2015-11-09 11:43:04 +0000
commitadbc534703347631ef7ba4027f80246224325f60 (patch)
tree3a2a7b0724feb9cba6fe87bbcf5763e8461f2551
parent748b90d295f1d2dd9c6b02ed607e3cfa0f8b7a5d (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.
-rw-r--r--src/lib/eo/eo.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 6d5ea30f99..2d9b760ed4 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
242 242
243/************************************ EO ************************************/ 243/************************************ EO ************************************/
244 244
245#define EO_INVALID_DATA (void *) -1
246// 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023 245// 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023
247// imbricated/recursive calls it can handle before barfing. i'd say that's ok 246// imbricated/recursive calls it can handle before barfing. i'd say that's ok
248#define EO_CALL_STACK_DEPTH_MIN 1024 247#define EO_CALL_STACK_DEPTH_MIN 1024
@@ -256,7 +255,6 @@ typedef struct _Eo_Stack_Frame
256 const _Eo_Class *kls; 255 const _Eo_Class *kls;
257 } o; 256 } o;
258 const _Eo_Class *cur_klass; 257 const _Eo_Class *cur_klass;
259 void *obj_data;
260} Eo_Stack_Frame; 258} Eo_Stack_Frame;
261 259
262#define EO_CALL_STACK_SIZE (EO_CALL_STACK_DEPTH_MIN * sizeof(Eo_Stack_Frame)) 260#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,
444 else 442 else
445 { 443 {
446 fptr->eo_id = eo_id; 444 fptr->eo_id = eo_id;
447 fptr->obj_data = EO_INVALID_DATA;
448 if (is_klass) 445 if (is_klass)
449 { 446 {
450 EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, EINA_FALSE); 447 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,
461 if (is_super) 458 if (is_super)
462 { 459 {
463 EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE); 460 EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE);
464 if (fptr->cur_klass == cur_klass)
465 fptr->obj_data = EO_INVALID_DATA;
466 fptr->cur_klass = cur_klass; 461 fptr->cur_klass = cur_klass;
467 } 462 }
468 else 463 else
@@ -512,8 +507,6 @@ _eo_do_end(void *eo_stack)
512 if (!_eo_is_a_class(fptr->eo_id) && fptr->o.obj) 507 if (!_eo_is_a_class(fptr->eo_id) && fptr->o.obj)
513 _eo_unref(fptr->o.obj); 508 _eo_unref(fptr->o.obj);
514 509
515 fptr->obj_data = EO_INVALID_DATA;
516
517 stack->frame_ptr--; 510 stack->frame_ptr--;
518 511
519 if (fptr == stack->shrink_frame) 512 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
574 if (is_obj) 567 if (is_obj)
575 { 568 {
576 call->obj = (Eo *)fptr->eo_id; 569 call->obj = (Eo *)fptr->eo_id;
577 if (func->src == fptr->o.obj->klass) 570 call->data = (char *)fptr->o.obj + cache->off[i].off;
578 {
579 if (fptr->obj_data == EO_INVALID_DATA)
580 fptr->obj_data = (char *)fptr->o.obj + cache->off[i].off;
581 call->data = fptr->obj_data;
582 }
583 else
584 call->data = (char *)fptr->o.obj + cache->off[i].off;
585 } 571 }
586 else 572 else
587 { 573 {
@@ -606,15 +592,7 @@ _eo_call_resolve(const char *func_name, Eo_Op_Call_Data *call, Eo_Call_Cache *ca
606 if (is_obj) 592 if (is_obj)
607 { 593 {
608 call->obj = (Eo *)fptr->eo_id; 594 call->obj = (Eo *)fptr->eo_id;
609 if (func->src == fptr->o.obj->klass) 595 call->data = _eo_data_scope_get(fptr->o.obj, func->src);
610 {
611 if (fptr->obj_data == EO_INVALID_DATA)
612 fptr->obj_data = _eo_data_scope_get(fptr->o.obj, func->src);
613
614 call->data = fptr->obj_data;
615 }
616 else
617 call->data = _eo_data_scope_get(fptr->o.obj, func->src);
618 } 596 }
619 else 597 else
620 { 598 {