aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKresten Krab Thorup <krab@gcc.gnu.org>1993-04-12 15:44:02 +0000
committerKresten Krab Thorup <krab@gcc.gnu.org>1993-04-12 15:44:02 +0000
commitd408c5dad6a60c641458957794429e9f226ce857 (patch)
tree2f796e74005f80f1b4d7da2274d53d2e60d7274d
parenteca33b05fb46941c04c51613333afbeb08b8744c (diff)
downloadgcc-d408c5dad6a60c641458957794429e9f226ce857.zip
gcc-d408c5dad6a60c641458957794429e9f226ce857.tar.gz
gcc-d408c5dad6a60c641458957794429e9f226ce857.tar.bz2
(__objc_init_install_dtable,
__objc_install_dtable_for_class): Call to __objc_resolve_class_links moved to the latter. From-SVN: r4093
-rw-r--r--gcc/objc/sendmsg.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/objc/sendmsg.c b/gcc/objc/sendmsg.c
index 90688a5..301313d 100644
--- a/gcc/objc/sendmsg.c
+++ b/gcc/objc/sendmsg.c
@@ -77,6 +77,12 @@ get_imp (Class_t class, SEL sel)
#endif
}
+__inline__ BOOL
+__objc_responds_to (id object, SEL sel)
+{
+ return get_imp (object->class_pointer, sel) != __objc_missing_method;
+}
+
/* This is the lookup function. All entries in the table are either a
valid method *or* one of `__objc_missing_method' which calls
forward:: etc, or `__objc_init_install_dtable' which installs the
@@ -139,11 +145,6 @@ static void __objc_init_install_dtable(id receiver, SEL op)
void* args;
void* result;
- /* If the class has not yet had it's class links resolved, we must
- re-compute all class links */
- if(!CLS_ISRESOLV(receiver->class_pointer))
- __objc_resolve_class_links();
-
/* This may happen, if the programmer has taken the address of a
method before the dtable was initialized... too bad for him! */
if(receiver->class_pointer->dtable != __objc_uninstalled_dtable)
@@ -232,10 +233,17 @@ static void
__objc_install_dispatch_table_for_class (Class_t class)
{
#ifdef OBJC_SPARSE_LOOKUP
- Class_t super = class->super_class;
+ Class_t super;
MethodList_t mlist;
int counter;
+ /* If the class has not yet had it's class links resolved, we must
+ re-compute all class links */
+ if(!CLS_ISRESOLV(class))
+ __objc_resolve_class_links();
+
+ super = class->super_class;
+
if (super != 0 && (super->dtable == __objc_uninstalled_dtable))
__objc_install_dispatch_table_for_class (super);