<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>>halftoneAt: (in category 'memory access') -----</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'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. "<i>Makes simulation faster by creating fewer stack pages.</i>"</div><div><span class="" style="white-space:pre">        </span>vm openOn: '/Users/eliot/Cog/spurreader.image'. "<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'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>"</div><div><span class="" style="white-space:pre">        </span>vm instVarNamed: 'assertVEPAES' put: false. "<i>This makes the simulation faster by turning off some expensive asserts</i>"</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 "This exception handler i<i>gnores some halts and confirmers occurring during simulation</i>"</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 = 'clear transcript?'</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'm about to commit a merge. I'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't understand how RSqueak uses primitive simulations, or why, if it does, we can't use a different subclass to isolate RSqueak and the VMSimulator from each other. This treading on each other'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'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"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></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>>simulatePrimitive:args: (in category '*VMMaker-Interpreter') -----<br>
simulatePrimitive: aString args: args<br>
"simulate primitives in RSqueak"<br>
aString = 'primitiveCopyBits'<br>
+ ifTrue: [<br>
+ args size = 1<br>
+ ifTrue: [^ self copyBitsSimulated: (args at: 1)]<br>
+ ifFalse: [^ self copyBitsSimulated]].<br>
- ifTrue: [^ self copyBitsSimulated].<br>
aString = 'primitiveWarpBits'<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>>loadColorMap (in category 'interpreter interface') -----<br>
loadColorMap<br>
"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."<br>
| cmSize oldStyle oop cmOop |<br>
<inline: true><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. "even if identity or somesuch - may be cleared later"<br>
oldStyle := false.<br>
(interpreterProxy isWords: cmOop) ifTrue:[<br>
"This is an old-style color map (indexed only, with implicit RGBA conversion)"<br>
cmSize := interpreterProxy slotSizeOf: cmOop.<br>
cmLookupTable := interpreterProxy firstIndexableField: cmOop.<br>
oldStyle := true.<br>
] ifFalse: [<br>
"A new-style color map (fully qualified)"<br>
((interpreterProxy isPointers: cmOop)<br>
and:[(interpreterProxy slotSizeOf: cmOop) >= 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: '' 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 "needs implicit conversion"<br>
ifTrue:[ self setupColorMasks].<br>
"Check if colorMap is just identity mapping for RGBA parts"<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>>halftoneAt: (in category 'memory access') -----<br>
+ halftoneAt: idx<br>
+<br>
+ ^ (halftoneBase + (idx \\ halftoneHeight * 4)) long32At: 0!<br>
<br>
Item was added:<br>
+ ----- Method: InterpreterProxy>>isNonImmediate: (in category 'testing') -----<br>
+ isNonImmediate: anObject<br>
+<br>
+ ^ (self isImmediate: anObject) not!<br>
<br>
Item was changed:<br>
----- Method: InterpreterProxy>>majorVersion (in category 'other') -----<br>
majorVersion<br>
+ ^ 1!<br>
- self notYetImplemented!<br>
<br>
Item was changed:<br>
----- Method: InterpreterProxy>>minorVersion (in category 'other') -----<br>
minorVersion<br>
+ ^ 8!<br>
- self notYetImplemented!<br>
<br>
Item was changed:<br>
Object subclass: #TMethod<br>
instanceVariableNames: 'args comment complete declarations definingClass export extraVariableNumber globalStructureBuildMethodHasFoo inline labels locals parseTree primitive properties returnType selector sharedCase sharedLabel static writtenToGlobalVarsCache functionAttributes'<br>
classVariableNames: 'CaseStatements'<br>
poolDictionaries: ''<br>
category: 'VMMaker-Translation to C'!<br>
+<br>
+ !TMethod commentStamp: 'dtl 9/15/2008 09:06' 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: 'comment'<br>
classVariableNames: ''<br>
poolDictionaries: ''<br>
category: 'VMMaker-Translation to C'!<br>
+<br>
+ !TParseNode commentStamp: 'dtl 9/15/2008 09:05' 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>>oopForPointer: (in category 'memory access') -----<br>
oopForPointer: pointerOrSurrogate<br>
"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."<br>
<doNotGenerate><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>