<div dir="ltr">...at <a href="http://www.mirandabanda.org/files/Cog/VM/VM.r3041/">http://www.mirandabanda.org/files/Cog/VM/VM.r3041/</a>.<div><br></div><div><br></div><div>The principal changes are fixing a performance regression in the 3040 VMs, fixing some Spur bugs in primitiveClone/shallowCopy, and radically simplifying the Spur become implementation,</div>
<div>trading the elimination of lots of post-become class table scanning for adding read barriers to class hierarchy method lookup.</div><div><br></div><div><br></div><div><div>CogVM source as per VMMaker.oscog-eem.820/r3041<br>
</div><div><br></div><div>Put the handling of the cloning of cogged methods in the clone: implementations,</div><div>removing it from the primitive.  Add it to the pinning clone too.</div><div><br></div><div>Specialize the store check trampoline generation.</div>
<div>Move it down to the relevant object representations.</div><div><br></div><div>Move setting of isRemembered flag to true into SpurGenerationScavenger&gt;&gt;</div><div>remember:.  Inline possibleRootStoreInto: (given that remember: is /not/</div>
<div>inlined.  Call remember directly from the ceStoreCheckTrampoline, and</div><div>hence have remember: answer its argument.</div><div><br></div><div>Fix localization bug.  Variables in initialize methods were not considered</div>
<div>references (cuz there are excluded).  This caused VMMaker.oscog-eem.816&#39;s</div><div>extraction of zero/false vars to StackInterpreter&gt;&gt;#initialize to cause</div><div>nextPollUsecs to be localized to checkForEventsMayContextSwitch:.</div>
<div><br></div><div>Spur:</div><div>Fix bug in scanClassPostBecome:effects: with new lazy</div><div>selector following policy by... throwing it all away.</div><div><br></div><div>The read barriers on method lookup (of the methodClass association in super</div>
<div>sends, of the superclass link, of method dictionaries, method dictionary arrays,</div><div>selectors and methods is cheap.  So replace scanning classes and method</div><div>dictionaries in the class table post become with read marriewrs on methodClass,</div>
<div>superclass and method dictionary etc on lookup.</div><div><br></div><div>The read barrier on an object from which we are going to fetch state (such as a</div><div>class or method dictionary) is essentially free on modern machines because the</div>
<div>class index and the state very likely share a cache line, and the register code</div><div>for testing is so cheap compared to memory access.  Further the read barrier on</div><div>selectors is cheap because the method lookup cache is effective in reducing the</div>
<div>number of message lookups and because nil entries need no check.</div><div><br></div><div>So nuke all the followNecessaryForwardingInMethod: machinery including the</div><div>cmUsesMethodClass hack.  Nuke scanClassPostBecome:effects:.</div>
<div><br></div><div>Rip out the forwardingCount: measurement code.  It causes</div><div>bad performance regressions (due to failing inlines?)</div><div><br></div><div>Clean up, e.g. replace followNonImmediateField:ofObject:</div>
<div>uses with followObjField:ofObject:.</div><div><br></div><div>canPinObjects can be inlined.</div><div><br></div><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>