[squeak-dev] modifying instance variable allocation

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon May 2 05:42:17 UTC 2022


Hi Lauren,
Indeed, the VM is cheating, and for obvious efficiency reasons don't send
the message instVarAt:. You would need to define a specific Compiler to
encode the inst var access with other bytecode sequences.
Nicolas

Le lun. 2 mai 2022, 03:08, Lauren Pullen <drurowin at gmail.com> a écrit :

> Hi list,
>
> I'm trying to make an object that has special instance variable
> allocation methods by overriding #instVarAt: and #instVarAt:put:, but it
> isn't working.
>
> In an inspector, the fields are presented as expected, but the
> #pushRcvr: and #popIntoRcvr: bytecodes seem to use the basic behavior.
>
> #instVarAt: and #instVarAt:put: aren't labeled 'No lookup.' like #== is,
> but the VM bytecode evaluator doesn't use them for instance variable
> access so the overridden the new behavior only works in the simulator...
> which includes everything from inspectors to fileIn/Out and bytecode
> simulators.
>
> Is this something you can do? or are you required to use custom getter
> and setter methods?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220502/0bb76a63/attachment.html>


More information about the Squeak-dev mailing list