MetaLink question

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

MetaLink question

Thierry Goubier
Hi,

is there a way to look at a method code once it has been added
metalinks? I'm trying to add a metalink after the last statement of a
block and it fails on IR generation with an unknown temporary...

Regards,

Thierry

Reply | Threaded
Open this post in threaded view
|

Re: MetaLink question

Marcus Denker-4


> On 1 Oct 2017, at 14:58, Thierry Goubier <[hidden email]> wrote:
>
> Hi,
>
> is there a way to look at a method code once it has been added metalinks?

You can inspect the method. The best is to turn on #optionCompileOnLinkInstallation

(just add

        optionCompileOnLinkInstallation: true;

to the link definition).

This way the method is recompiled when installing the link, not on execution.

After you can inspect the method and look at the Bytecode / IR.

> I'm trying to add a metalink after the last statement of a block and it fails on IR generation with an unknown temporary...
>

If you have a test I can have a look, too

        Marcus
Reply | Threaded
Open this post in threaded view
|

Re: MetaLink question

Thierry Goubier
Hi Markus,

2017-10-03 16:45 GMT+02:00 Marcus Denker <[hidden email]>:


> On 1 Oct 2017, at 14:58, Thierry Goubier <[hidden email]> wrote:
>
> Hi,
>
> is there a way to look at a method code once it has been added metalinks?

You can inspect the method. The best is to turn on #optionCompileOnLinkInstallation

(just add

        optionCompileOnLinkInstallation: true;

to the link definition).

This way the method is recompiled when installing the link, not on execution.

After you can inspect the method and look at the Bytecode / IR.

This is what I ended up doing: looking at the IR, understanding the code that the Metalink was generating (an #ensure:, since it was an after link) rewriting a similar code in smalltalk to check the IR differences, and finding out where it got it wrong.

I solved this one by making it a weak after link (adding the weak whatever option).
 

> I'm trying to add a metalink after the last statement of a block and it fails on IR generation with an unknown temporary...
>

If you have a test I can have a look, too

It was trying to add an after link to the last expression of a [:p | p + ml ] block in a #collect:.

The mistake was that when writing the ensure (rewriting as [:p | [ p + ml ] ensure: [ link ] ] ), it would forget to add the temporary :p as a copied temp? into the [ p + ml ] block.

The workaround was to ask it not to use an #ensure: block.

Then I encountered more errors of that kind (IR generation errors) on very simple links (popping one time too much) and given that it took me a long time to find a workaround for the first one, that I could not find a workaround for the second one (#after, #instead, #before, #after weak wouldn't work), and that I was only at the third type of probes (out of about 20) I needed to do, I stopped there.

Thierry
 

        Marcus