Changeset 618


Ignore:
Timestamp:
07/31/10 01:55:49 (18 months ago)
Author:
mooneer
Message:

Shrunk basic object size even further by removing unnecessary parent and owner_thread pointers. Now 16 bytes on amd64 and probably 12 on IA32 (unverified). Resulted in 100ms runtime reduction for "million iteration" basic loop on a Core i7 MacBook? Pro.

Location:
interpreter/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • interpreter/trunk/backend/kite-vm-1.0/kite_execute.c

    r601 r618  
    10231023        } 
    10241024        kite_dereference_object(oldobj); 
    1025         kite_dereference_object(oldobj->parent); 
    1026         if (oldobj->type != OBJ_CLASS) 
    1027             oldobj->parent = NULL; 
     1025        if (oldobj->type != OBJ_BOOLEAN && 
     1026            oldobj->type != OBJ_INTEGER && 
     1027            oldobj->type != OBJ_FLOAT) 
     1028        { 
     1029            kite_dereference_object(oldobj->parent); 
     1030            if (oldobj->type != OBJ_CLASS) 
     1031                oldobj->parent = NULL; 
     1032        } 
    10281033        kite_dereference_object(kite_vm_pop(thd)); 
    10291034        return ins->common.next; 
  • interpreter/trunk/objs/kite_object.h

    r617 r618  
    164164 */ 
    165165typedef struct kite_basic_object_t { 
    166     kite_thread_t *owner_thread /*! Owner thread \private */; 
    167     struct kite_object_t *parent /*! Parent object. \private */; 
    168166    enum kite_object_type_t type /*! The object's type. */; 
    169167    int shareable /*! Can be shared with other threads. \private */; 
     
    185183    kite_list_t *gc_entry /*! GC entry (not intended to be used by user code) \private */; 
    186184#endif /* HAVE_GC_H */ 
    187     kite_thread_t *owner_thread /*! Owner thread \private */; 
    188     struct kite_object_t *parent /*! Parent object. \private */; 
    189185    enum kite_object_type_t type /*! The object's type. */; 
    190186    int shareable /*! Can be shared with other threads. \private */; 
     
    205201        FILE *filevalue /*! File value. \private */; 
    206202    } builtin_data; 
     203    kite_thread_t *owner_thread /*! Owner thread \private */; 
     204    struct kite_object_t *parent /*! Parent object. \private */; 
    207205    struct { 
    208206        char *name /*! Name of class. */; 
Note: See TracChangeset for help on using the changeset viewer.