<div dir="ltr">Hi Eliot<br><div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-21 3:56 GMT+01:00 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="auto"><div>Hi Nicolas,</div><div><br>On Mar 20, 2015, at 1:32 PM, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-03-20 0:21 GMT+01:00  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1103.mcz" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1103.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-eem.1103<br>
Author: eem<br>
Time: 19 March 2015, 4:20:02.926 pm<br>
UUID: 64ddd2e1-e5f5-4ad0-b512-b1d0e32e99f7<br>
Ancestors: VMMaker.oscog-eem.1102<br>
<br>
Fix some Slang issues with ARM methods (clashing<br>
arg names).<br>
<br>
Provide an abstraction for saving &amp; restoring link reg<br>
around calls.<br>
<br>
=============== Diff against VMMaker.oscog-eem.1102 ===============<br>
<br>
Item was changed:<br>
  ----- Method: CoInterpreter&gt;&gt;ceTraceLinkedSend: (in category &#39;debug support&#39;) -----<br>
  ceTraceLinkedSend: theReceiver<br>
        | cogMethod |<br>
        &lt;api&gt;<br>
        &lt;var: #cogMethod type: #&#39;CogMethod *&#39;&gt;<br>
        cogMethod := self cCoerceSimple: (self stackTop - cogit traceLinkedSendOffset)<br>
                                                to: #&#39;CogMethod *&#39;.<br>
        self cCode: [] inSmalltalk:<br>
                [cogit checkStackDepthOnSend ifTrue:<br>
                        [self maybeCheckStackDepth: (cogMethod cmNumArgs &gt; cogit numRegArgs<br>
                                                                                        ifTrue: [cogMethod cmNumArgs + 1]<br>
                                                                                        ifFalse: [0])<br>
                                sp: stackPointer + objectMemory wordSize<br>
                                pc: (self stackValue: 1)]].<br>
        &quot;cogit recordSendTrace ifTrue: is implicit; wouldn&#39;t compile the call otherwise.&quot;<br>
        self recordTrace: (objectMemory fetchClassOf: theReceiver)<br>
                thing: cogMethod selector<br>
                source: TraceIsFromMachineCode.<br>
        cogit printOnTrace ifTrue:<br>
                [self printActivationNameFor: cogMethod methodObject<br>
                        receiver: theReceiver<br>
                        isBlock: false<br>
+                       firstTemporary: (self cCode: [nil] inSmalltalk: [0]);<br>
-                       firstTemporary: nil;<br>
                        cr].<br>
        self sendBreakpoint: cogMethod selector receiver: theReceiver!<br>
<br>
Item was changed:<br>
  ----- Method: CogARMCompiler&gt;&gt;concretizeDataOperationCqR: (in category &#39;generate machine code - concretize&#39;) -----<br>
+ concretizeDataOperationCqR: armOpcode<br>
- concretizeDataOperationCqR: opcode<br>
        &quot;Will get inlined into concretizeAt: switch.&quot;<br>
        &quot;4 == Add, 2 == Sub, Xor == 1, And == 0, Or == 12, Bic == 14&quot;<br>
        &lt;inline: true&gt;<br>
        self<br>
                rotateable8bitImmediate: (operands at: 0)<br>
                ifTrue: [:rot :immediate | | rd rn |<br>
                        rn := self concreteRegister: (operands at: 1).<br>
                        rd := opcode = CmpOpcode ifTrue: [0] ifFalse:[rn].<br>
+                       self machineCodeAt: 0 put: (self type: 1 op: armOpcode set: 1 rn: rn rd: rd shifterOperand: ((rot&gt;&gt;1)&quot;in this usage we have to halve the rot value&quot; &lt;&lt; 8 bitOr: immediate)).<br>
-                       self machineCodeAt: 0 put: (self type: 1 op: opcode set: 1 rn: rn rd: rd shifterOperand: ((rot&gt;&gt;1)&quot;in this usage we have to halve the rot value&quot; &lt;&lt; 8 bitOr: immediate)).<br>
                        ^machineCodeSize := 4]<br>
+               ifFalse: [^self concretizeDataOperationCwR: armOpcode].<br>
-               ifFalse: [^self concretizeDataOperationCwR: opcode].<br>
        !<br>
<br>
Item was changed:<br>
  ----- Method: CogARMCompiler&gt;&gt;concretizeDataOperationCwR: (in category &#39;generate machine code - concretize&#39;) -----<br>
+ concretizeDataOperationCwR: armOpcode<br>
- concretizeDataOperationCwR: opcode<br>
        &quot;Will get inlined into concretizeAt: switch.&quot;<br>
        &quot;Load the word into the RISCTempReg, then cmp R, RISCTempReg&quot;<br>
        &lt;inline: true&gt;<br>
        | constant rn rd instrOffset|<br>
        constant := operands at: 0.<br>
        rn := (self concreteRegister: (operands at: 1)).<br>
+       rd := armOpcode = CmpOpcode ifTrue: [0] ifFalse:[rn].<br>
-       rd := opcode = CmpOpcode ifTrue: [0] ifFalse:[rn].<br>
        instrOffset := self at: 0 moveCw: constant intoR: RISCTempReg.<br>
        self machineCodeAt: instrOffset<br>
+               put: (self type: 0 op: armOpcode set: 1 rn: rn rd: rd shifterOperand: RISCTempReg).<br>
-               put: (self type: 0 op: opcode set: 1 rn: rn rd: rd shifterOperand: RISCTempReg).<br>
        ^machineCodeSize := instrOffset + 4!<br>
<br>
Item was changed:<br>
  ----- Method: CogARMCompiler&gt;&gt;concretizeDataOperationRR: (in category &#39;generate machine code - concretize&#39;) -----<br>
+ concretizeDataOperationRR: armOpcode<br>
- concretizeDataOperationRR: opcode<br>
        &quot;Will get inlined into concretizeAt: switch.&quot;<br>
        &quot;Load the word into the RISCTempReg, then op R, RISCTempReg&quot;<br>
        &lt;inline: true&gt;<br>
        | rn rd srcReg |<br>
        srcReg := self concreteRegister: (operands at: 0).<br>
        rn := (self concreteRegister: (operands at: 1)).<br>
+       rd := armOpcode = CmpOpcode ifTrue: [0] ifFalse: [rn].<br>
-       rd := opcode = CmpOpcode ifTrue: [0] ifFalse: [rn].<br>
        self machineCodeAt: 0<br>
+               put: (self type: 0 op: armOpcode set: 1 rn: rn rd: rd shifterOperand: srcReg).<br>
-               put: (self type: 0 op: opcode set: 1 rn: rn rd: rd shifterOperand: srcReg).<br>
        ^machineCodeSize := 4.!<br>
<br>
Item was changed:<br>
  ----- Method: CogARMCompiler&gt;&gt;extractOffsetFromBXAt: (in category &#39;testing&#39;) -----<br>
+ extractOffsetFromBXAt: addr<br>
- extractOffsetFromBXAt: address<br>
  &quot;this should return the long call/jump target&quot;<br>
+       ^(objectMemory byteAt: addr -4)<br>
+               + ((objectMemory byteAt: addr - 8) &lt;&lt; 8)<br>
+               + ((objectMemory byteAt: addr - 12) &lt;&lt; 16)<br>
+               + ((objectMemory byteAt: addr - 16) &lt;&lt; 24)!<br>
-       ^(objectMemory byteAt: address -4)<br>
-               + ((objectMemory byteAt: address - 8) &lt;&lt; 8)<br>
-               + ((objectMemory byteAt: address - 12) &lt;&lt; 16)<br>
-               + ((objectMemory byteAt: address - 16) &lt;&lt; 24)!<br>
<br>
Item was added:<br>
+ ----- Method: CogARMCompiler&gt;&gt;saveAndRestoreLinkRegAround: (in category &#39;abi&#39;) -----<br>
+ saveAndRestoreLinkRegAround: aBlock<br>
+       &quot;If the processor&#39;s ABI includes a link register, generate instructions<br>
+        to save and restore it around aBlock, which is assumed to generate code.&quot;<br>
+       &lt;inline: true&gt;<br>
+       | inst |<br>
+       inst := cogit PushR: LinkReg.<br>
+       aBlock value.<br>
+       cogit PopR: LinkReg.<br>
+       ^inst!<br>
<br>
Item was added:<br>
+ ----- Method: CogAbstractInstruction&gt;&gt;saveAndRestoreLinkRegAround: (in category &#39;abi&#39;) -----<br>
+ saveAndRestoreLinkRegAround: aBlock<br>
+       &quot;If the processor&#39;s ABI includes a link register, generate instructions<br>
+        to save and restore it around aBlock, which is assumed to generate code.&quot;<br>
+       &lt;inline: true&gt;<br>
+       self subclassResponsibility!<br>
<br>
Item was added:<br>
+ ----- Method: CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround: (in category &#39;abi&#39;) -----<br>
+ saveAndRestoreLinkRegAround: aBlock<br>
+       &quot;If the processor&#39;s ABI includes a link register, generate instructions<br>
+        to save and restore it around aBlock, which is assumed to generate code.&quot;<br>
+       &lt;inline: true&gt;<br>
+       ^aBlock value!<br>
<br></blockquote><div><br></div><div>Hmm, the generater doesn&#39;t know how to deal with this one...<br></div><div>It tries to inline the formal parameter (block) rather than the actual block passed by the sender.<br></div></div></div></div></div></blockquote><div><br></div>Hmm... R u sure?  I tried this in a workspace I use for slang testing and saw no problem.<div><br></div></div></blockquote><div><br>Yes, I do it:<br>    VMMaker  generateSqueakCogVM. <br><br></div><div>and get the assertion failure:<br><br>CCodeGenerator(Object)&gt;&gt;assert:<br>    Receiver: a CCodeGenerator<br>    Arguments and temporary variables: <br>        aBlock:     false<br>    Receiver&#39;s instance variables: <br>        vmClass:     StackToRegisterMappingCogit<br>        structClasses:     an OrderedCollection(CogAbstractInstruction CogIA32Compiler CogB...etc...<br>        translationDict:     a Dictionary(size 111)<br>        asArgumentTranslationDict:     a Dictionary(#cCode:-&gt;#generateInlineCCodeAsArgument...etc...<br>        inlineList:     a Set(#concretizeMoveM64rRd #JumpZero: #JumpLess: #MoveXbr:R:R: #Mo...etc...<br>        constants:     a Dictionary(size 454)<br>        variables:     a Set(&#39;simStack&#39; &#39;methodOrBlockNumTemps&#39; &#39;ceTraceLinkedSendTrampolin...etc...<br>        variableDeclarations:     a Dictionary(&#39;CFramePointer&#39;-&gt;&#39;void * CFramePointer&#39; &#39;CSt...etc...<br>        scopeStack:     an OrderedCollection(a Dictionary(&#39;self_in_saveAndRestoreLinkRegAro...etc...<br>        methods:     a Dictionary(size 903)<br>        macros:     a Dictionary(#abstractInstructionAt:-&gt;&#39;(index) (&amp;abstractOpcodes[index]...etc...<br>        apiMethods:     a Dictionary(size 250)<br>        kernelReturnTypes:     a Dictionary(#byteAt:-&gt;#sqInt #byteAt:put:-&gt;#sqInt #byteAtPo...etc...<br>        currentMethod:     a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>        headerFiles:     an OrderedCollection(&#39;&quot;sq.h&quot;&#39; &#39;&lt;stddef.h&gt;&#39; &#39;&quot;sqCogStackAlignment.h...etc...<br>        globalVariableUsage:     a Dictionary(size 144)<br>        useSymbolicConstants:     true<br>        generateDeadCode:     false<br>        requiredSelectors:     a Set(#sizePCDependentInstructionAt: #genPrimitiveMultiply #...etc...<br>        logger:     a TranscriptStream<br>        suppressAsmLabels:     false<br>        asmLabelCounts:     nil<br>        pools:     an IdentitySet(CogRTLOpcodes CogCompilationConstants VMSqueakV3ObjectRep...etc...<br>        selectorTranslations:     an IdentityDictionary(#AddCq:R:-&gt;&#39;gAddCqR&#39; #AddCw:R:-&gt;&#39;gA...etc...<br>        optionsDictionary:     a Dictionary(#BytesPerWord-&gt;4 #CheckPrivacyViolations-&gt;false...etc...<br>        breakSrcInlineSelectors:     an IdentitySet()<br>        breakDestInlineSelectors:     an IdentitySet()<br>        breakOnInline:     nil<br>        vmMaker:     a CrossPlatformVMMaker<br><br>CCodeGenerator&gt;&gt;generateValueAsArgument:on:indent:<br>    Receiver: a CCodeGenerator<br>    Arguments and temporary variables: <br>        aTSendNode:     aBlock value<br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        level:     1<br>        substitution:     nil<br>        substitutionDict:     nil<br>        newLabels:     nil<br>    Receiver&#39;s instance variables: <br>        vmClass:     StackToRegisterMappingCogit<br>        structClasses:     an OrderedCollection(CogAbstractInstruction CogIA32Compiler CogB...etc...<br>        translationDict:     a Dictionary(size 111)<br>        asArgumentTranslationDict:     a Dictionary(#cCode:-&gt;#generateInlineCCodeAsArgument...etc...<br>        inlineList:     a Set(#concretizeMoveM64rRd #JumpZero: #JumpLess: #MoveXbr:R:R: #Mo...etc...<br>        constants:     a Dictionary(size 454)<br>        variables:     a Set(&#39;simStack&#39; &#39;methodOrBlockNumTemps&#39; &#39;ceTraceLinkedSendTrampolin...etc...<br>        variableDeclarations:     a Dictionary(&#39;CFramePointer&#39;-&gt;&#39;void * CFramePointer&#39; &#39;CSt...etc...<br>        scopeStack:     an OrderedCollection(a Dictionary(&#39;self_in_saveAndRestoreLinkRegAro...etc...<br>        methods:     a Dictionary(size 903)<br>        macros:     a Dictionary(#abstractInstructionAt:-&gt;&#39;(index) (&amp;abstractOpcodes[index]...etc...<br>        apiMethods:     a Dictionary(size 250)<br>        kernelReturnTypes:     a Dictionary(#byteAt:-&gt;#sqInt #byteAt:put:-&gt;#sqInt #byteAtPo...etc...<br>        currentMethod:     a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>        headerFiles:     an OrderedCollection(&#39;&quot;sq.h&quot;&#39; &#39;&lt;stddef.h&gt;&#39; &#39;&quot;sqCogStackAlignment.h...etc...<br>        globalVariableUsage:     a Dictionary(size 144)<br>        useSymbolicConstants:     true<br>        generateDeadCode:     false<br>        requiredSelectors:     a Set(#sizePCDependentInstructionAt: #genPrimitiveMultiply #...etc...<br>        logger:     a TranscriptStream<br>        suppressAsmLabels:     false<br>        asmLabelCounts:     nil<br>        pools:     an IdentitySet(CogRTLOpcodes CogCompilationConstants VMSqueakV3ObjectRep...etc...<br>        selectorTranslations:     an IdentityDictionary(#AddCq:R:-&gt;&#39;gAddCqR&#39; #AddCw:R:-&gt;&#39;gA...etc...<br>        optionsDictionary:     a Dictionary(#BytesPerWord-&gt;4 #CheckPrivacyViolations-&gt;false...etc...<br>        breakSrcInlineSelectors:     an IdentitySet()<br>        breakDestInlineSelectors:     an IdentitySet()<br>        breakOnInline:     nil<br>        vmMaker:     a CrossPlatformVMMaker<br><br>CCodeGenerator&gt;&gt;emitBuiltinConstructAsArgumentFor:on:level:<br>    Receiver: a CCodeGenerator<br>    Arguments and temporary variables: <br>        msgNode:     aBlock value<br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        level:     1<br>        action:     #generateValueAsArgument:on:indent:<br>    Receiver&#39;s instance variables: <br>        vmClass:     StackToRegisterMappingCogit<br>        structClasses:     an OrderedCollection(CogAbstractInstruction CogIA32Compiler CogB...etc...<br>        translationDict:     a Dictionary(size 111)<br>        asArgumentTranslationDict:     a Dictionary(#cCode:-&gt;#generateInlineCCodeAsArgument...etc...<br>        inlineList:     a Set(#concretizeMoveM64rRd #JumpZero: #JumpLess: #MoveXbr:R:R: #Mo...etc...<br>        constants:     a Dictionary(size 454)<br>        variables:     a Set(&#39;simStack&#39; &#39;methodOrBlockNumTemps&#39; &#39;ceTraceLinkedSendTrampolin...etc...<br>        variableDeclarations:     a Dictionary(&#39;CFramePointer&#39;-&gt;&#39;void * CFramePointer&#39; &#39;CSt...etc...<br>        scopeStack:     an OrderedCollection(a Dictionary(&#39;self_in_saveAndRestoreLinkRegAro...etc...<br>        methods:     a Dictionary(size 903)<br>        macros:     a Dictionary(#abstractInstructionAt:-&gt;&#39;(index) (&amp;abstractOpcodes[index]...etc...<br>        apiMethods:     a Dictionary(size 250)<br>        kernelReturnTypes:     a Dictionary(#byteAt:-&gt;#sqInt #byteAt:put:-&gt;#sqInt #byteAtPo...etc...<br>        currentMethod:     a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>        headerFiles:     an OrderedCollection(&#39;&quot;sq.h&quot;&#39; &#39;&lt;stddef.h&gt;&#39; &#39;&quot;sqCogStackAlignment.h...etc...<br>        globalVariableUsage:     a Dictionary(size 144)<br>        useSymbolicConstants:     true<br>        generateDeadCode:     false<br>        requiredSelectors:     a Set(#sizePCDependentInstructionAt: #genPrimitiveMultiply #...etc...<br>        logger:     a TranscriptStream<br>        suppressAsmLabels:     false<br>        asmLabelCounts:     nil<br>        pools:     an IdentitySet(CogRTLOpcodes CogCompilationConstants VMSqueakV3ObjectRep...etc...<br>        selectorTranslations:     an IdentityDictionary(#AddCq:R:-&gt;&#39;gAddCqR&#39; #AddCw:R:-&gt;&#39;gA...etc...<br>        optionsDictionary:     a Dictionary(#BytesPerWord-&gt;4 #CheckPrivacyViolations-&gt;false...etc...<br>        breakSrcInlineSelectors:     an IdentitySet()<br>        breakDestInlineSelectors:     an IdentitySet()<br>        breakOnInline:     nil<br>        vmMaker:     a CrossPlatformVMMaker<br><br>TSendNode&gt;&gt;emitCCodeAsArgumentOn:level:generator:<br>    Receiver: aBlock value<br>    Arguments and temporary variables: <br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        level:     1<br>        aCodeGen:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        comment:     nil<br>        selector:     #value<br>        receiver:     aBlock<br>        arguments:     #()<br>        isBuiltinOperator:     true<br><br>TReturnNode&gt;&gt;emitCCodeOn:level:generator:<br>    Receiver: ^aBlock value<br>    Arguments and temporary variables: <br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        level:     1<br>        aCodeGen:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        comment:     nil<br>        expression:     aBlock value<br><br>[] in TStmtListNode&gt;&gt;emitCCodeOn:prependToEnd:level:generator:<br>    Receiver: [^aBlock value]<br>    Arguments and temporary variables: <br>        aStream:     ^aBlock value<br>        aNodeOrNil:     1<br>        level:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/cogi...etc...<br>        aCodeGen:     nil<br>        s:     1<br>        idx:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        comment:     nil<br>        arguments:     #()<br>        statements:     an OrderedCollection(^aBlock value)<br><br>OrderedCollection(SequenceableCollection)&gt;&gt;withIndexDo:<br>    Receiver: an OrderedCollection(^aBlock value)<br>    Arguments and temporary variables: <br>        elementAndIndexBlock:     [closure] in TStmtListNode&gt;&gt;emitCCodeOn:prependToEnd:leve...etc...<br>        index:     1<br>        indexLimiT:     1<br>    Receiver&#39;s instance variables: <br>        array:     {^aBlock value}<br>        firstIndex:     1<br>        lastIndex:     1<br><br>TStmtListNode&gt;&gt;emitCCodeOn:prependToEnd:level:generator:<br>    Receiver: [^aBlock value]<br>    Arguments and temporary variables: <br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        aNodeOrNil:     nil<br>        level:     1<br>        aCodeGen:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        comment:     nil<br>        arguments:     #()<br>        statements:     an OrderedCollection(^aBlock value)<br><br>TStmtListNode&gt;&gt;emitCCodeOn:level:generator:<br>    Receiver: [^aBlock value]<br>    Arguments and temporary variables: <br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        level:     1<br>        aCodeGen:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        comment:     nil<br>        arguments:     #()<br>        statements:     an OrderedCollection(^aBlock value)<br><br>[] in TMethod&gt;&gt;emitCCodeOn:generator:<br>    Receiver: a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>    Arguments and temporary variables: <br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        aCodeGen:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        selector:     #saveAndRestoreLinkRegAround:<br>        returnType:     #sqInt<br>        args:     an OrderedCollection(&#39;self_in_saveAndRestoreLinkRegAround&#39; &#39;aBlock&#39;)<br>        locals:     a Set()<br>        declarations:     a Dictionary(&#39;self_in_saveAndRestoreLinkRegAround&#39;-&gt;&#39;AbstractInst...etc...<br>        primitive:     0<br>        parseTree:     [^aBlock value]<br>        labels:     a Set()<br>        writtenToGlobalVarsCache:     nil<br>        complete:     true<br>        export:     false<br>        static:     true<br>        inline:     true<br>        sharedLabel:     nil<br>        sharedCase:     nil<br>        comment:     an OrderedCollection(&#39;If the processor&#39;&#39;s ABI includes a link register...etc...<br>        definingClass:     CogIA32Compiler<br>        globalStructureBuildMethodHasFoo:     false<br>        properties:     an AdditionalMethodState (2682)<br>        extraVariableNumber:     nil<br><br>BlockClosure&gt;&gt;ensure:<br>    Receiver: [closure] in TMethod&gt;&gt;emitCCodeOn:generator:<br>    Arguments and temporary variables: <br>        aBlock:     [closure] in CCodeGenerator&gt;&gt;pushScope:while:<br>        complete:     nil<br>        returnValue:     nil<br>    Receiver&#39;s instance variables: <br>        outerContext:     TMethod&gt;&gt;emitCCodeOn:generator:<br>        startpc:     87<br>        numArgs:     0<br><br>CCodeGenerator&gt;&gt;pushScope:while:<br>    Receiver: a CCodeGenerator<br>    Arguments and temporary variables: <br>        variableToType:     a Dictionary(&#39;self_in_saveAndRestoreLinkRegAround&#39;-&gt;&#39;AbstractIn...etc...<br>        aBlock:     [closure] in TMethod&gt;&gt;emitCCodeOn:generator:<br>    Receiver&#39;s instance variables: <br>        vmClass:     StackToRegisterMappingCogit<br>        structClasses:     an OrderedCollection(CogAbstractInstruction CogIA32Compiler CogB...etc...<br>        translationDict:     a Dictionary(size 111)<br>        asArgumentTranslationDict:     a Dictionary(#cCode:-&gt;#generateInlineCCodeAsArgument...etc...<br>        inlineList:     a Set(#concretizeMoveM64rRd #JumpZero: #JumpLess: #MoveXbr:R:R: #Mo...etc...<br>        constants:     a Dictionary(size 454)<br>        variables:     a Set(&#39;simStack&#39; &#39;methodOrBlockNumTemps&#39; &#39;ceTraceLinkedSendTrampolin...etc...<br>        variableDeclarations:     a Dictionary(&#39;CFramePointer&#39;-&gt;&#39;void * CFramePointer&#39; &#39;CSt...etc...<br>        scopeStack:     an OrderedCollection(a Dictionary(&#39;self_in_saveAndRestoreLinkRegAro...etc...<br>        methods:     a Dictionary(size 903)<br>        macros:     a Dictionary(#abstractInstructionAt:-&gt;&#39;(index) (&amp;abstractOpcodes[index]...etc...<br>        apiMethods:     a Dictionary(size 250)<br>        kernelReturnTypes:     a Dictionary(#byteAt:-&gt;#sqInt #byteAt:put:-&gt;#sqInt #byteAtPo...etc...<br>        currentMethod:     a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>        headerFiles:     an OrderedCollection(&#39;&quot;sq.h&quot;&#39; &#39;&lt;stddef.h&gt;&#39; &#39;&quot;sqCogStackAlignment.h...etc...<br>        globalVariableUsage:     a Dictionary(size 144)<br>        useSymbolicConstants:     true<br>        generateDeadCode:     false<br>        requiredSelectors:     a Set(#sizePCDependentInstructionAt: #genPrimitiveMultiply #...etc...<br>        logger:     a TranscriptStream<br>        suppressAsmLabels:     false<br>        asmLabelCounts:     nil<br>        pools:     an IdentitySet(CogRTLOpcodes CogCompilationConstants VMSqueakV3ObjectRep...etc...<br>        selectorTranslations:     an IdentityDictionary(#AddCq:R:-&gt;&#39;gAddCqR&#39; #AddCw:R:-&gt;&#39;gA...etc...<br>        optionsDictionary:     a Dictionary(#BytesPerWord-&gt;4 #CheckPrivacyViolations-&gt;false...etc...<br>        breakSrcInlineSelectors:     an IdentitySet()<br>        breakDestInlineSelectors:     an IdentitySet()<br>        breakOnInline:     nil<br>        vmMaker:     a CrossPlatformVMMaker<br><br>TMethod&gt;&gt;emitCCodeOn:generator:<br>    Receiver: a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>    Arguments and temporary variables: <br>        aStream:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/co...etc...<br>        aCodeGen:     a CCodeGenerator<br>    Receiver&#39;s instance variables: <br>        selector:     #saveAndRestoreLinkRegAround:<br>        returnType:     #sqInt<br>        args:     an OrderedCollection(&#39;self_in_saveAndRestoreLinkRegAround&#39; &#39;aBlock&#39;)<br>        locals:     a Set()<br>        declarations:     a Dictionary(&#39;self_in_saveAndRestoreLinkRegAround&#39;-&gt;&#39;AbstractInst...etc...<br>        primitive:     0<br>        parseTree:     [^aBlock value]<br>        labels:     a Set()<br>        writtenToGlobalVarsCache:     nil<br>        complete:     true<br>        export:     false<br>        static:     true<br>        inline:     true<br>        sharedLabel:     nil<br>        sharedCase:     nil<br>        comment:     an OrderedCollection(&#39;If the processor&#39;&#39;s ABI includes a link register...etc...<br>        definingClass:     CogIA32Compiler<br>        globalStructureBuildMethodHasFoo:     false<br>        properties:     an AdditionalMethodState (2682)<br>        extraVariableNumber:     nil<br><br>[] in [] in CCodeGenerator&gt;&gt;emitCMethods:on:<br>    Receiver: a CCodeGenerator<br>    Arguments and temporary variables: <br>&lt;&lt;error during printing&gt;<br>    Receiver&#39;s instance variables: <br>        vmClass:     StackToRegisterMappingCogit<br>        structClasses:     an OrderedCollection(CogAbstractInstruction CogIA32Compiler CogB...etc...<br>        translationDict:     a Dictionary(size 111)<br>        asArgumentTranslationDict:     a Dictionary(#cCode:-&gt;#generateInlineCCodeAsArgument...etc...<br>        inlineList:     a Set(#concretizeMoveM64rRd #JumpZero: #JumpLess: #MoveXbr:R:R: #Mo...etc...<br>        constants:     a Dictionary(size 454)<br>        variables:     a Set(&#39;simStack&#39; &#39;methodOrBlockNumTemps&#39; &#39;ceTraceLinkedSendTrampolin...etc...<br>        variableDeclarations:     a Dictionary(&#39;CFramePointer&#39;-&gt;&#39;void * CFramePointer&#39; &#39;CSt...etc...<br>        scopeStack:     an OrderedCollection(a Dictionary(&#39;self_in_saveAndRestoreLinkRegAro...etc...<br>        methods:     a Dictionary(size 903)<br>        macros:     a Dictionary(#abstractInstructionAt:-&gt;&#39;(index) (&amp;abstractOpcodes[index]...etc...<br>        apiMethods:     a Dictionary(size 250)<br>        kernelReturnTypes:     a Dictionary(#byteAt:-&gt;#sqInt #byteAt:put:-&gt;#sqInt #byteAtPo...etc...<br>        currentMethod:     a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>        headerFiles:     an OrderedCollection(&#39;&quot;sq.h&quot;&#39; &#39;&lt;stddef.h&gt;&#39; &#39;&quot;sqCogStackAlignment.h...etc...<br>        globalVariableUsage:     a Dictionary(size 144)<br>        useSymbolicConstants:     true<br>        generateDeadCode:     false<br>        requiredSelectors:     a Set(#sizePCDependentInstructionAt: #genPrimitiveMultiply #...etc...<br>        logger:     a TranscriptStream<br>        suppressAsmLabels:     false<br>        asmLabelCounts:     nil<br>        pools:     an IdentitySet(CogRTLOpcodes CogCompilationConstants VMSqueakV3ObjectRep...etc...<br>        selectorTranslations:     an IdentityDictionary(#AddCq:R:-&gt;&#39;gAddCqR&#39; #AddCw:R:-&gt;&#39;gA...etc...<br>        optionsDictionary:     a Dictionary(#BytesPerWord-&gt;4 #CheckPrivacyViolations-&gt;false...etc...<br>        breakSrcInlineSelectors:     an IdentitySet()<br>        breakDestInlineSelectors:     an IdentitySet()<br>        breakOnInline:     nil<br>        vmMaker:     a CrossPlatformVMMaker<br><br>SortedCollection(SequenceableCollection)&gt;&gt;withIndexDo:<br>    Receiver: a SortedCollection(a TMethod (CogAbstractInstruction&gt;&gt;abstractRegisterForConcreteRegister:...etc...<br>    Arguments and temporary variables: <br>        elementAndIndexBlock:     [closure] in [] in CCodeGenerator&gt;&gt;emitCMethods:on:<br>        index:     253<br>        indexLimiT:     903<br>    Receiver&#39;s instance variables: <br>        array:     {a TMethod (CogAbstractInstruction&gt;&gt;abstractRegisterForConcreteRegister:...etc...<br>        firstIndex:     1<br>        lastIndex:     903<br>        sortBlock:     [closure] in CCodeGenerator&gt;&gt;sortMethods:<br><br>SortedCollection(SequenceableCollection)&gt;&gt;doWithIndex:<br>    Receiver: a SortedCollection(a TMethod (CogAbstractInstruction&gt;&gt;abstractRegisterForConcreteRegister:...etc...<br>    Arguments and temporary variables: <br>        elementAndIndexBlock:     [closure] in [] in CCodeGenerator&gt;&gt;emitCMethods:on:<br>    Receiver&#39;s instance variables: <br>        array:     {a TMethod (CogAbstractInstruction&gt;&gt;abstractRegisterForConcreteRegister:...etc...<br>        firstIndex:     1<br>        lastIndex:     903<br>        sortBlock:     [closure] in CCodeGenerator&gt;&gt;sortMethods:<br><br>[] in CCodeGenerator&gt;&gt;emitCMethods:on:<br>    Receiver: a CCodeGenerator<br>    Arguments and temporary variables: <br>        methodList:     [closure] in SystemProgressMorph&gt;&gt;position:label:min:max:<br>        aStream:     a SortedCollection(a TMethod (CogAbstractInstruction&gt;&gt;abstractRegister...etc...<br>        bar:     MultiByteFileStream: &#39;/Users/nicolas/Smalltalk/Squeak/vm_cog/src/vm/cogit....etc...<br>    Receiver&#39;s instance variables: <br>        vmClass:     StackToRegisterMappingCogit<br>        structClasses:     an OrderedCollection(CogAbstractInstruction CogIA32Compiler CogB...etc...<br>        translationDict:     a Dictionary(size 111)<br>        asArgumentTranslationDict:     a Dictionary(#cCode:-&gt;#generateInlineCCodeAsArgument...etc...<br>        inlineList:     a Set(#concretizeMoveM64rRd #JumpZero: #JumpLess: #MoveXbr:R:R: #Mo...etc...<br>        constants:     a Dictionary(size 454)<br>        variables:     a Set(&#39;simStack&#39; &#39;methodOrBlockNumTemps&#39; &#39;ceTraceLinkedSendTrampolin...etc...<br>        variableDeclarations:     a Dictionary(&#39;CFramePointer&#39;-&gt;&#39;void * CFramePointer&#39; &#39;CSt...etc...<br>        scopeStack:     an OrderedCollection(a Dictionary(&#39;self_in_saveAndRestoreLinkRegAro...etc...<br>        methods:     a Dictionary(size 903)<br>        macros:     a Dictionary(#abstractInstructionAt:-&gt;&#39;(index) (&amp;abstractOpcodes[index]...etc...<br>        apiMethods:     a Dictionary(size 250)<br>        kernelReturnTypes:     a Dictionary(#byteAt:-&gt;#sqInt #byteAt:put:-&gt;#sqInt #byteAtPo...etc...<br>        currentMethod:     a TMethod (CogIA32Compiler&gt;&gt;saveAndRestoreLinkRegAround:)<br>        headerFiles:     an OrderedCollection(&#39;&quot;sq.h&quot;&#39; &#39;&lt;stddef.h&gt;&#39; &#39;&quot;sqCogStackAlignment.h...etc...<br>        globalVariableUsage:     a Dictionary(size 144)<br>        useSymbolicConstants:     true<br>        generateDeadCode:     false<br>        requiredSelectors:     a Set(#sizePCDependentInstructionAt: #genPrimitiveMultiply #...etc...<br>        logger:     a TranscriptStream<br>        suppressAsmLabels:     false<br>        asmLabelCounts:     nil<br>        pools:     an IdentitySet(CogRTLOpcodes CogCompilationConstants VMSqueakV3ObjectRep...etc...<br>        selectorTranslations:     an IdentityDictionary(#AddCq:R:-&gt;&#39;gAddCqR&#39; #AddCw:R:-&gt;&#39;gA...etc...<br>        optionsDictionary:     a Dictionary(#BytesPerWord-&gt;4 #CheckPrivacyViolations-&gt;false...etc...<br>        breakSrcInlineSelectors:     an IdentitySet()<br>        breakDestInlineSelectors:     an IdentitySet()<br>        breakOnInline:     nil<br>        vmMaker:     a CrossPlatformVMMaker<br><br>[] in [] in MorphicUIManager&gt;&gt;displayProgress:at:from:to:during:<br>    Receiver: a MorphicUIManager<br>    Arguments and temporary variables: <br>&lt;&lt;error during printing&gt;<br>    Receiver&#39;s instance variables: <br>        toolBuilder:     nil<br><br>BlockClosure&gt;&gt;on:do:<br>    Receiver: [closure] in [] in MorphicUIManager&gt;&gt;displayProgress:at:from:to:during:<br>    Arguments and temporary variables: <br>        exception:     ProgressNotification<br>        handlerAction:     [closure] in [] in MorphicUIManager&gt;&gt;displayProgress:at:from:to:...etc...<br>        handlerActive:     true<br>    Receiver&#39;s instance variables: <br>        outerContext:     [] in MorphicUIManager&gt;&gt;displayProgress:at:from:to:during:<br>        startpc:     86<br>        numArgs:     0<br><br><br>--- The full stack ---<br>CCodeGenerator(Object)&gt;&gt;assert:<br>CCodeGenerator&gt;&gt;generateValueAsArgument:on:indent:<br>CCodeGenerator&gt;&gt;emitBuiltinConstructAsArgumentFor:on:level:<br>TSendNode&gt;&gt;emitCCodeAsArgumentOn:level:generator:<br>TReturnNode&gt;&gt;emitCCodeOn:level:generator:<br>[] in TStmtListNode&gt;&gt;emitCCodeOn:prependToEnd:level:generator:<br>OrderedCollection(SequenceableCollection)&gt;&gt;withIndexDo:<br>TStmtListNode&gt;&gt;emitCCodeOn:prependToEnd:level:generator:<br>TStmtListNode&gt;&gt;emitCCodeOn:level:generator:<br>[] in TMethod&gt;&gt;emitCCodeOn:generator:<br>BlockClosure&gt;&gt;ensure:<br>CCodeGenerator&gt;&gt;pushScope:while:<br>TMethod&gt;&gt;emitCCodeOn:generator:<br>[] in [] in CCodeGenerator&gt;&gt;emitCMethods:on:<br>SortedCollection(SequenceableCollection)&gt;&gt;withIndexDo:<br>SortedCollection(SequenceableCollection)&gt;&gt;doWithIndex:<br>[] in CCodeGenerator&gt;&gt;emitCMethods:on:<br>[] in [] in MorphicUIManager&gt;&gt;displayProgress:at:from:to:during:<br>BlockClosure&gt;&gt;on:do:<br> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>[] in MorphicUIManager&gt;&gt;displayProgress:at:from:to:during:<br>BlockClosure&gt;&gt;ensure:<br>MorphicUIManager&gt;&gt;displayProgress:at:from:to:during:<br>ProgressInitiationException&gt;&gt;defaultResumeValue<br>ProgressInitiationException(Exception)&gt;&gt;resume<br>ProgressInitiationException&gt;&gt;defaultAction<br>UndefinedObject&gt;&gt;handleSignal:<br>MethodContext(ContextPart)&gt;&gt;handleSignal:<br>MethodContext(ContextPart)&gt;&gt;handleSignal:<br>ProgressInitiationException(Exception)&gt;&gt;signal<br>ProgressInitiationException&gt;&gt;display:at:from:to:during:<br>ProgressInitiationException class&gt;&gt;display:at:from:to:during:<br>ByteString(String)&gt;&gt;displayProgressAt:from:to:during:<br>CCodeGenerator&gt;&gt;emitCMethods:on:<br>CCodeGenerator&gt;&gt;emitCCodeOn:doInlining:doAssertions:<br>CCodeGenerator&gt;&gt;storeCodeOnFile:doInlining:doAssertions:<br>CCodeGenerator&gt;&gt;storeCodeOnFile:doInlining:<br>CrossPlatformVMMaker(VMMaker)&gt;&gt;generateCogitFile<br>CrossPlatformVMMaker(VMMaker)&gt;&gt;generateMainVM<br>CrossPlatformVMMaker(VMMaker)&gt;&gt;generateEntire<br>VMMaker class&gt;&gt;generate:and:with:to:platformDir:including:<br>VMMaker class&gt;&gt;generateSqueakCogVMWithInterpreterClass:options:<br>VMMaker class&gt;&gt;generateSqueakCogVM<br>UndefinedObject&gt;&gt;DoIt<br>Compiler&gt;&gt;evaluateCue:ifFail:<br>Compiler&gt;&gt;evaluateCue:ifFail:logged:<br>Compiler&gt;&gt;evaluate:in:to:notifying:ifFail:logged:<br>[] in SmalltalkEditor(TextEditor)&gt;&gt;evaluateSelectionAndDo:<br>BlockClosure&gt;&gt;on:do:<br>SmalltalkEditor(TextEditor)&gt;&gt;evaluateSelectionAndDo:<br>SmalltalkEditor(TextEditor)&gt;&gt;evaluateSelection<br>SmalltalkEditor(TextEditor)&gt;&gt;doIt<br>SmalltalkEditor(TextEditor)&gt;&gt;doIt:<br>SmalltalkEditor(TextEditor)&gt;&gt;dispatchOnKeyboardEvent:<br>SmalltalkEditor(TextEditor)&gt;&gt;keyStroke:<br>[] in [] in TextMorphForEditView(TextMorph)&gt;&gt;keyStroke:<br>TextMorphForEditView(TextMorph)&gt;&gt;handleInteraction:fromEvent:<br>TextMorphForEditView&gt;&gt;handleInteraction:fromEvent:<br>[] in TextMorphForEditView(TextMorph)&gt;&gt;keyStroke:<br>StandardToolSet class&gt;&gt;codeCompletionAround:textMorph:keyStroke:<br>ToolSet class&gt;&gt;codeCompletionAround:textMorph:keyStroke:<br>TextMorphForEditView(TextMorph)&gt;&gt;keyStroke:<br>-- and more not shown --<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Nicolas<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Item was changed:<br>
  ----- Method: Cogit&gt;&gt;compileEntry (in category &#39;compile abstract instructions&#39;) -----<br>
  compileEntry<br>
        &quot;The entry code to a method checks that the class of the current receiver matches<br>
         that in the inline cache.  Other non-obvious elements are that its alignment must be<br>
         different from the alignment of the noCheckEntry so that the method map machinery<br>
         can distinguish normal and super sends (super sends bind to the noCheckEntry).<br>
         In Newspeak we also need to distinguish dynSuperSends from normal and super<br>
         and so on Nespeak, bind the dynSuperEntry to the preceeding nop (on x86 there<br>
         happens to be one anyway).&quot;<br>
<br>
        self cppIf: NewspeakVM ifTrue:<br>
                [self Nop. &quot;1st nop differentiates dynSuperEntry from no-check entry if using nextMethod&quot;<br>
                 dynSuperEntry := self Nop].<br>
        entry := objectRepresentation genGetInlineCacheClassTagFrom: ReceiverResultReg into: TempReg forEntry: true.<br>
        self CmpR: ClassReg R: TempReg.<br>
        self JumpNonZero: sendMiss.<br>
        noCheckEntry := self Label.<br>
        self compileSendTrace ifTrue:<br>
+               [backEnd saveAndRestoreLinkRegAround:<br>
+                       [self CallRT: ceTraceLinkedSendTrampoline]]!<br>
-               [backEnd hasLinkRegister ifTrue:<br>
-                       [self PushR: LinkReg].<br>
-                self CallRT: ceTraceLinkedSendTrampoline.<br>
-                backEnd hasLinkRegister ifTrue:<br>
-                       [self PopR: LinkReg]]!<br>
<br>
Item was changed:<br>
  ----- Method: StackToRegisterMappingCogit&gt;&gt;genFramelessStorePop:ReceiverVariable: (in category &#39;bytecode generators&#39;) -----<br>
  genFramelessStorePop: popBoolean ReceiverVariable: slotIndex<br>
        &lt;inline: false&gt;<br>
        | topReg valueReg constVal |<br>
        self assert: needsFrame not.<br>
        self ssFlushUpThroughReceiverVariable: slotIndex.<br>
        &quot;Avoid store check for immediate values&quot;<br>
        constVal := self ssTop maybeConstant.<br>
        (self ssTop type = SSConstant<br>
         and: [(objectRepresentation shouldAnnotateObjectReference: constVal) not]) ifTrue:<br>
                [self ensureReceiverResultRegContainsSelf.<br>
                 self ssStorePop: popBoolean toPreferredReg: TempReg.<br>
                 traceStores &gt; 0 ifTrue:<br>
+                       [backEnd saveAndRestoreLinkRegAround:<br>
+                               [self CallRT: ceTraceStoreTrampoline]].<br>
-                       [self CallRT: ceTraceStoreTrampoline].<br>
                 ^objectRepresentation<br>
                        genStoreImmediateInSourceReg: TempReg<br>
                        slotIndex: slotIndex<br>
                        destReg: ReceiverResultReg].<br>
        (topReg := self ssTop registerOrNil) isNil ifTrue:<br>
                [topReg := ClassReg].<br>
        valueReg := self ssStorePop: popBoolean toPreferredReg: topReg.<br>
        &quot;Note that ReceiverResultReg remains live after ceStoreCheckTrampoline.&quot;<br>
        self ensureReceiverResultRegContainsSelf.<br>
         traceStores &gt; 0 ifTrue:<br>
                [self MoveR: valueReg R: TempReg.<br>
+                backEnd saveAndRestoreLinkRegAround:<br>
+                       [self CallRT: ceTraceStoreTrampoline]].<br>
-                self CallRT: ceTraceStoreTrampoline].<br>
        ^objectRepresentation<br>
                genStoreSourceReg: valueReg<br>
                slotIndex: slotIndex<br>
                destReg: ReceiverResultReg<br>
                scratchReg: TempReg!<br>
<br>
</blockquote></div><br></div></div>
</div></blockquote></div></div><br></blockquote></div><br></div></div></div>