Changeset 617


Ignore:
Timestamp:
07/31/10 01:44:18 (18 months ago)
Author:
mooneer
Message:
  1. Fixed string line numbering issue in lexer.
  2. Optimized kite_object_t/kite_basic_object_t to avoid unnecessary padding (at least on x86_64)
  3. Fixed function mapping for Object|remove_method to point to correct method.
Location:
interpreter/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • interpreter/trunk/apps/kite.c

    r594 r617  
    102102 
    103103    kite_app_init(); 
    104      
     104    /*printf("sizeof(kite_basic_object_t) = %d\n", sizeof(kite_basic_object_t)); 
     105    printf("sizeof(kite_object_t) = %d\n", sizeof(kite_object_t));*/ 
     106 
    105107    /* Parse command arguments first */ 
    106108#ifdef __linux 
  • interpreter/trunk/backend/common/kite_lexer.l

    r594 r617  
    178178        BEGIN(INITIAL); 
    179179        yylval->stringValue = compiler->curStr; 
     180        compiler->currentCol += 2; 
    180181        return DOCSTRING; 
    181182} 
     
    186187        BEGIN(INITIAL); 
    187188        yylval->stringValue = compiler->curStr; 
     189        compiler->currentCol++; 
    188190        return STRING_VALUE; 
    189191} 
     
    191193        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    192194        APPEND_STRING("\n"); 
    193         compiler->currentCol++; 
     195        compiler->currentCol += 2; 
    194196} 
    195197<str>\\t { 
    196198        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    197199        APPEND_STRING("\t"); 
    198         compiler->currentCol++; 
     200        compiler->currentCol += 2; 
    199201} 
    200202<str>\\r { 
    201203        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    202204        APPEND_STRING("\r"); 
    203         compiler->currentCol++; 
     205        compiler->currentCol += 2; 
    204206} 
    205207<str>\\b { 
    206208        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    207209        APPEND_STRING("\b"); 
    208         compiler->currentCol++; 
     210        compiler->currentCol += 2; 
    209211} 
    210212<str>\\f { 
    211213        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    212214        APPEND_STRING("\f"); 
    213         compiler->currentCol++; 
     215        compiler->currentCol += 2; 
    214216} 
    215217<str>\\[0-7]{1,3} {  
     
    238240        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    239241        APPEND_STRING(yytext); 
     242        compiler->currentCol += strlen(yytext); 
    240243} 
    241244<str>\r?\n { 
     
    255258        BEGIN(INITIAL); 
    256259        yylval->stringValue = compiler->curStr; 
     260        compiler->currentCol++; 
    257261        return STRING_VALUE; 
    258262} 
     
    260264        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    261265        APPEND_STRING("\n"); 
    262         compiler->currentCol++; 
     266        compiler->currentCol += 2; 
    263267} 
    264268<str2>\\t { 
    265269        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    266270        APPEND_STRING("\t"); 
    267         compiler->currentCol++; 
     271        compiler->currentCol += 2; 
    268272} 
    269273<str2>\\r { 
    270274        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    271275        APPEND_STRING("\r"); 
    272         compiler->currentCol++; 
     276        compiler->currentCol += 2; 
    273277} 
    274278<str2>\\b { 
    275279        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    276280        APPEND_STRING("\b"); 
    277         compiler->currentCol++; 
     281        compiler->currentCol += 2; 
    278282} 
    279283<str2>\\f { 
    280284        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    281285        APPEND_STRING("\f"); 
    282         compiler->currentCol++; 
     286        compiler->currentCol += 2; 
    283287} 
    284288<str2>\\[0-7]{1,3} {  
     
    307311        kite_compiler_t *compiler = (kite_compiler_t*)yyextra; 
    308312        APPEND_STRING(yytext); 
     313        compiler->currentCol += strlen(yytext); 
    309314} 
    310315<str2>\r?\n { 
  • interpreter/trunk/modules/System/object.c

    r596 r617  
    951951                                  "glb", "Whether this is a global property (true/false).")); 
    952952    kite_add_method(thread, newclass, "remove_method", 
    953        kite_new_method_compiled_with_docs(thread, Object_addMethod, 
     953       kite_new_method_compiled_with_docs(thread, Object_removeMethod, 
    954954                                  "Remove a method from the given object.", 2, 
    955955                                  "name", "Name of the method.", 
  • interpreter/trunk/objs/kite_object.h

    r600 r617  
    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 */; 
    166168    enum kite_object_type_t type /*! The object's type. */; 
    167     kite_thread_t *owner_thread /*! Owner thread \private */; 
    168169    int shareable /*! Can be shared with other threads. \private */; 
    169     struct kite_object_t *parent /*! Parent object. \private */; 
    170170    union { 
    171171        long intvalue /*! Associated integer value. */; 
     
    185185    kite_list_t *gc_entry /*! GC entry (not intended to be used by user code) \private */; 
    186186#endif /* HAVE_GC_H */ 
     187    kite_thread_t *owner_thread /*! Owner thread \private */; 
     188    struct kite_object_t *parent /*! Parent object. \private */; 
    187189    enum kite_object_type_t type /*! The object's type. */; 
    188     kite_thread_t *owner_thread /*! Owner thread \private */; 
    189190    int shareable /*! Can be shared with other threads. \private */; 
    190     struct kite_object_t *parent /*! Parent object. \private */; 
    191191    union { 
    192192        long intvalue /*! Associated integer value. */; 
Note: See TracChangeset for help on using the changeset viewer.