OSDN Git Service

Fix grammar/spelling.
[pf3gnuchains/gcc-fork.git] / libobjc / sendmsg.c
index bb525b1..ea8ea97 100644 (file)
@@ -62,7 +62,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define INVISIBLE_STRUCT_RETURN 0
 #endif
 
-/* The uninstalled dispatch table.  */
+/* The uninstalled dispatch table.  If a class' dispatch table points
+   to __objc_uninstalled_dtable then that means it needs its dispatch
+   table to be installed.  */
 struct sarray *__objc_uninstalled_dtable = 0;   /* !T:MUTEX */
 
 /* Two hooks for method forwarding. If either is set, it is invoked to
@@ -469,29 +471,6 @@ objc_msg_lookup_super (struct objc_super *super, SEL sel)
     return (IMP)nil_method;
 }
 
-/* Temporarily defined here until objc_msg_sendv() goes away.  */
-char *method_get_first_argument (struct objc_method *,
-                                arglist_t argframe, 
-                                const char **type);
-char *method_get_next_argument (arglist_t argframe, 
-                               const char **type);
-int method_get_sizeof_arguments (struct objc_method *);
-
-struct objc_method *
-class_get_instance_method (Class class, SEL op);
-
-retval_t
-objc_msg_sendv (id object, SEL op, arglist_t arg_frame)
-{
-  struct objc_method *m = class_get_instance_method (object->class_pointer, op);
-  const char *type;
-  *((id *) method_get_first_argument (m, arg_frame, &type)) = object;
-  *((SEL *) method_get_next_argument (arg_frame, &type)) = op;
-  return __builtin_apply ((apply_t) m->method_imp, 
-                         arg_frame,
-                         method_get_sizeof_arguments (m));
-}
-
 void
 __objc_init_dispatch_tables ()
 {
@@ -537,34 +516,13 @@ __objc_send_initialize (Class class)
 
       {
        SEL op = sel_registerName ("initialize");
-       IMP imp = 0;
-        struct objc_method_list * method_list = class->class_pointer->methods;
-       
-        while (method_list)
-         {
-           int i;
-           struct objc_method * 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;
-                 }
-             }
-           
-           if (imp)
-             break;
-           
-           method_list = method_list->method_next;
-         }
-       if (imp)
+        struct objc_method *method = search_for_method_in_hierarchy (class->class_pointer, 
+                                                                    op);
+
+       if (method)
          {
            DEBUG_PRINTF (" begin of [%s +initialize]\n", class->name);
-           (*imp) ((id) class, op);
+           (*method->method_imp) ((id)class, op);
            DEBUG_PRINTF (" end of [%s +initialize]\n", class->name);
          }
 #ifdef DEBUG
@@ -665,18 +623,6 @@ class_add_method_list (Class class, struct objc_method_list * list)
 }
 
 struct objc_method *
-class_get_instance_method (Class class, SEL op)
-{
-  return search_for_method_in_hierarchy (class, op);
-}
-
-struct objc_method *
-class_get_class_method (MetaClass class, SEL op)
-{
-  return search_for_method_in_hierarchy (class, op);
-}
-
-struct objc_method *
 class_getInstanceMethod (Class class_, SEL selector)
 {
   struct objc_method *m;
@@ -883,6 +829,9 @@ search_for_method_in_list (struct objc_method_list * list, SEL op)
   return NULL;
 }
 
+typedef void * retval_t;
+typedef void * arglist_t;
+
 static retval_t __objc_forward (id object, SEL sel, arglist_t args);
 
 /* Forwarding pointers/integers through the normal registers.  */
@@ -1018,15 +967,6 @@ __objc_print_dtable_stats (void)
   objc_mutex_unlock (__objc_runtime_mutex);
 }
 
-/* Returns the uninstalled dispatch table indicator.  If a class'
-   dispatch table points to __objc_uninstalled_dtable then that means
-   it needs its dispatch table to be installed.  */
-struct sarray *
-objc_get_uninstalled_dtable (void)
-{
-  return __objc_uninstalled_dtable;
-}
-
 static cache_ptr prepared_dtable_table = 0;
 
 /* This function is called by: objc_msg_lookup, get_imp and