[vwnc] doesNotUnderstand:arguments:?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] doesNotUnderstand:arguments:?

Mark Plas

Hi,

 

I’ve noticed that the VisualWorks VM contains support for a variant of doesNotUnderstand:, namely doesNotUnderstand:arguments: (you can see this in the file dnu.c).

 

Is there a way to use this one? I would think it would be faster than #doesNotUnderstand: since no Message object needs to be allocated for each invocation. I tried implementing it on a class and removed the ordinary DNU selector but the image crashes on a ‘no method found for doesNotUnderstand:’ error message.

 

Any ideas?

 

Thanks,

Mark


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] doesNotUnderstand:arguments:?

Ralf Propach
Mark Plas wrote:

> Hi,
>
> I've noticed that the VisualWorks VM contains support for a variant of doesNotUnderstand:, namely doesNotUnderstand:arguments:
> (you can see this in the file dnu.c).
>
> Is there a way to use this one? I would think it would be faster than #doesNotUnderstand: since no Message object needs to be
> allocated for each invocation. I tried implementing it on a class and removed the ordinary DNU selector but the image crashes
> on a 'no method found for doesNotUnderstand:' error message.
>
> Any ideas?
>
> Thanks,
> Mark
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Hi Mark,

if you look at start of the C function, you can that the VM finds the selector in the sysOopRegistry.
You can access it with ObjectMemory objectRegisteredWithEngineFor: 'sysOopRegistry'.
#doesNotUnderstand: is the 15th element in the array. You could try and replace it there with #doesNotUnderstand:arguments:
This change will affect all doesNotUnderstands in all classes, so you should implement #doesNotUnderstand:arguments: in Object
first.

I have not tried anything of this - let me know how it goes.

Ralf


--
Ralf Propach, [hidden email]
Tel: +49 231 975 99 38   Fax: +49 231 975 99 20
Georg Heeg eK (Dortmund)
Handelsregister: Amtsgericht Dortmund  A 12812

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] doesNotUnderstand:arguments:?

Mark Plas
In reply to this post by Mark Plas

Hi Ralf,

Thanks for the quick answer! I've tried it and it seems to work. I'm going to have to do some experiments to see how it affects performance. It should be faster than the ordinary DNU. It makes me wonder whether it could be interesting to have #doesNotUnderstandWithNoArgs:, #doesNotUnderstand:with:, #doesNotUnderstand:with:with:, etc... variants. Then the need to allocate an Array for the arguments would disappear, making it even faster. But these aren't available in the VM.

I'm going to have to inspect this sysOopRegistry a bit more. Perhaps it contains other useful things?

Thanks again!
Mark

-----Original Message-----
From: Ralf Propach [mailto:[hidden email]]
Sent: woensdag 17 september 2008 10:35
To: Mark Plas
Subject: Re: [vwnc] doesNotUnderstand:arguments:?

Mark Plas wrote:

> Hi,
>
> I've noticed that the VisualWorks VM contains support for a variant of doesNotUnderstand:, namely doesNotUnderstand:arguments:
> (you can see this in the file dnu.c).
>
> Is there a way to use this one? I would think it would be faster than #doesNotUnderstand: since no Message object needs to be
> allocated for each invocation. I tried implementing it on a class and removed the ordinary DNU selector but the image crashes
> on a 'no method found for doesNotUnderstand:' error message.
>
> Any ideas?
>
> Thanks,
> Mark
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Hi Mark,

if you look at start of the C function, you can that the VM finds the selector in the sysOopRegistry.
You can access it with ObjectMemory objectRegisteredWithEngineFor: 'sysOopRegistry'.
#doesNotUnderstand: is the 15th element in the array. You could try and replace it there with #doesNotUnderstand:arguments:
This change will affect all doesNotUnderstands in all classes, so you should implement #doesNotUnderstand:arguments: in Object
first.

I have not tried anything of this - let me know how it goes.

Ralf


--
Ralf Propach, [hidden email]
Tel: +49 231 975 99 38   Fax: +49 231 975 99 20
Georg Heeg eK (Dortmund)
Handelsregister: Amtsgericht Dortmund  A 12812

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc