diff options
author | Ovidiu Predescu <ovidiu@aracnet.com> | 1998-09-02 23:48:01 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-09-02 17:48:01 -0600 |
commit | d8bb17c8e33975277dd5231e190bf99451b7025d (patch) | |
tree | 1c3b607110323b831606c2ec27d39a0f292a1a15 /gcc/objc/sendmsg.c | |
parent | d636ae0b801758df397e3e1ee790ed041a48b9f9 (diff) | |
download | gcc-d8bb17c8e33975277dd5231e190bf99451b7025d.zip gcc-d8bb17c8e33975277dd5231e190bf99451b7025d.tar.gz gcc-d8bb17c8e33975277dd5231e190bf99451b7025d.tar.bz2 |
Boehm GC support for ObjC from Ovidiu Predescu.
From-SVN: r22199
Diffstat (limited to 'gcc/objc/sendmsg.c')
-rw-r--r-- | gcc/objc/sendmsg.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/gcc/objc/sendmsg.c b/gcc/objc/sendmsg.c index 245b8b9..17f8b97 100644 --- a/gcc/objc/sendmsg.c +++ b/gcc/objc/sendmsg.c @@ -244,10 +244,7 @@ __objc_init_install_dtable(id receiver, SEL op) /* Install real dtable for factory methods */ __objc_install_dispatch_table_for_class (receiver->class_pointer); - if (strcmp (sel_get_name (op), "initialize")) - __objc_send_initialize((Class)receiver); - else - CLS_SETINITIALIZED((Class)receiver); + __objc_send_initialize((Class)receiver); } objc_mutex_unlock(__objc_runtime_mutex); } @@ -273,36 +270,36 @@ __objc_send_initialize(Class class) { CLS_SETINITIALIZED(class); CLS_SETINITIALIZED(class->class_pointer); - + + /* Create the garbage collector type memory description */ + __objc_generate_gc_type_description (class); + if(class->super_class) __objc_send_initialize(class->super_class); { - SEL op = sel_register_name ("initialize"); - Class tmpclass = class; - IMP imp = 0; - - while (!imp && tmpclass) { - MethodList_t method_list = tmpclass->class_pointer->methods; - - while(!imp && method_list) { - int i; - Method_t method; - - for (i=0;i<method_list->method_count;i++) { - method = &(method_list->method_list[i]); - if (method->method_name - && method->method_name->sel_id == op->sel_id) { - imp = method->method_imp; - break; - } - } + SEL op = sel_register_name ("initialize"); + IMP imp = 0; + MethodList_t method_list = class->class_pointer->methods; + + while (method_list) { + int i; + Method_t method; + + for (i = 0; i< method_list->method_count; i++) { + method = &(method_list->method_list[i]); + if (method->method_name + && method->method_name->sel_id == op->sel_id) { + imp = method->method_imp; + break; + } + } - method_list = method_list->method_next; + if (imp) + break; - } + method_list = method_list->method_next; - tmpclass = tmpclass->super_class; } if (imp) (*imp)((id)class, op); |