[squeak-dev] Disable inlined message sends?

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Sat Nov 20 19:45:25 UTC 2021


Hi all!

I am working on a new super exciting simulation project that makes extensive uses of transparent proxy objects via ProtoObject and dynamic forwarding (#doesNotUnderstand:). Usually, my current experiments with dynamic forwarding work very well through the entire system, but I identified two kinds of situations in which proxies are not handled transparently:

1. Parameters that are passed to the VM for a primitive - e.g., #(1) at: (MyFancyProxy on: 1) will not work because most VM primitives expect value objects and do not honor dynamic forwarding. That's not ideal, but I can deal with it, because in my situation proxying immediate objects does not make great sense anyway. (Alternatively, I could also adjust the fallback implementation in Object >> #at: to "unpack" the proxy.)

2. Inlined message sends - such as #ifTrue: or #==. While the first one is only sent to value objects (booleans) only and I thus can filter them out easily, the second is a message that can be sent to any object of any class, and the fact that one cannot actually override #== or #~~ is pretty much annoying while working with proxies.
Here is my question: What would be the simplest way to disable inlined message sends for these selectors? I expect to write something like a simple patch to the encoder, followed by a recompilation of all methods in the image for my project.
And do you have any idea how significantly this would decrease the overall performance of Squeak?
Last but not least, if the performance overhead is insignificant, how would you think about disabling these inlined message sends in the Trunk as well? IMHO two of Squeaks most important characteristics are its powerful metaprogramming features and its suitability for research purposes. From this perspective, eliminating these VM-hardcoded implementation could be really helpful.

Thanks in advance!

Best,
Christoph


---
Sent from Squeak Inbox Talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211120/10b22927/attachment.html>


More information about the Squeak-dev mailing list