mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
* 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:
parent
2f16ecd266
commit
f6c50c154d
8 changed files with 64 additions and 34 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue