<br><br><div class="gmail_quote">On Tue, Jan 13, 2009 at 2:15 AM, Martin Beck <span dir="ltr"><<a href="mailto:martin.beck@hpi.uni-potsdam.de">martin.beck@hpi.uni-potsdam.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="Wj3C7c">Igor Stasenko wrote:<br>
> 2009/1/12 nicolas cellier <<a href="mailto:ncellier@ifrance.com">ncellier@ifrance.com</a>>:<br>
>> Following cascading of macros, I need turning some inline off. A recurrent<br>
>> topic in Squeak-dev.<br>
>><br>
>> Well, once i thought about using a Compiler reflective annotation (i.e. a<br>
>> pragma) in order to turn optimization off.<br>
>><br>
>> Stupid me.<br>
>> Inlined messages are made of block receiver/arguments.<br>
>> So one would simply turn inlining off by sending a yourself message to a<br>
>> block.<br>
>><br>
>><br>
>> [false] yourself whileTrue.<br>
>><br>
>> false ifTrue: [self inspect] yourself.<br>
>><br>
>> Of course, yourself is not a very explicit message...<br>
>> We could create another #turnOffInlining or something...<br>
>><br>
>> Except that in Squeak as other Smalltalks, the Old Compiler is quite<br>
>> pedantic about optimizing these messages.<br>
>><br>
>> [false] yourself <- receiver of whileTrue must be a block or variable<br>
>> ->whileTrue.<br>
>><br>
>> false ifTrue: [self inspect] <- argument of ifTrue: must be a block or<br>
>> variable ->yourself.<br>
>><br>
>><br>
>> Common! You don't like the system? Change It!<br>
>> This is just 1 method attached.<br>
><br>
> Heh.. you seem stumbled upon same things as i was :)<br>
><br>
> well, if you writing own code so you have a total control whether you<br>
> want inlining or not, you can simply write:<br>
> [ ... ] perform: #whileTrue<br>
><br>
</div></div>But keep in mind, that (at least in my Squeak 3.10 image)<br>
BlockContext>>whileTrue: is defined recursively:<br>
<br>
whileTrue: aBlock<br>
^ [self value] whileTrue: [aBlock value]</blockquote><div><br></div><div>Argh! Never try to write an email when you're hurrying before taking the kids to school. This one works:</div><div><br></div><div>whileTrue: aBlock</div>
<div> ^self value ifTrue:</div><div> [aBlock value.</div><div> self whileTrue: aBlock]</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
Thus, you still get inlined code somewhere. However, this can be changed<br>
to use BlockContext>>restart, I think...<br>
<br>
Regards, Martin<br>
<br>
</blockquote></div><br>