Hi Igor,<br><br><div class="gmail_quote">On Sat, Feb 21, 2009 at 7:10 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
2009/2/22 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Feb 21, 2009 at 3:36 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 2009/2/21 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi Igor,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Fri, Feb 20, 2009 at 11:37 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Here the method:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; isContextHeader: aHeader<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self inline: true.<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;^ ((aHeader &gt;&gt; 12) bitAnd: 16r1F) = 13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;MethodContext&quot;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [((aHeader &gt;&gt; 12) bitAnd: 16r1F) = 14 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;BlockContext&quot;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [((aHeader &gt;&gt; 12) bitAnd: 16r1F) = 4]] &nbsp; &nbsp; &nbsp;&quot;PseudoContext&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; i think it wouldn&#39;t hurt to rewrite it as:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; isContextHeader: aHeader<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self inline: true.<br>
&gt;&gt; &gt;&gt; &nbsp;| hdr |<br>
&gt;&gt; &gt;&gt; &nbsp;hdr := aHeader bitAnd: (16r1F &lt;&lt; 12).<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;^ hdr = (13 &lt;&lt; 12) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;MethodContext&quot;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [ hdr = (14 &lt;&lt; 12) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;BlockContext&quot;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [ hdr = (4 &lt;&lt; 12)]] &nbsp;&quot;PseudoContext&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; which will allow GCC to optimize it more easily.<br>
&gt;&gt; &gt;&gt; I&#39;m not sure if it can optimize it in its current state.<br>
&gt;&gt; &gt;&gt; This may impact a small speedup of copy operations and any other<br>
&gt;&gt; &gt;&gt; operations which need to determine a number of pointer fields in<br>
&gt;&gt; &gt;&gt; object (users of #lastPointerOf:)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; First you should look at the assembly that gcc generates to be sure anything is needed. &nbsp;e.g.<br>
&gt;&gt; &gt; cat &gt;t.c &lt;&lt;END<br>
&gt;&gt; &gt; long isContext(long aHeader) {<br>
&gt;&gt; &gt; &nbsp; &nbsp; return ((aHeader &gt;&gt; 12) &amp; 0x1F) == 13<br>
&gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; || ((aHeader &gt;&gt; 12) &amp; 0x1F) == 14<br>
&gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; || ((aHeader &gt;&gt; 12) &amp; 0x1F) == 4;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt; END<br>
&gt;&gt; &gt; gcc -O3 -S -fomit-frame-pointer t.c; cat t.s<br>
&gt;&gt; &gt; &nbsp; &nbsp; .text<br>
&gt;&gt; &gt; .globl _isContext<br>
&gt;&gt; &gt; _isContext:<br>
&gt;&gt; &gt; &nbsp; &nbsp; movl &nbsp; &nbsp;4(%esp), %edx<br>
&gt;&gt; &gt; &nbsp; &nbsp; sarl &nbsp; &nbsp;$12, %edx<br>
&gt;&gt; &gt; &nbsp; &nbsp; andl &nbsp; &nbsp;$31, %edx<br>
&gt;&gt; &gt; &nbsp; &nbsp; leal &nbsp; &nbsp;-13(%edx), %eax<br>
&gt;&gt; &gt; &nbsp; &nbsp; cmpl &nbsp; &nbsp;$1, %eax<br>
&gt;&gt; &gt; &nbsp; &nbsp; jbe L2<br>
&gt;&gt; &gt; &nbsp; &nbsp; cmpl &nbsp; &nbsp;$4, %edx<br>
&gt;&gt; &gt; &nbsp; &nbsp; je &nbsp;L2<br>
&gt;&gt; &gt; &nbsp; &nbsp; xorl &nbsp; &nbsp;%eax, %eax<br>
&gt;&gt; &gt; &nbsp; &nbsp; ret<br>
&gt;&gt; &gt; L2:<br>
&gt;&gt; &gt; &nbsp; &nbsp; movl &nbsp; &nbsp;$1, %eax<br>
&gt;&gt; &gt; &nbsp; &nbsp; ret<br>
&gt;&gt; &gt; &nbsp; &nbsp; .subsections_via_symbols<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; So you don&#39;t need to do anything; it has done everything for you.<br>
&gt;&gt; &gt; However, one point is important. &nbsp;Using 16r1F &lt;&lt; 12 et al as your masks and constants to compare against is much worse on many systems, most importantly x86, than shifting down by 12 and comparing against small constants, because the instruction set can encode small constants far more compactly, and that means better code density in the icache which is significant for performance. &nbsp;e.g. on x86 a constant in the range -128 to 127 typically takes a byte whereas anything else will take 4.<br>

&gt;&gt; &gt; But what I really think is that this is too low a level to worry about. &nbsp;Much more important to focus on<br>
&gt;&gt; &gt; - context to stack mapping<br>
&gt;&gt; &gt; - in-line cacheing via a JIT<br>
&gt;&gt; &gt; - exploiting multicore via Hydra<br>
&gt;&gt; &gt; and beyond (e.g. speculative inlining)<br>
&gt;&gt; &gt; than worrying about tiny micro-optimizations like this :)<br>
&gt;&gt;<br>
&gt;&gt; Thanks Eliot.<br>
&gt;&gt; In fact, this method drawn my attention because of its number of<br>
&gt;&gt; checks. Typically, all code which dealing with object formats contain<br>
&gt;&gt; many branches. And from places where this method is called, there are<br>
&gt;&gt; additional checks surrounding it.<br>
&gt;&gt; So, the real problem is the overwhelming number of checks to do<br>
&gt;&gt; something, and i think this having own impacts on performance.<br>
&gt;&gt; I hope that a new object format with 64 bit header, which you plan to<br>
&gt;&gt; use, will allow us to avoid so many branches in code which having high<br>
&gt;&gt; usage frequency.<br>
&gt;<br>
&gt; In fact the StackVM makes a big improvement to this very method because in the StackVM there are only MethodContexts and so the method reads<br>
&gt; isContextHeader: aHeader<br>
&gt; &lt;inline: true&gt;<br>
&gt; &quot;c.f. {BlockContext. MethodContext. PseudoContext} collect: [:class| class -&gt; class indexIfCompact]&quot;<br>
&gt; ^(self compactClassIndexOfHeader: aHeader) == ClassMethodContextCompactIndex<br>
&gt; which is f course equivalent to<br>
&gt; isContextHeader: aHeader<br>
&gt; ^((aHeader &gt;&gt; 12) bitAnd: 16r1F) = 13<br>
&gt; :)<br>
&gt;<br>
<br>
</div></div>yeah much more concise &amp; understandable.<br>
<br>
I currently thinking is there are simple ways to decompose huge<br>
ObjectMemory/Interpreter on multiple smaller classes.<br>
To illustrate it , applied to #isContextHeader: we could write it as following:<br>
<br>
isContextHeader: aHeader<br>
&lt;inline: true&gt;<br>
&lt;var: #aHeader class: #OopBaseHeader&gt;<br>
^ aHeader compactClassIndex == ClassMethodContextCompactIndex<br>
<br>
and, of course, then we really don&#39;t need #isContextHeader: at all<br>
because we can simply write a direct message in methods where we need<br>
such checks:<br>
<br>
&lt;var: #header class: #OopBaseHeader&gt;<br>
&lt;var: #oop class: #Oop&gt;<br>
header := oop basicHeader.<br>
header isContextHeader ifTrue: [ ... ]<br>
<br>
The idea is to use type information in code generator to determine<br>
where it should look for a code when translating a message sends to C<br>
code.<br>
With little more heuristics, we don&#39;t even need to declare types so often:<br>
Oop&gt;&gt;basicHeader<br>
&nbsp;&lt;returnType: #OopBaseHeader&gt;<br>
&nbsp;^ self longAt: 0<br>
or even:<br>
<br>
Oop&gt;&gt;basicHeader<br>
&nbsp;^ (self longAt: 0) as:OopBaseHeader<br>
<br>
<br>
so, then you could simply write:<br>
oop basicHeader isContextHeader ifTrue: [... ]<br>
<br>
looks like a plain smalltalk code, isnt? :)<br>
<br>
i&#39;m using similar technique for static inlining in Moebius/CorruptVM.</blockquote><div><br></div><div>I&#39;m also using something like this in Cog, but only for simple struct types, a machine code method CogMethod, a stack page, various structs in the compiler such as an instruction, a block start, etc. &nbsp;e.g.</div>
<div><span class="Apple-style-span" style="font-family: Times; font-size: 16px; "><b>generateInstructionsAt:</b><font color="#000000">&nbsp;</font><font color="#000080">eventualAbsoluteAddress</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">&quot;Size pc-dependent instructions and assign eventual addresses to all instructions.&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Answer the size of the code.&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Compute forward branches based on virtual address (abstract code starts at 0),&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assuming that any branches branched over are long.&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Compute backward branches based on actual address.&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reuse the fixups array to record the pc-dependent instructions that need to have&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; their code generation postponed until after the others.&quot;</font><font color="#000000">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#808080">|</font><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><font color="#404040">pcDependentIndex</font><font color="#000000">&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#404040">fixup</font><font color="#000000">&nbsp;</font><font color="#808080">|</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var:&nbsp;</font><font color="#000080">#abstractInstruction</font><font color="#000000">&nbsp;type:&nbsp;</font><font color="#000080">#&#39;AbstractInstruction *&#39;</font><font color="#000000">&gt;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var:&nbsp;</font><font color="#000080">#fixup</font><font color="#000000">&nbsp;type:&nbsp;</font><font color="#000080">#&#39;BytecodeFixup *&#39;</font><font color="#000000">&gt;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#000080">eventualAbsoluteAddress</font><font color="#000000">.&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">pcDependentIndex</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#800000">0</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#800000">0</font><font color="#000000">&nbsp;</font><font color="#000080">to:</font><font color="#000000">&nbsp;opcodeIndex&nbsp;</font><font color="#000080">-</font><font color="#000000">&nbsp;</font><font color="#800000">1</font><font color="#000000">&nbsp;</font><font color="#000080">do:</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:</font><font color="#000080">i</font><font color="#808080">|</font><font color="#000000">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;breakPC&nbsp;</font><font color="#000080">=</font><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><font color="#000080">ifTrue:</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">[</font><font color="#800000">self</font><font color="#000000">&nbsp;</font><font color="#000080">halt:</font><font color="#000000">&nbsp;</font><font color="#800080"><font size="0.9" face="&#39;Accuny&#39;">&#39;breakPC reached in generateInstructionsAt:&#39;</font></font><font color="#008000">]</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#800000">self</font><font color="#000000">&nbsp;</font><font color="#000080">abstractInstructionAt:</font><font color="#000000">&nbsp;</font><font color="#000080">i</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">isPCDependent</font><font color="#000000">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000080">ifTrue:</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">[</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">sizePCDependentInstructionAt:</font><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">fixup</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#800000">self</font><font color="#000000">&nbsp;</font><font color="#000080">fixupAt:</font><font color="#000000">&nbsp;</font><font color="#404040">pcDependentIndex</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">pcDependentIndex</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#404040">pcDependentIndex</font><font color="#000000">&nbsp;</font><font color="#000080">+</font><font color="#000000">&nbsp;</font><font color="#800000">1</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">fixup</font><font color="#000000">&nbsp;</font><font color="#000080">instructionIndex:</font><font color="#000000">&nbsp;</font><font color="#000080">i</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><font color="#000080">+</font><font color="#000000">&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">machineCodeSize</font><font color="#008000">]</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000080">ifFalse:</font><font color="#000000">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">[</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">address:</font><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">concretizeAt:</font><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#008000">]</font><font color="#000000">].&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#800000">0</font><font color="#000000">&nbsp;</font><font color="#000080">to:</font><font color="#000000">&nbsp;</font><font color="#404040">pcDependentIndex</font><font color="#000000">&nbsp;</font><font color="#000080">-</font><font color="#000000">&nbsp;</font><font color="#800000">1</font><font color="#000000">&nbsp;</font><font color="#000080">do:</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:</font><font color="#000080">i</font><font color="#808080">|</font><font color="#000000">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">fixup</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#800000">self</font><font color="#000000">&nbsp;</font><font color="#000080">fixupAt:</font><font color="#000000">&nbsp;</font><font color="#000080">i</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><b>:=</b><font color="#000000">&nbsp;</font><font color="#800000">self</font><font color="#000000">&nbsp;</font><font color="#000080">abstractInstructionAt:</font><font color="#000000">&nbsp;</font><font color="#404040">fixup</font><font color="#000000">&nbsp;</font><font color="#000080">instructionIndex</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;breakPC&nbsp;</font><font color="#000080">=</font><font color="#000000">&nbsp;</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><font color="#000080">ifTrue:</font><font color="#000000">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">[</font><font color="#800000">self</font><font color="#000000">&nbsp;</font><font color="#000080">halt:</font><font color="#000000">&nbsp;</font><font color="#800080"><font size="0.9" face="&#39;Accuny&#39;">&#39;breakPC reached in generateInstructionsAt:&#39;</font></font><font color="#008000">]</font><font color="#000000">.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">concretizeAt:</font><font color="#000000">&nbsp;</font><font color="#404040">abstractInstruction</font><font color="#000000">&nbsp;</font><font color="#000080">address</font><font color="#000000">].&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#800000">^</font><font color="#404040">absoluteAddress</font><font color="#000000">&nbsp;</font><font color="#000080">-</font><font color="#000000">&nbsp;</font><font color="#000080">eventualAbsoluteAddress</font></span><br>
</div><div><br></div><div>You&#39;ll notice the lack of type inferrence means I have to assign typed results to typed local variables to have the code generator be able to find the right code.</div><div><br></div><div>My problem with doing it for oops has been not wanting to add methods to Integer. &nbsp;Do you use a special type for oop or do you add methods to Integer?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<div><div></div><div class="Wj3C7c"><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Best regards,<br>
&gt;&gt; Igor Stasenko AKA sig.<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br>