We should create some syntax to access the object in methods.

It used to be:

1)

   self."bar"()

where "self" automagically expanded to P2.

The current offical way is this sequence

2)

   .include "interpinfo.pasm"
   $P0 = interpinfo .INTERPINFO_CURRENT_OBJECT

   $P0."bar"()

This two-liner looks a bit bulky compared to the old syntax.

I can imagine several ways to achieve the simplicity of 1) again, but this needs some effort in code generation inside imcc.

As an intermediate step, I'm thinking of something like:

3)

   .GET_SELF($P0)

This macro expands to the above two-liner and is defined internally.

A final and optimal solution would expand "self" to either a (re)fetch into volatiles or non-volatiles, or depending on register allocation pressure and usage to a fetch once and reuse this register.

Better solutions welcome,
leo



Reply via email to