<div dir="ltr">Hi Tim,<div><br></div><div>    alas this:</div><div><br></div><div><span style="color:rgb(0,0,0);font-size:12.8px">+ ----- Method: BitBltSimulator&gt;&gt;halftoneAt: (in category &#39;memory access&#39;) -----</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">+ halftoneAt: idx</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">+</span><br style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">+       ^ (halftoneBase + (idx \\ halftoneHeight * 4)) long32At: 0!</span><br></div><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12.8px">breaks the VM simulator, my main development environment for the VM.  I know you need to progress but can I ask you to test your changes against some valid simulation before committing?  Here&#39;s an expression that should run the standard VM simulator and given a suitable image should run without problems:</span></div><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div><div><div><span class="" style="white-space:pre">        </span>| vm om |<br></div><div><span class="" style="white-space:pre">        </span>vm := StackInterpreterSimulator newWithOptions: #(#ObjectMemory #Spur32BitMemoryManager ).</div><div><span class="" style="white-space:pre">        </span>om := vm objectMemory.</div><div><span class="" style="white-space:pre">        </span>vm desiredNumStackPages: 8. &quot;<i>Makes simulation faster by creating fewer stack pages.</i>&quot;</div><div><span class="" style="white-space:pre">        </span>vm openOn: &#39;/Users/eliot/Cog/spurreader.image&#39;. &quot;<i>Choose any image but if you use one created by <a href="http://www.squeakvm.org/svn/squeak/branches/Cog/image/buildspurtrunkreaderimage.sh">http://www.squeakvm.org/svn/squeak/branches/Cog/image/buildspurtrunkreaderimage.sh</a> you&#39;ll be able to interact with it throguh a little dialog box that reads chunk format expressions, simulating the reader in the image that reads chunk expressions from stdin.</i>&quot;</div><div><span class="" style="white-space:pre">        </span>vm instVarNamed: &#39;assertVEPAES&#39; put: false. &quot;<i>This makes the simulation faster by turning off some expensive asserts</i>&quot;</div><div><span class="" style="white-space:pre">        </span>^ [vm openAsMorph; halt; run]</div><div><span class="" style="white-space:pre">                </span>on: Halt , ProvideAnswerNotification &quot;This exception handler i<i>gnores some halts and confirmers occurring during simulation</i>&quot;</div><div><span class="" style="white-space:pre">                </span>do: [:ex | </div><div><span class="" style="white-space:pre">                        </span>ex messageText == #primitiveExecuteMethodArgsArray</div><div><span class="" style="white-space:pre">                                </span>ifTrue: [ex resume].</div><div><span class="" style="white-space:pre">                        </span>ex messageText = &#39;clear transcript?&#39;</div><div><span class="" style="white-space:pre">                                </span>ifTrue: [ex resume: false].</div><div><span class="" style="white-space:pre">                        </span>ex pass]</div></div><div><br></div><div>Thanks!  I&#39;m about to commit a merge.  I&#39;ve no idea whether my change, which is:</div><div><br></div><div><div>halftoneAt: idx</div><div><br></div><div><span class="" style="white-space:pre">        </span>^self</div><div><span class="" style="white-space:pre">                </span>cCode: [(halftoneBase + (idx \\ halftoneHeight * 4)) long32At: 0]</div><div><span class="" style="white-space:pre">                </span>inSmalltalk: [self long32At: halftoneBase + (idx \\ halftoneHeight * 4)]</div></div><div><br></div><div>will break RSqueak.  Apologies if it does.  Perhaps we can fund time to discuss the differences.  I still don&#39;t understand how RSqueak uses primitive simulations, or why, if it does, we can&#39;t use a different subclass to isolate RSqueak and the VMSimulator from each other.  This treading on each other&#39;s toes is getting painful ;-).</div><div><br></div><div>For example if you used a consistent naming such as RSqueakFooSimulator and simply copied all the relevant simulation-specific plugin subclasses we would avoid treading on each other&#39;s toes and the system would be easier to understand.</div><div><br></div><div>HTH</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 11, 2016 at 12:56 AM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Tim Felgentreff uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1677.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1677.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-tfel.1677<br>
Author: tfel<br>
Time: 11 February 2016, 9:48:04.961 am<br>
UUID: e845ffd7-66b9-594f-b02c-350f015e9cbf<br>
Ancestors: VMMaker.oscog-EstebanLorenzano.1676<br>
<br>
Fix BitBltSimulation (for RSqueak on Spur)<br>
<br>
=============== Diff against VMMaker.oscog-EstebanLorenzano.1676 ===============<br>
<br>
Item was changed:<br>
  ----- Method: BitBlt&gt;&gt;simulatePrimitive:args: (in category &#39;*VMMaker-Interpreter&#39;) -----<br>
  simulatePrimitive: aString args: args<br>
        &quot;simulate primitives in RSqueak&quot;<br>
        aString = &#39;primitiveCopyBits&#39;<br>
+               ifTrue: [<br>
+                       args size = 1<br>
+                               ifTrue: [^ self copyBitsSimulated: (args at: 1)]<br>
+                               ifFalse: [^ self copyBitsSimulated]].<br>
-               ifTrue: [^ self copyBitsSimulated].<br>
        aString = &#39;primitiveWarpBits&#39;<br>
                ifTrue: [^ self<br>
                                warpBitsSimulated: (args at: 1)<br>
                                sourceMap: (args at: 2)].<br>
        ^ InterpreterProxy new primitiveFailFor: 255<br>
  !<br>
<br>
Item was changed:<br>
  ----- Method: BitBltSimulation&gt;&gt;loadColorMap (in category &#39;interpreter interface&#39;) -----<br>
  loadColorMap<br>
        &quot;ColorMap, if not nil, must be longWords, and<br>
        2^N long, where N = sourceDepth for 1, 2, 4, 8 bits,<br>
        or N = 9, 12, or 15 (3, 4, 5 bits per color) for 16 or 32 bits.&quot;<br>
        | cmSize oldStyle oop cmOop |<br>
        &lt;inline: true&gt;<br>
        cmFlags := cmMask := cmBitsPerColor := 0.<br>
        cmShiftTable := nil.<br>
        cmMaskTable := nil.<br>
        cmLookupTable := nil.<br>
        cmOop := interpreterProxy fetchPointer: BBColorMapIndex ofObject: bitBltOop.<br>
        cmOop = interpreterProxy nilObject ifTrue:[^true].<br>
        cmFlags := ColorMapPresent. &quot;even if identity or somesuch - may be cleared later&quot;<br>
        oldStyle := false.<br>
        (interpreterProxy isWords: cmOop) ifTrue:[<br>
                &quot;This is an old-style color map (indexed only, with implicit RGBA conversion)&quot;<br>
                cmSize := interpreterProxy slotSizeOf: cmOop.<br>
                cmLookupTable := interpreterProxy firstIndexableField: cmOop.<br>
                oldStyle := true.<br>
        ] ifFalse: [<br>
                &quot;A new-style color map (fully qualified)&quot;<br>
                ((interpreterProxy isPointers: cmOop)<br>
                        and:[(interpreterProxy slotSizeOf: cmOop) &gt;= 3]) ifFalse:[^false].<br>
                cmShiftTable := self loadColorMapShiftOrMaskFrom:<br>
                        (interpreterProxy fetchPointer: 0 ofObject: cmOop).<br>
                cmMaskTable := self loadColorMapShiftOrMaskFrom:<br>
                        (interpreterProxy fetchPointer: 1 ofObject: cmOop).<br>
                oop := interpreterProxy fetchPointer: 2 ofObject: cmOop.<br>
                oop = interpreterProxy nilObject<br>
                        ifTrue:[cmSize := 0]<br>
                        ifFalse:[(interpreterProxy isWords: oop) ifFalse:[^false].<br>
                                        cmSize := (interpreterProxy slotSizeOf: oop).<br>
                                        cmLookupTable := interpreterProxy firstIndexableField: oop].<br>
                cmFlags := cmFlags bitOr: ColorMapNewStyle.<br>
                self cCode: &#39;&#39; inSmalltalk:<br>
+                       [].<br>
-                       [self assert: cmShiftTable unitSize = 4.<br>
-                        self assert: cmMaskTable unitSize = 4.<br>
-                        self assert: cmLookupTable unitSize = 4].<br>
        ].<br>
        (cmSize bitAnd: cmSize - 1) = 0 ifFalse:[^false].<br>
        cmMask := cmSize - 1.<br>
        cmBitsPerColor := 0.<br>
        cmSize = 512 ifTrue: [cmBitsPerColor := 3].<br>
        cmSize = 4096 ifTrue: [cmBitsPerColor := 4].<br>
        cmSize = 32768 ifTrue: [cmBitsPerColor := 5].<br>
        cmSize = 0<br>
                ifTrue:[cmLookupTable := nil. cmMask := 0]<br>
                ifFalse:[cmFlags := cmFlags bitOr: ColorMapIndexedPart].<br>
        oldStyle &quot;needs implicit conversion&quot;<br>
                ifTrue:[        self setupColorMasks].<br>
        &quot;Check if colorMap is just identity mapping for RGBA parts&quot;<br>
        (self isIdentityMap: cmShiftTable with: cmMaskTable)<br>
                ifTrue:[ cmMaskTable := nil. cmShiftTable := nil ]<br>
                ifFalse:[ cmFlags := cmFlags bitOr: ColorMapFixedPart].<br>
        ^true!<br>
<br>
Item was added:<br>
+ ----- Method: BitBltSimulator&gt;&gt;halftoneAt: (in category &#39;memory access&#39;) -----<br>
+ halftoneAt: idx<br>
+<br>
+       ^ (halftoneBase + (idx \\ halftoneHeight * 4)) long32At: 0!<br>
<br>
Item was added:<br>
+ ----- Method: InterpreterProxy&gt;&gt;isNonImmediate: (in category &#39;testing&#39;) -----<br>
+ isNonImmediate: anObject<br>
+<br>
+       ^ (self isImmediate: anObject) not!<br>
<br>
Item was changed:<br>
  ----- Method: InterpreterProxy&gt;&gt;majorVersion (in category &#39;other&#39;) -----<br>
  majorVersion<br>
+       ^ 1!<br>
-       self notYetImplemented!<br>
<br>
Item was changed:<br>
  ----- Method: InterpreterProxy&gt;&gt;minorVersion (in category &#39;other&#39;) -----<br>
  minorVersion<br>
+       ^ 8!<br>
-       self notYetImplemented!<br>
<br>
Item was changed:<br>
  Object subclass: #TMethod<br>
        instanceVariableNames: &#39;args comment complete declarations definingClass export extraVariableNumber globalStructureBuildMethodHasFoo inline labels locals parseTree primitive properties returnType selector sharedCase sharedLabel static writtenToGlobalVarsCache functionAttributes&#39;<br>
        classVariableNames: &#39;CaseStatements&#39;<br>
        poolDictionaries: &#39;&#39;<br>
        category: &#39;VMMaker-Translation to C&#39;!<br>
+<br>
+ !TMethod commentStamp: &#39;dtl 9/15/2008 09:06&#39; prior: 0!<br>
+ A TMethod is a translation method, representing a MethodNode that is to be translated to C source. It has a parseTree of translation nodes that mirrors the parse tree of the corresponding Smalltalk method.!<br>
<br>
Item was changed:<br>
  Object subclass: #TParseNode<br>
        instanceVariableNames: &#39;comment&#39;<br>
        classVariableNames: &#39;&#39;<br>
        poolDictionaries: &#39;&#39;<br>
        category: &#39;VMMaker-Translation to C&#39;!<br>
+<br>
+ !TParseNode commentStamp: &#39;dtl 9/15/2008 09:05&#39; prior: 0!<br>
+ A TParseNode is node in the parse tree of a TMethod. Subclasses correspond to different types of nodes in a method parse tree. The tree of translation parse nodes mirrors the parse tree of a Smalltalk method, and is used for translating a Smalltalk method to C source.!<br>
<br>
Item was changed:<br>
  ----- Method: VMClass&gt;&gt;oopForPointer: (in category &#39;memory access&#39;) -----<br>
  oopForPointer: pointerOrSurrogate<br>
        &quot;This gets implemented by Macros in C, where its types will also be checked.<br>
         oop is the width of a machine word, and pointer is a raw address.&quot;<br>
        &lt;doNotGenerate&gt;<br>
+       ^pointerOrSurrogate!<br>
-       ^pointerOrSurrogate asInteger!<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>