<div dir="ltr">Hi Ryan,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 14, 2015 at 7:32 PM,  <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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Ryan Macnak uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-rmacnak.1595.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-rmacnak.1595.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-rmacnak.1595<br>
Author: rmacnak<br>
Time: 14 December 2015, 7:29:18.283 pm<br>
UUID: 3aac3671-b1ff-45b9-8ed0-f3ecc5bca0b3<br>
Ancestors: VMMaker.oscog-eem.1594<br>
<br>
MIPS: Complete simulation of the Newspeak test suite! (~30 billion instructions) (Modulo Aliens, which don&#39;t work under the IA32 simulation either.)<br></blockquote><div><br></div><div>Can you say a little bit more about this?  How long did the simulation take?  What machine(s) did you run it on?  I *love* that you caught the MNU in followForwardingPointersInScheduler. I want to set this up for Squeak but never had the patience/.resources before.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Fix off-by-8 in patching I-type branches. Bug had the effect of skipping loading the cPIC address for a cPIC miss if the cPIC was created for an MNU case.<br>
<br>
Handle PushCw in storeLiteral:beforeFollowingAddress:.<br>
<br>
Add the GC&#39;s variant of rewriteInlineCacheTag:at:.<br>
<br>
Fix MNU in followForwardingPointersInScheduler.<br>
<br>
=============== Diff against VMMaker.oscog-eem.1594 ===============<br>
<br>
Item was changed:<br>
  ----- Method: CogMIPSELCompiler&gt;&gt;rewriteITypeBranchAtAddress:target: (in category &#39;inline cacheing&#39;) -----<br>
  rewriteITypeBranchAtAddress: mcpc target: newTarget<br>
+       | newDisplacement oldInstruction newInstruction |<br>
+       newDisplacement := newTarget - (mcpc + 4). &quot;Displacement is relative to delay slot.&quot;<br>
+       newDisplacement := newDisplacement &gt;&gt; 2. &quot;Displacement is in words.&quot;<br>
-       | newDisplacement oldInstruction newInstruction |<br>
-       newDisplacement := newTarget - (mcpc - 4). &quot;Displacement relative to delay slot&quot;<br>
-       newDisplacement := newDisplacement &gt;&gt; 2.<br>
<br>
        self assert: (newDisplacement between: -16r8000 and: 16r7FFF).<br>
        newDisplacement &lt; 0<br>
                ifTrue: [newDisplacement := newDisplacement + 16r10000]<br>
                ifFalse: [newDisplacement := newDisplacement].<br>
        self assert: (newDisplacement between: 0 and: 16rFFFF).<br>
<br>
        oldInstruction := objectMemory longAt: mcpc.<br>
        newInstruction := (oldInstruction bitAnd: 16rFFFF0000) bitOr: newDisplacement.<br>
<br>
        objectMemory longAt: mcpc put: newInstruction.!<br>
<br>
Item was added:<br>
+ ----- Method: CogMIPSELCompiler&gt;&gt;rewriteInlineCacheTag:at: (in category &#39;inline cacheing&#39;) -----<br>
+ rewriteInlineCacheTag: cacheTag at: callSiteReturnAddress<br>
+       &quot;Rewrite an inline cache with a new tag.  This variant is used<br>
+        by the garbage collector.&quot;<br>
+<br>
+       &quot;MoveCwR ClassReg selectorIndex/expectedClass<br>
+        Call: unlinked send stub/expectedTarget<br>
+        Push ReceiverResult &lt;-- callSiteReturnAddress&quot;<br>
+<br>
+       &quot;lui s3, selector/tagHigh<br>
+        ori s3, s3, selector/tagLow<br>
+        lui t9, stub/targetHigh<br>
+        ori t9, t9, stub/targetLow<br>
+        jalr t9<br>
+        nop (delay slot)<br>
+        ...  &lt;-- callSiteReturnAddress&quot;<br>
+<br>
+       &lt;var: #callSiteReturnAddress type: #usqInt&gt;<br>
+       &lt;var: #callTargetAddress type: #usqInt&gt;<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 24) = LUI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 20) = ORI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 16) = LUI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 12) = ORI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 8) = SPECIAL.<br>
+       self assert: (self functionAtAddress: callSiteReturnAddress - 8) = JALR.<br>
+       self assert: (objectMemory longAt: callSiteReturnAddress - 4) = self nop.<br>
+       &quot;cogit disassembleFrom: callSiteReturnAddress - 24 to: callSiteReturnAddress.&quot;<br>
+<br>
+       self literalAtAddress: callSiteReturnAddress - 20 put: cacheTag.<br>
+<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 24) = LUI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 20) = ORI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 16) = LUI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 12) = ORI.<br>
+       self assert: (self opcodeAtAddress: callSiteReturnAddress - 8) = SPECIAL.<br>
+       self assert: (self functionAtAddress: callSiteReturnAddress - 8) = JALR.<br>
+       self assert: (objectMemory longAt: callSiteReturnAddress - 4) = self nop.<br>
+       &quot;cogit disassembleFrom: callSiteReturnAddress - 24 to: callSiteReturnAddress.&quot;!<br>
<br>
Item was changed:<br>
  ----- Method: CogMIPSELCompiler&gt;&gt;storeLiteral:beforeFollowingAddress: (in category &#39;inline cacheing&#39;) -----<br>
  storeLiteral: literal beforeFollowingAddress: followingAddress<br>
        &quot;Rewrite the long constant loaded by a MoveCwR or PushCwR before the given address&quot;<br>
-       | lastOpcode lastFunction oriAddress |<br>
        self flag: #bogus. &quot;The caller ought to know what it is patching, and this should be split into separate methods with stricter checking.&quot;<br>
<br>
+       &quot;Cmp/MoveCwR<br>
+        pc-8   lui rx, uper<br>
+        pc-4   ori rx, rx, lower&quot;<br>
+       (self opcodeAtAddress: followingAddress - 4) = ORI ifTrue:<br>
+               [^self literalAtAddress: followingAddress - 4 put: literal].<br>
+<br>
+       &quot;PushCw<br>
+        pc-16  lui at, upper<br>
+        pc-12  ori at, at, lower<br>
+        pc-8   addiu sp, sp, -4<br>
+        pc-4   sw at, 0(sp)&quot;<br>
+       ((self opcodeAtAddress: followingAddress - 4) = SW and:<br>
+               [(self opcodeAtAddress: followingAddress - 8) = ADDIU]) ifTrue:<br>
+                       [^self literalAtAddress: followingAddress - 12 put: literal].<br>
+<br>
+       self unreachable.<br>
+       ^0!<br>
-       lastOpcode := self opcodeAtAddress: followingAddress - 4.<br>
-       lastFunction := self functionAtAddress: followingAddress - 4.<br>
-       oriAddress := 0.<br>
-       lastOpcode = ORI ifTrue: [oriAddress := followingAddress - 4].<br>
-       lastOpcode = ADDIU ifTrue: [oriAddress := followingAddress - 16].<br>
-       lastOpcode = SPECIAL ifTrue: [lastFunction = SUBU ifTrue: [oriAddress := followingAddress - 8]].<br>
-       self assert: oriAddress ~= 0.<br>
-       ^self literalAtAddress: oriAddress put: literal!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;followForwardingPointersInScheduler (in category &#39;object memory support&#39;) -----<br>
  followForwardingPointersInScheduler<br>
        | schedAssoc sched procLists |<br>
        schedAssoc := objectMemory splObj: SchedulerAssociation.<br>
        &quot;the GC follows pointers in the special objects array for us.&quot;<br>
        self assert: (objectMemory isForwarded: schedAssoc) not.<br>
<br>
        &quot;Make sure the active process has been followed.&quot;<br>
+       objectMemory followForwardedObjectFields: schedAssoc toDepth: 1.<br>
-       self followForwardedObjectFields: schedAssoc toDepth: 1.<br>
<br>
        sched := objectMemory fetchPointer: ValueIndex ofObject: schedAssoc.<br>
<br>
        procLists := objectMemory followObjField: ProcessListsIndex ofObject: sched.<br>
<br>
        &quot;Follow all links in the process list to ensure the lists are valid.&quot;<br>
        0 to: (objectMemory numSlotsOf: procLists) - 1 do:<br>
                [:i| | list first last next |<br>
                list := objectMemory followObjField: i ofObject: procLists.<br>
                first := objectMemory followObjField: FirstLinkIndex ofObject: list.<br>
                last := objectMemory followObjField: LastLinkIndex ofObject: list.<br>
                [first ~= last] whileTrue:<br>
                        [next := objectMemory followObjField: NextLinkIndex ofObject: first.<br>
                         first := next]]<br>
  !<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></div>