* Source/GSFFCallInvocation.m

(gs_method_for_receiver_and_selector): Replace usage of
        class_get_instance/class_method with GSGetInstance/ClassMethod and
        Method_t with GSMethod.
        (gs_find_by_receiver_best_typed_sel): Ditto.
        (GSInvocationCallback): Ditto.
        ([GSFFCallInvocation -invokeWithTarget:]): Ditto.
        * Source/GSFFIInvocation.m
        (gs_method_for_receiver_and_selector): Ditto.
        (gs_find_by_receiver_best_typed_sel): Ditto.
        (GSFFIInvocationCallback): Ditto.
        ([GSFFIInvocation -invokeWithTarget:]): Ditto.
        * Source/NSConnection.m
        ([NSConnection -_service_typeForSelector:]): Ditto.
        * Source/NSInvocation.m
        ([NSInvocation -invokeWithTarget:]): Ditto.
        * Source/NSObject.m
        ([NSObject +instanceMethodSignatureForSelector:]): Ditto.
        ([NDObject -methodSignatureForSelector:]): Ditto.
        ([NSObject +descriptionForInstanceMethod:]): Ditto.
        ([NSOnject -descriptionForMethod:]: Ditto.
        * Source/NSProxy.m
        ([NSProxy +methodSignatureForSelector:]): Ditto.
        ([NSProxy -methodSignatureForSelector:]): Ditto.
        * Source/NSDistantObject.m
        ([NSObject -selectorTypeForProxy:]): Ditto.
        ([NSDistantObject +respondsToSelector:]): Ditto. Corrected
        implementation to check class methods instead of instance methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17016 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2003-06-25 10:26:29 +00:00
parent 2f16ecd266
commit f6c50c154d
8 changed files with 64 additions and 34 deletions

View file

@ -1,3 +1,34 @@
2003-06-24 David Ayers <d.ayers@inode.at>
* Source/GSFFCallInvocation.m
(gs_method_for_receiver_and_selector): Replace usage of
class_get_instance/class_method with GSGetInstance/ClassMethod and
Method_t with GSMethod.
(gs_find_by_receiver_best_typed_sel): Ditto.
(GSInvocationCallback): Ditto.
([GSFFCallInvocation -invokeWithTarget:]): Ditto.
* Source/GSFFIInvocation.m
(gs_method_for_receiver_and_selector): Ditto.
(gs_find_by_receiver_best_typed_sel): Ditto.
(GSFFIInvocationCallback): Ditto.
([GSFFIInvocation -invokeWithTarget:]): Ditto.
* Source/NSConnection.m
([NSConnection -_service_typeForSelector:]): Ditto.
* Source/NSInvocation.m
([NSInvocation -invokeWithTarget:]): Ditto.
* Source/NSObject.m
([NSObject +instanceMethodSignatureForSelector:]): Ditto.
([NDObject -methodSignatureForSelector:]): Ditto.
([NSObject +descriptionForInstanceMethod:]): Ditto.
([NSOnject -descriptionForMethod:]: Ditto.
* Source/NSProxy.m
([NSProxy +methodSignatureForSelector:]): Ditto.
([NSProxy -methodSignatureForSelector:]): Ditto.
* Source/NSDistantObject.m
([NSObject -selectorTypeForProxy:]): Ditto.
([NSDistantObject +respondsToSelector:]): Ditto. Corrected
implementation to check class methods instead of instance methods.
2003-06-23 Adam Fedor <fedor@gnu.org>
* Testing/diningPhilosophers.m: Locking and output fixes (from

View file

@ -206,20 +206,19 @@ gs_splittable (const char *type)
* we work around it.
*/
static INLINE Method_t
static INLINE GSMethod
gs_method_for_receiver_and_selector (id receiver, SEL sel)
{
if (receiver)
{
if (object_is_instance (receiver))
{
return class_get_instance_method (object_get_class
return GSGetInstanceMethod (object_get_class
(receiver), sel);
}
else if (object_is_class (receiver))
{
return class_get_class_method (object_get_meta_class
(receiver), sel);
return GSGetClassMethod (receiver, sel);
}
}
@ -278,7 +277,7 @@ gs_find_by_receiver_best_typed_sel (id receiver, SEL sel)
if (receiver)
{
Method_t method;
GSMethod method;
method = gs_method_for_receiver_and_selector (receiver, sel);
/* CHECKME: Can we assume that:
@ -688,10 +687,10 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
else
{
imp = method_get_imp(object_is_instance(_target) ?
class_get_instance_method(
GSGetInstanceMethod(
((struct objc_class*)_target)->class_pointer, _selector)
: class_get_class_method(
((struct objc_class*)_target)->class_pointer, _selector));
: GSGetClassMethod(
((struct objc_class*)_target), _selector));
/*
* If fast lookup failed, we may be forwarding or something ...
*/
@ -742,7 +741,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
NSArgumentInfo *info;
GSFFCallInvocation *invocation;
NSMethodSignature *sig;
Method_t fwdInvMethod;
GSMethod fwdInvMethod;
typeinfo = (vacallReturnTypeInfo *) callback_data;
@ -874,7 +873,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
*
* [obj forwardInvocation: invocation];
*
* but we have already the Method_t for forwardInvocation
* but we have already the GSMethod for forwardInvocation
* so the line below is somewhat faster. */
fwdInvMethod->method_imp (obj, fwdInvMethod->method_name, invocation);

View file

@ -53,19 +53,19 @@ void GSFFIInvocationCallback(ffi_cif*, void*, void **, void*);
* we work around it.
*/
static INLINE Method_t
static INLINE GSMethod
gs_method_for_receiver_and_selector (id receiver, SEL sel)
{
if (receiver)
{
if (object_is_instance (receiver))
{
return class_get_instance_method (object_get_class
return GSGetInstanceMethod (object_get_class
(receiver), sel);
}
else if (object_is_class (receiver))
{
return class_get_class_method (object_get_meta_class
return GSGetClassMethod (object_get_class
(receiver), sel);
}
}
@ -125,7 +125,7 @@ gs_find_by_receiver_best_typed_sel (id receiver, SEL sel)
if (receiver)
{
Method_t method;
GSMethod method;
method = gs_method_for_receiver_and_selector (receiver, sel);
/* CHECKME: Can we assume that:
@ -320,10 +320,10 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
else
{
imp = method_get_imp(object_is_instance(_target) ?
class_get_instance_method(
GSGetInstanceMethod(
((struct objc_class*)_target)->class_pointer, _selector)
: class_get_class_method(
((struct objc_class*)_target)->class_pointer, _selector));
: GSGetClassMethod(
(struct objc_class*)_target, _selector));
/*
* If fast lookup failed, we may be forwarding or something ...
*/
@ -359,7 +359,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
SEL selector;
GSFFIInvocation *invocation;
NSMethodSignature *sig;
Method_t fwdInvMethod;
GSMethod fwdInvMethod;
obj = *(id *)args[0];
selector = *(SEL *)args[1];
@ -405,7 +405,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
*
* [obj forwardInvocation: invocation];
*
* but we have already the Method_t for forwardInvocation
* but we have already the GSMethod for forwardInvocation
* so the line below is somewhat faster. */
fwdInvMethod->method_imp (obj, fwdInvMethod->method_name, invocation);

View file

@ -2594,7 +2594,7 @@ static void callEncoder (DOContext *ctxt)
/* xxx We should make sure that TARGET is a valid object. */
/* Not actually a Proxy, but we avoid the warnings "id" would have made. */
m = class_get_instance_method(((NSDistantObject*)o)->isa, sel);
m = GSGetInstanceMethod(((NSDistantObject*)o)->isa, sel);
/* Perhaps I need to be more careful in the line above to get the
version of the method types that has the type qualifiers in it.
Search the protocols list. */

View file

@ -114,7 +114,7 @@ enum
+ (BOOL) respondsToSelector: (SEL)sel
{
return (IMP)class_get_instance_method(self, sel) != (IMP)0;
return GSGetClassMethod(self, sel) != (GSMethod)0;
}
+ (id) initWithCoder: (NSCoder*)aCoder
@ -1002,7 +1002,7 @@ static inline BOOL class_is_kind_of (Class self, Class aClassObject)
{
#if NeXT_runtime
{
Method m = class_get_instance_method(isa, selector);
Method m = GSGetInstanceMethod(isa, selector);
if (m)
return m->method_types;
else

View file

@ -565,10 +565,10 @@ _arg_addr(NSInvocation *inv, int index)
else
{
imp = method_get_imp(object_is_instance(_target) ?
class_get_instance_method(
GSGetInstanceMethod(
((struct objc_class*)_target)->class_pointer, _selector)
: class_get_class_method(
((struct objc_class*)_target)->class_pointer, _selector));
: GSGetClassMethod(
((struct objc_class*)_target), _selector));
/*
* If fast lookup failed, we may be forwarding or something ...
*/

View file

@ -1226,7 +1226,7 @@ static BOOL double_release_check_enabled = NO;
[NSException raise: NSInvalidArgumentException
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
mth = class_get_instance_method(self, aSelector);
mth = GSGetInstanceMethod(self, aSelector);
return mth ? [NSMethodSignature signatureWithObjCTypes:mth->method_types]
: nil;
}
@ -1246,8 +1246,8 @@ static BOOL double_release_check_enabled = NO;
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
mth = (GSObjCIsInstance(self)
? class_get_instance_method(GSObjCClass(self), aSelector)
: class_get_class_method(GSObjCClass(self), aSelector));
? GSGetInstanceMethod(GSObjCClass(self), aSelector)
: GSGetClassMethod((Class)self, aSelector));
if (mth == 0)
{
return nil;
@ -1858,7 +1858,7 @@ static BOOL double_release_check_enabled = NO;
[NSException raise: NSInvalidArgumentException
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
mth = class_get_instance_method(self, aSelector);
mth = GSGetInstanceMethod(self, aSelector);
return mth ? [NSMethodSignature signatureWithObjCTypes:mth->method_types]
: nil;
}
@ -2008,7 +2008,7 @@ static BOOL double_release_check_enabled = NO;
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
return ((struct objc_method_description *)
class_get_instance_method(self, aSel));
GSGetInstanceMethod(self, aSel));
}
- (struct objc_method_description *) descriptionForMethod: (SEL)aSel
@ -2019,8 +2019,8 @@ static BOOL double_release_check_enabled = NO;
return ((struct objc_method_description *)
(GSObjCIsInstance(self)
?class_get_instance_method(GSObjCClass(self), aSel)
:class_get_class_method(GSObjCClass(self), aSel)));
? GSGetInstanceMethod(GSObjCClass(self), aSel)
: GSGetClassMethod((Class)self, aSel)));
}
/**

View file

@ -124,7 +124,7 @@ extern BOOL __objc_responds_to(id, SEL);
{
return nil;
}
mth = class_get_class_method(GSObjCClass(self), aSelector);
mth = GSGetClassMethod(self, aSelector);
if (mth != 0)
{
const char *types = mth->method_types;
@ -355,7 +355,7 @@ extern BOOL __objc_responds_to(id, SEL);
{
return nil;
}
mth = class_get_instance_method(GSObjCClass(self), aSelector);
mth = GSGetInstanceMethod(GSObjCClass(self), aSelector);
if (mth != 0)
{
const char *types = mth->method_types;