<div dir="ltr">I&#39;ve just realized in the commit I forgot to revert the cogSpur VM configuration. It is now compiled with both SqueakV3PlusClosures and SistaV1 bytecode set, instead of only V3PlusClosures. Everything is backward compatible.<div><br><div>Tell me if I should revert that in the next commit.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 11:17 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>
ClementBera uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1920.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>VMMaker/VMMaker.oscog-cb.1920.<wbr>mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-cb.1920<br>
Author: cb<br>
Time: 29 August 2016, 11:17:00.977074 am<br>
UUID: 060760b1-6719-4e5b-b44d-<wbr>55922703feda<br>
Ancestors: VMMaker.oscog-cb.1919<br>
<br>
This commit makes a difference between the usage of the sistaV1 bytecode set and the Sista VM. It is now possible to compile the VM with the SistaV1 bytecode set but without the SistaVM option. This way, one can use and stabilize:<br>
- directed super sends<br>
- full block closures<br>
without using unsafe operations and traps. I believe we&#39;ll migrate to the sista runtime in multiple steps, and the first step is to use those features and have images compatible with those features without runtime optimizations.<br>
<br>
The SistaV1 bytecode set allows to use directed super send and full block closures. Enabling the bytecode set enables those features. (SistaV1BytecodeSet option)<br>
<br>
The SistaVM option, combined with SistaCogit, enables the profiling counters, the unsafe operations and traps. If disabled, the bytecodes from the SistaV1 bytecode set corresponding to traps or unsafe operations are considered unknown bytecodes.<br>
<br>
All unsafe operations and traps related JIT code is now in SistaCogit. Those bytecodes are considered as unknown bytecodes in superclasses.<br>
<br>
I&#39;ve also changed some flag logic, as the flag marking optimized method is bit 16 (previously upper literal bit) and not the flag bit.<br>
<br>
=============== Diff against VMMaker.oscog-cb.1919 ===============<br>
<br>
Item was changed:<br>
  ----- Method: CoInterpreter&gt;&gt;<wbr>maybeFlagMethodAsInterpreted: (in category &#39;compiled methods&#39;) -----<br>
  maybeFlagMethodAsInterpreted: aMethod<br>
+       &quot;The flag bit can be used to flag methods that are interpreted, if it has been requested<br>
-       &quot;In the Sista VM the flag bit in the method header is taken to identify optimized methods.<br>
-        In other VMs it can be used to flag methods that are interpreted, if it has been requested<br>
         from the image header flags.&quot;<br>
+       flagInterpretedMethods ifTrue:<br>
-       (SistaVM not and: [flagInterpretedMethods]) ifTrue:<br>
                [| rawHeader realHeader |<br>
                 rawHeader := self rawHeaderOf: aMethod.<br>
                 realHeader := (self isCogMethodReference: rawHeader)<br>
                                                ifTrue: [(self cCoerceSimple: rawHeader to: #&#39;CogMethod *&#39;) methodHeader]<br>
                                                ifFalse: [rawHeader].<br>
                 realHeader := realHeader bitOr: (objectMemory integerObjectOf: 1 &lt;&lt; MethodHeaderFlagBitPosition).<br>
                 (self isCogMethodReference: rawHeader)<br>
                        ifTrue: [(self cCoerceSimple: rawHeader to: #&#39;CogMethod *&#39;) methodHeader: realHeader]<br>
                        ifFalse: [objectMemory storePointerUnchecked: 0 ofObject: aMethod withValue: realHeader]]!<br>
<br>
Item was changed:<br>
  ----- Method: CoInterpreter&gt;&gt;<wbr>setImageHeaderFlagsFrom: (in category &#39;image save/restore&#39;) -----<br>
  setImageHeaderFlagsFrom: headerFlags<br>
        &quot;Set the flags that are contained in the 7th long of the image header.&quot;<br>
        imageHeaderFlags := headerFlags. &quot;so as to preserve unrecognised flags.&quot;<br>
        fullScreenFlag := headerFlags bitAnd: 1.<br>
        imageFloatsBigEndian := (headerFlags bitAnd: 2) = 0 ifTrue: [1] ifFalse: [0].<br>
        flagInterpretedMethods := (headerFlags bitAnd: 8) ~= 0.<br>
        preemptionYields := (headerFlags bitAnd: 16) = 0.<br>
+       newFinalization := (headerFlags bitAnd: 64) ~= 0.!<br>
-       newFinalization := (headerFlags bitAnd: 64) ~= 0.<br>
-<br>
-       (SistaVM and: [flagInterpretedMethods]) ifTrue:<br>
-               [self print: &#39;warning, flagInterpretedMethods inoperable in Sista VMs.&#39;; cr]!<br>
<br>
Item was changed:<br>
  ----- Method: SimpleStackBasedCogit&gt;&gt;<wbr>genCallPrimitiveBytecode (in category &#39;bytecode generators&#39;) -----<br>
  genCallPrimitiveBytecode<br>
        &quot;V3PlusClosures:        139 10001011    iiiiiiii   jjjjjjjj  Call Primitive #iiiiiiii + (jjjjjjjj * 256)<br>
         NewsqueakV4:           249 11111001    iiiiiiii   jjjjjjjj  Call Primitive #iiiiiiii + (jjjjjjjj * 256)<br>
         SistaV1:                       248 11111000 iiiiiiii mjjjjjjj  Call Primitive #iiiiiiii + ( jjjjjjj * 256)<br>
                                                        m=1 means inlined primitive, no hard return after execution.&quot;<br>
        bytecodePC ~= initialPC ifTrue:<br>
                [^EncounteredUnknownBytecode].<br>
+       byte2 &lt; 128 ifFalse: [^EncounteredUnknownBytecode].<br>
        self assert: (primitiveIndex = (byte1 + (byte2 &lt;&lt; 8))<br>
                                or: [primitiveIndex = 0 &quot;disabled primitives, e.g. stream prims&quot;<br>
                                        and: [(coInterpreter primitiveIndexOf: methodObj) = (byte1 + (byte2 &lt;&lt; 8))]]).<br>
        ^0!<br>
<br>
Item was added:<br>
+ ----- Method: SimpleStackBasedCogit&gt;&gt;<wbr>genExtJumpIfNotInstanceOfBehav<wbr>iorsOrPopBytecode (in category &#39;bytecode generators&#39;) -----<br>
+ genExtJumpIfNotInstanceOfBehav<wbr>iorsOrPopBytecode<br>
+       &quot;SistaV1: *     254             11111110        kkkkkkkk        jjjjjjjj                branch If Not Instance Of Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A &gt;= 0) distance jjjjjjjj (+ Extend B * 256, where Extend B &gt;= 0)&quot;<br>
+       &quot;Non supported in non Sista VMs&quot;<br>
+       ^EncounteredUnknownBytecode<br>
+       !<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genBinaryConstOpVarInlinePrimi<wbr>tive: (in category &#39;inline primitive generators&#39;) -----<br>
+ genBinaryConstOpVarInlinePrimi<wbr>tive: prim<br>
+       &quot;Const op var version of binary inline primitives.&quot;<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>binaryInlinePrimitive:&quot;<br>
+       &lt;option: #SistaVM&gt;<br>
+       | ra val untaggedVal adjust |<br>
+       ra := self allocateRegForStackEntryAt: 0.<br>
+       self ssTop popToReg: ra.<br>
+       self ssPop: 1.<br>
+       val := self ssTop constant.<br>
+       self ssPop: 1.<br>
+       untaggedVal := val - objectMemory smallIntegerTag.<br>
+       prim caseOf: {<br>
+               &quot;0 through 6, +, -, *, /, //, \\, quo:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
+               [0]     -&gt;      [self AddCq: untaggedVal R: ra].<br>
+               [1]     -&gt;      [self MoveCq: val R: TempReg.<br>
+                                self SubR: ra R: TempReg.<br>
+                                objectRepresentation genAddSmallIntegerTagsTo: TempReg.<br>
+                                self MoveR: TempReg R: ra].<br>
+               [2]     -&gt;      [objectRepresentation genShiftAwaySmallIntegerTagsIn<wbr>ScratchReg: ra.<br>
+                                self MoveCq: untaggedVal R: TempReg.<br>
+                                self MulR: TempReg R: ra.<br>
+                                objectRepresentation genSetSmallIntegerTagsIn: ra].<br>
+<br>
+               &quot;2016 through 2019, bitAnd:, bitOr:, bitXor, bitShift:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
+               [16] -&gt; [ self AndCq: val R: ra ].<br>
+               [17] -&gt; [ self OrCq: val R: ra ].<br>
+               [18] -&gt; [ self XorCw: untaggedVal R: ra. ].<br>
+<br>
+               &quot;2032   through 2037, &gt;, &lt;, &gt;=, &lt;=. =, ~=, SmallInteger op SmallInteger =&gt; Boolean (flags?? then in jump bytecodes if ssTop is a flags value, just generate the instruction!!!!)&quot;<br>
+               &quot;CmpCqR is SubRCq so everything is reversed, but because no CmpRCq things are reversed again and we invert the sense of the jumps.&quot;<br>
+               [32] -&gt; [ self CmpCq: val R: ra.<br>
+                               self genBinaryInlineComparison: JumpLess opFalse: JumpGreaterOrEqual destReg: ra ].<br>
+               [33] -&gt; [ self CmpCq: val R: ra.<br>
+                               self genBinaryInlineComparison: JumpGreater opFalse: JumpLessOrEqual destReg: ra ].<br>
+               [34] -&gt; [ self CmpCq: val R: ra.<br>
+                               self genBinaryInlineComparison: JumpLessOrEqual opFalse: JumpGreater destReg: ra ].<br>
+               [35] -&gt; [ self CmpCq: val R: ra.<br>
+                               self genBinaryInlineComparison: JumpGreaterOrEqual opFalse: JumpLess destReg: ra ].<br>
+               [36] -&gt; [ self CmpCq: val R: ra.<br>
+                               self genBinaryInlineComparison: JumpZero opFalse: JumpNonZero destReg: ra ].<br>
+               [37] -&gt; [ self CmpCq: val R: ra.<br>
+                               self genBinaryInlineComparison: JumpNonZero opFalse: JumpZero destReg: ra ].<br>
+<br>
+               &quot;2064   through 2068, Pointer Object&gt;&gt;at:, Byte Object&gt;&gt;at:, Short16 Word Object&gt;&gt;at: LongWord32 Object&gt;&gt;at: Quad64Word Object&gt;&gt;at:. obj op 0-rel SmallInteger =&gt; oop&quot;<br>
+               [64] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
+                               adjust := (objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord) - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
+                               adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra. ].<br>
+                               self genMoveConstant: val R: TempReg.<br>
+                               self MoveXwr: ra R: TempReg R: ra].<br>
+               [65] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
+                               adjust := objectMemory baseHeaderSize - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
+                               self AddCq: adjust R: ra.<br>
+                               self genMoveConstant: val R: TempReg.<br>
+                               self MoveXbr: ra R: TempReg R: ra.<br>
+                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: ra]<br>
+       }<br>
+       otherwise: [^EncounteredUnknownBytecode].<br>
+       self ssPushRegister: ra.<br>
+       ^0!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genBinaryInlineComparison:<wbr>opFalse:destReg: (in category &#39;inline primitive generators&#39;) -----<br>
+ genBinaryInlineComparison: opTrue opFalse: opFalse destReg: destReg<br>
+       &quot;Inlined comparison. opTrue = jump for true and opFalse = jump for false&quot;<br>
+       &lt;var: #branchDescriptor type: #&#39;BytecodeDescriptor *&#39;&gt;<br>
+       | nextPC branchDescriptor targetBytecodePC postBranchPC |<br>
+<br>
+       self extractMaybeBranchDescriptorIn<wbr>to: [ :descr :next :postBranch :target |<br>
+               branchDescriptor := descr. nextPC := next. postBranchPC := postBranch. targetBytecodePC := target ].<br>
+<br>
+       (branchDescriptor isBranchTrue or: [branchDescriptor isBranchFalse])<br>
+               ifTrue: &quot;This is the path where the inlined comparison is followed immediately by a branch&quot;<br>
+                       [ (self fixupAt: nextPC - initialPC) notAFixup<br>
+                               ifTrue: &quot;The next instruction is dead.  we can skip it.&quot;<br>
+                                       [deadCode := true.<br>
+                                        self ensureFixupAt: targetBytecodePC - initialPC.<br>
+                                        self ensureFixupAt: postBranchPC - initialPC ]<br>
+                               ifFalse:<br>
+                                       [self ssPushConstant: objectMemory trueObject]. &quot;dummy value&quot;<br>
+                       self genConditionalBranch: (branchDescriptor isBranchTrue ifTrue: [opTrue] ifFalse: [opFalse])<br>
+                               operand: (self ensureNonMergeFixupAt: targetBytecodePC - initialPC) asUnsignedInteger.<br>
+                       deadCode ifFalse: [ self Jump: (self ensureNonMergeFixupAt: postBranchPC - initialPC) ] ]<br>
+               ifFalse: &quot;This is the path where the inlined comparison is *not* followed immediately by a branch&quot;<br>
+                       [| condJump jump |<br>
+                       condJump := self genConditionalBranch: opTrue operand: 0.<br>
+                       self genMoveFalseR: destReg.<br>
+                       jump := self Jump: 0.<br>
+                       condJump jmpTarget: (self genMoveTrueR: destReg).<br>
+                       jump jmpTarget: self Label].<br>
+       ^ 0!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genBinaryVarOpConstInlinePrimi<wbr>tive: (in category &#39;inline primitive generators&#39;) -----<br>
+ genBinaryVarOpConstInlinePrimi<wbr>tive: prim<br>
+       &quot;Var op const version of inline binary inline primitives.&quot;<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>binaryInlinePrimitive:&quot;<br>
+       &lt;option: #SistaVM&gt;<br>
+       | rr val untaggedVal |<br>
+       val := self ssTop constant.<br>
+       self ssPop: 1.<br>
+       rr := self allocateRegForStackEntryAt: 0.<br>
+       self ssTop popToReg: rr.<br>
+       self ssPop: 1.<br>
+       untaggedVal := val - objectMemory smallIntegerTag.<br>
+       prim caseOf: {<br>
+               &quot;0 through 6, +, -, *, /, //, \\, quo:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
+               [0]     -&gt;      [self AddCq: untaggedVal R: rr].<br>
+               [1]     -&gt;      [self SubCq: untaggedVal R: rr ].<br>
+               [2]     -&gt;      [self flag: &#39;could use MulCq:R&#39;.<br>
+                                objectRepresentation genShiftAwaySmallIntegerTagsIn<wbr>ScratchReg: rr.<br>
+                                self MoveCq: untaggedVal R: TempReg.<br>
+                                self MulR: TempReg R: rr.<br>
+                                objectRepresentation genSetSmallIntegerTagsIn: rr].<br>
+<br>
+               &quot;2016 through 2019, bitAnd:, bitOr:, bitXor, bitShift:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
+               [16] -&gt; [ self AndCq: val R: rr ].<br>
+               [17] -&gt; [ self OrCq: val R: rr ].<br>
+               [18] -&gt; [ self flag: &#39;could use XorCq:&#39;.<br>
+                               self XorCw: untaggedVal R: rr. ].<br>
+<br>
+               &quot;2032   through 2037, &gt;, &lt;, &gt;=, &lt;=. =, ~=, SmallInteger op SmallInteger =&gt; Boolean (flags?? then in jump bytecodes if ssTop is a flags value, just generate the instruction!!!!)&quot;<br>
+               &quot;CmpCqR is SubRCq so everything is reversed.&quot;<br>
+               [32] -&gt; [ self CmpCq: val R: rr.<br>
+                               self genBinaryInlineComparison: JumpGreater opFalse: JumpLessOrEqual destReg: rr ].<br>
+               [33] -&gt; [ self CmpCq: val R: rr.<br>
+                               self genBinaryInlineComparison: JumpLess opFalse: JumpGreaterOrEqual destReg: rr ].<br>
+               [34] -&gt; [ self CmpCq: val R: rr.<br>
+                               self genBinaryInlineComparison: JumpGreaterOrEqual opFalse: JumpLess destReg: rr ].<br>
+               [35] -&gt; [ self CmpCq: val R: rr.<br>
+                               self genBinaryInlineComparison: JumpLessOrEqual opFalse: JumpGreater destReg: rr ].<br>
+               [36] -&gt; [ self CmpCq: val R: rr.<br>
+                               self genBinaryInlineComparison: JumpZero opFalse: JumpNonZero destReg: rr ].<br>
+               [37] -&gt; [ self CmpCq: val R: rr.<br>
+                               self genBinaryInlineComparison: JumpNonZero opFalse: JumpZero destReg: rr ].<br>
+<br>
+               &quot;2064   through 2068, Pointer Object&gt;&gt;at:, Byte Object&gt;&gt;at:, Short16 Word Object&gt;&gt;at: LongWord32 Object&gt;&gt;at: Quad64Word Object&gt;&gt;at:. obj op 0-rel SmallInteger =&gt; oop&quot;<br>
+               [64] -&gt; [objectRepresentation genLoadSlot: (objectMemory integerValueOf: val) - 1 sourceReg: rr destReg: rr].<br>
+               [65] -&gt; [self MoveCq: (objectMemory integerValueOf: val) + objectMemory baseHeaderSize - 1 R: TempReg.<br>
+                               self MoveXbr: TempReg R: rr R: rr.<br>
+                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: rr]<br>
+<br>
+       }<br>
+       otherwise: [^EncounteredUnknownBytecode].<br>
+       self ssPushRegister: rr.<br>
+       ^0!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genBinaryVarOpVarInlinePrimiti<wbr>ve: (in category &#39;inline primitive generators&#39;) -----<br>
+ genBinaryVarOpVarInlinePrimiti<wbr>ve: prim<br>
+       &quot;Var op var version of binary inline primitives.&quot;<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>binaryInlinePrimitive:&quot;<br>
+       &lt;option: #SistaVM&gt;<br>
+       | ra rr adjust |<br>
+       self allocateRegForStackTopTwoEntri<wbr>esInto: [:rTop :rNext | ra := rTop. rr := rNext ].<br>
+       self ssTop popToReg: ra.<br>
+       self ssPop: 1.<br>
+       self ssTop popToReg: rr.<br>
+       self ssPop: 1.<br>
+       prim caseOf: {<br>
+               &quot;0 through 6, +, -, *, /, //, \\, quo:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
+               [0]     -&gt;      [objectRepresentation genRemoveSmallIntegerTagsInScr<wbr>atchReg: ra.<br>
+                                self AddR: ra R: rr].<br>
+               [1]     -&gt;      [self SubR: ra R: rr.<br>
+                                objectRepresentation genAddSmallIntegerTagsTo: rr].<br>
+               [2]     -&gt;      [self genShiftAwaySmallIntegerTagsIn<wbr>ScratchReg: rr.<br>
+                                self genRemoveSmallIntegerTagsInScr<wbr>atchReg: ra.<br>
+                                self MulR: ra R: rr.<br>
+                                self genSetSmallIntegerTagsIn: rr].<br>
+<br>
+               &quot;2016 through 2019, bitAnd:, bitOr:, bitXor, bitShift:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
+               [16] -&gt; [ self AndR: ra R: rr ].<br>
+               [17] -&gt; [ self OrR: ra R: rr ].<br>
+               [18] -&gt; [objectRepresentation genRemoveSmallIntegerTagsInScr<wbr>atchReg: ra.<br>
+                               self XorR: ra R: rr. ].<br>
+<br>
+<br>
+               &quot;2032   through 2037, &gt;, &lt;, &gt;=, &lt;=. =, ~=, SmallInteger op SmallInteger =&gt; Boolean (flags?? then in jump bytecodes if ssTop is a flags value, just generate the instruction!!!!)&quot;<br>
+               &quot;CmpCqR is SubRCq so everything is reversed.&quot;<br>
+               [32] -&gt; [ self CmpR: ra R: rr.<br>
+                               self genBinaryInlineComparison: JumpGreater opFalse: JumpLessOrEqual destReg: rr ].<br>
+               [33] -&gt; [ self CmpR: ra R: rr.<br>
+                               self genBinaryInlineComparison: JumpLess opFalse: JumpGreaterOrEqual destReg: rr ].<br>
+               [34] -&gt; [ self CmpR: ra R: rr.<br>
+                               self genBinaryInlineComparison: JumpGreaterOrEqual opFalse: JumpLess destReg: rr ].<br>
+               [35] -&gt; [ self CmpR: ra R: rr.<br>
+                               self genBinaryInlineComparison: JumpLessOrEqual opFalse: JumpGreater destReg: rr ].<br>
+               [36] -&gt; [ self CmpR: ra R: rr.<br>
+                               self genBinaryInlineComparison: JumpZero opFalse: JumpNonZero destReg: rr ].<br>
+               [37] -&gt; [ self CmpR: ra R: rr.<br>
+                               self genBinaryInlineComparison: JumpNonZero opFalse: JumpZero destReg: rr ].<br>
+<br>
+               &quot;2064   through 2068, Pointer Object&gt;&gt;at:, Byte Object&gt;&gt;at:, Short16 Word Object&gt;&gt;at: LongWord32 Object&gt;&gt;at: Quad64Word Object&gt;&gt;at:. obj op 0-rel SmallInteger =&gt; oop&quot;<br>
+               [64] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
+                               adjust := (objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord) - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
+                               adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra. ].<br>
+                               self MoveXwr: ra R: rr R: rr ].<br>
+               [65] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
+                               adjust := objectMemory baseHeaderSize - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
+                               self AddCq: adjust R: ra.<br>
+                               self MoveXbr: ra R: rr R: rr.<br>
+                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: rr]<br>
+<br>
+       }<br>
+       otherwise: [^EncounteredUnknownBytecode].<br>
+       self ssPushRegister: rr.<br>
+       ^0!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genCallPrimitiveBytecode (in category &#39;bytecode generators&#39;) -----<br>
+ genCallPrimitiveBytecode<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>inlinePrimitiveBytecode:&quot;<br>
+       | prim |<br>
+       byte2 &lt; 128 ifTrue:<br>
+               [^bytecodePC = initialPC<br>
+                       ifTrue: [0]<br>
+                       ifFalse: [EncounteredUnknownBytecode]].<br>
+       prim := byte2 - 128 &lt;&lt; 8 + byte1.<br>
+<br>
+       prim &lt; 1000 ifTrue:<br>
+               [^self genNullaryInlinePrimitive: prim].<br>
+<br>
+       prim &lt; 2000 ifTrue:<br>
+               [^self genUnaryInlinePrimitive: prim - 1000].<br>
+<br>
+       prim &lt; 3000 ifTrue:<br>
+               [self ssTop type = SSConstant ifTrue:<br>
+                       [^self genBinaryVarOpConstInlinePrimi<wbr>tive: prim - 2000].<br>
+                (self ssValue: 1) type = SSConstant ifTrue:<br>
+                       [^self genBinaryConstOpVarInlinePrimi<wbr>tive: prim - 2000].<br>
+                ^self genBinaryVarOpVarInlinePrimiti<wbr>ve: prim - 2000].<br>
+<br>
+       prim &lt; 4000 ifTrue:<br>
+               [^self genTrinaryInlinePrimitive: prim - 3000].<br>
+<br>
+       ^EncounteredUnknownBytecode!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genNullaryInlinePrimitive: (in category &#39;inline primitive generators&#39;) -----<br>
+ genNullaryInlinePrimitive: prim<br>
+       &quot;Nullary inline primitives.&quot;<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>nullaryInlinePrimitive:&quot;<br>
+<br>
+       &lt;option: #SistaVM&gt;<br>
+       ^EncounteredUnknownBytecode!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genTrinaryInlinePrimitive: (in category &#39;inline primitive generators&#39;) -----<br>
+ genTrinaryInlinePrimitive: prim<br>
+       &quot;Unary inline primitives.&quot;<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>trinaryInlinePrimitive:&quot;<br>
+       | ra1 ra2 rr adjust needsStoreCheck |<br>
+       &quot;The store check requires rr to be ReceiverResultReg&quot;<br>
+       needsStoreCheck := (objectRepresentation isUnannotatableConstant: self ssTop) not.<br>
+       self<br>
+               allocateRegForStackTopThreeEnt<wbr>riesInto: [:rTop :rNext :rThird | ra2 := rTop. ra1 := rNext. rr := rThird ]<br>
+               thirdIsReceiver: (prim = 0 and: [ needsStoreCheck ]).<br>
+       self assert: (rr ~= ra1 and: [rr ~= ra2 and: [ra1 ~= ra2]]).<br>
+       self ssTop popToReg: ra2.<br>
+       self ssPop: 1.<br>
+       self ssTop popToReg: ra1.<br>
+       self ssPop: 1.<br>
+       self ssTop popToReg: rr.<br>
+       self ssPop: 1.<br>
+       objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra1.<br>
+       &quot;Now: ra is the variable object, rr is long, TempReg holds the value to store.&quot;<br>
+       self flag: #TODO. &quot;This is not really working as the immutability and store check needs to be present. &quot;<br>
+       prim caseOf: {<br>
+               &quot;0 - 1 pointerAt:put: and byteAt:Put:&quot;<br>
+               [0] -&gt;  [ adjust := (objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord) - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
+                               adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra1. ].<br>
+                               self MoveR: ra2 Xwr: ra1 R: rr.<br>
+                               &quot;I added needsStoreCheck so if you initialize an array with a Smi such as 0 or a boolean you don&#39;t need the store check&quot;<br>
+                               needsStoreCheck ifTrue:<br>
+                                       [ self assert: needsFrame.<br>
+                                       objectRepresentation genStoreCheckReceiverReg: rr valueReg: ra2 scratchReg: TempReg inFrame: true] ].<br>
+               [1] -&gt;  [ objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra2.<br>
+                               adjust := objectMemory baseHeaderSize - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
+                               self AddCq: adjust R: ra1.<br>
+                               self MoveR: ra2 Xbr: ra1 R: rr.<br>
+                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: ra2. ]<br>
+       }<br>
+       otherwise: [^EncounteredUnknownBytecode].<br>
+       self ssPushRegister: ra2.<br>
+       ^0!<br>
<br>
Item was added:<br>
+ ----- Method: SistaCogit&gt;&gt;<wbr>genUnaryInlinePrimitive: (in category &#39;inline primitive generators&#39;) -----<br>
+ genUnaryInlinePrimitive: prim<br>
+       &quot;Unary inline primitives.&quot;<br>
+       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
+        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>unaryInlinePrimitive:&quot;<br>
+       | rcvrReg resultReg |<br>
+       rcvrReg := self allocateRegForStackEntryAt: 0.<br>
+       resultReg := self allocateRegNotConflictingWith: (self registerMaskFor: rcvrReg).<br>
+       prim<br>
+               caseOf: {<br>
+                                       &quot;00             unchecked class&quot;<br>
+                       [1] -&gt;  &quot;01             unchecked pointer numSlots&quot;<br>
+                               [self ssTop popToReg: rcvrReg.<br>
+                                self ssPop: 1.<br>
+                                objectRepresentation<br>
+                                       genGetNumSlotsOf: rcvrReg into: resultReg;<br>
+                                       genConvertIntegerToSmallIntege<wbr>rInReg: resultReg].<br>
+                                       &quot;02             unchecked pointer basicSize&quot;<br>
+                       [3] -&gt;  &quot;03             unchecked byte numBytes&quot;<br>
+                               [objectRepresentation<br>
+                                       genGetNumBytesOf: rcvrReg into: resultReg;<br>
+                                       genConvertIntegerToSmallIntege<wbr>rInReg: resultReg].<br>
+                                       &quot;04             unchecked short16Type format numShorts&quot;<br>
+                                       &quot;05             unchecked word32Type format numWords&quot;<br>
+                                       &quot;06             unchecked doubleWord64Type format numDoubleWords&quot;<br>
+                       [11] -&gt; &quot;11             unchecked fixed pointer basicNew&quot;<br>
+                               [self ssTop type ~= SSConstant ifTrue:<br>
+                                       [^EncounteredUnknownBytecode].<br>
+                                (objectRepresentation<br>
+                                       genGetInstanceOf: self ssTop constant<br>
+                                               into: resultReg<br>
+                                                       initializingIf: self extBSpecifiesInitializeInstanc<wbr>e) ~= 0 ifTrue:<br>
+                                       [^ShouldNotJIT]. &quot;e.g. bad class&quot;<br>
+                                self ssPop: 1]<br>
+                                 }<br>
+               otherwise:<br>
+                       [^EncounteredUnknownBytecode].<br>
+       extB := 0.<br>
+       self ssPushRegister: resultReg.<br>
+       ^0!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;<wbr>directedSuperclassSend (in category &#39;send bytecodes&#39;) -----<br>
  directedSuperclassSend<br>
        &quot;Send a message to self, starting lookup with the superclass of the class on top of stack.&quot;<br>
        &quot;Assume: messageSelector and argumentCount have been set, and that<br>
         the receiver and arguments have been pushed onto the stack,&quot;<br>
        &quot;Note: This method is inlined into the interpreter dispatch loop.&quot;<br>
        &lt;sharedCodeInCase: #extSendSuperBytecode&gt;<br>
+       &lt;option: #<wbr>BytecodeSetHasDirectedSuperSen<wbr>d&gt;<br>
-       &lt;option: #SistaVM&gt;<br>
        | class superclass |<br>
        class := self internalPopStack.<br>
        (objectMemory isForwarded: class) ifTrue:<br>
                [class := objectMemory followForwarded: class].<br>
        superclass := self superclassOf: class.<br>
        &quot;classTagForClass: uses ensureBehaviorHash:&quot;<br>
        lkupClassTag := objectMemory classTagForClass: superclass.<br>
        &quot;To maintain the invariant that all receivers are unforwarded we need an explicit<br>
         read barrier in the super send cases.  Even though we always follow receivers<br>
         on become  e.g. super doSomethingWith: (self become: other) forwards the receiver<br>
         self pushed on the stack.&quot;<br>
        self ensureReceiverUnforwarded.<br>
        self assert: lkupClassTag ~= objectMemory nilObject.<br>
        self commonSendOrdinary!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;<wbr>extJumpIfNotInstanceOfBehavior<wbr>sOrPopBytecode (in category &#39;sista bytecodes&#39;) -----<br>
  extJumpIfNotInstanceOfBehavior<wbr>sOrPopBytecode<br>
        &quot;254            11111110        kkkkkkkk        jjjjjjjj                branch If Not Instance Of Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A &gt;= 0) distance jjjjjjjj (+ Extend B * 256, where Extend B &gt;= 0)&quot;<br>
        | tosClassTag literal distance |<br>
+       SistaVM ifFalse: [^self respondToUnknownBytecode].<br>
        tosClassTag := objectMemory fetchClassTagOf: self internalStackTop.<br>
        literal := self literal: extA &lt;&lt; 8 + self fetchByte.<br>
        distance := extB &lt;&lt; 8 + self fetchByte.<br>
        extA := 0.<br>
        extB := 0.<br>
        (objectMemory isArrayNonImm: literal)<br>
                ifTrue:<br>
                        [0 to: (objectMemory numSlotsOf: literal) asInteger - 1 do: [:i |<br>
                                tosClassTag = (objectMemory rawClassTagForClass: (objectMemory fetchPointer: i ofObject: literal))<br>
                                        ifTrue:<br>
                                                [ self internalPopStack.<br>
                                                ^ self fetchNextBytecode ] ].<br>
                        localIP := localIP + distance.<br>
                                ^ self fetchNextBytecode]<br>
                ifFalse:<br>
                        [tosClassTag ~= (objectMemory rawClassTagForClass: literal) ifTrue:<br>
                                [localIP := localIP + distance.<br>
                                ^ self fetchNextBytecode]].<br>
        self internalPopStack.<br>
        self fetchNextBytecode!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;<wbr>extSendSuperBytecode (in category &#39;send bytecodes&#39;) -----<br>
  extSendSuperBytecode<br>
        &quot;239            11101111        i i i i i j j j<br>
                ExtendB &lt; 64<br>
                        ifTrue: [Send To Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments]<br>
                        ifFalse: [Send To Superclass of Stacked Class Literal Selector #iiiii (+ Extend A * 32) with jjj (+ (Extend B bitAnd: 63) * 8) Arguments]&quot;<br>
        | byte |<br>
        byte := self fetchByte.<br>
        messageSelector := self literal: (byte &gt;&gt; 3) + (extA &lt;&lt; 5).<br>
        extA := 0.<br>
+       BytecodeSetHasDirectedSuperSen<wbr>d ifTrue:<br>
-       SistaVM ifTrue:<br>
                [extB &gt;= 64 ifTrue:<br>
                        [argumentCount := (byte bitAnd: 7) + (extB - 64 &lt;&lt; 3).<br>
                         extB := 0.<br>
                         ^self directedSuperclassSend]].<br>
        argumentCount := (byte bitAnd: 7) + (extB &lt;&lt; 3).<br>
        extB := 0.<br>
        self superclassSend!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;<wbr>unconditionnalTrapBytecode (in category &#39;sista bytecodes&#39;) -----<br>
  unconditionnalTrapBytecode<br>
        &quot;SistaV1: *     217     Trap&quot;<br>
+       SistaVM<br>
+               ifTrue: [^self respondToSistaTrap]<br>
+               ifFalse: [^self respondToUnknownBytecode]!<br>
-       ^ self respondToSistaTrap!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genBinaryConstOpVarInlinePrimi<wbr>tive: (in category &#39;inline primitive generators&#39;) -----<br>
- genBinaryConstOpVarInlinePrimi<wbr>tive: prim<br>
-       &quot;Const op var version of binary inline primitives.&quot;<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>binaryInlinePrimitive:&quot;<br>
-       &lt;option: #SistaVM&gt;<br>
-       | ra val untaggedVal adjust |<br>
-       ra := self allocateRegForStackEntryAt: 0.<br>
-       self ssTop popToReg: ra.<br>
-       self ssPop: 1.<br>
-       val := self ssTop constant.<br>
-       self ssPop: 1.<br>
-       untaggedVal := val - objectMemory smallIntegerTag.<br>
-       prim caseOf: {<br>
-               &quot;0 through 6, +, -, *, /, //, \\, quo:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
-               [0]     -&gt;      [self AddCq: untaggedVal R: ra].<br>
-               [1]     -&gt;      [self MoveCq: val R: TempReg.<br>
-                                self SubR: ra R: TempReg.<br>
-                                objectRepresentation genAddSmallIntegerTagsTo: TempReg.<br>
-                                self MoveR: TempReg R: ra].<br>
-               [2]     -&gt;      [objectRepresentation genShiftAwaySmallIntegerTagsIn<wbr>ScratchReg: ra.<br>
-                                self MoveCq: untaggedVal R: TempReg.<br>
-                                self MulR: TempReg R: ra.<br>
-                                objectRepresentation genSetSmallIntegerTagsIn: ra].<br>
-<br>
-               &quot;2016 through 2019, bitAnd:, bitOr:, bitXor, bitShift:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
-               [16] -&gt; [ self AndCq: val R: ra ].<br>
-               [17] -&gt; [ self OrCq: val R: ra ].<br>
-               [18] -&gt; [ self XorCw: untaggedVal R: ra. ].<br>
-<br>
-               &quot;2032   through 2037, &gt;, &lt;, &gt;=, &lt;=. =, ~=, SmallInteger op SmallInteger =&gt; Boolean (flags?? then in jump bytecodes if ssTop is a flags value, just generate the instruction!!!!)&quot;<br>
-               &quot;CmpCqR is SubRCq so everything is reversed, but because no CmpRCq things are reversed again and we invert the sense of the jumps.&quot;<br>
-               [32] -&gt; [ self CmpCq: val R: ra.<br>
-                               self genBinaryInlineComparison: JumpLess opFalse: JumpGreaterOrEqual destReg: ra ].<br>
-               [33] -&gt; [ self CmpCq: val R: ra.<br>
-                               self genBinaryInlineComparison: JumpGreater opFalse: JumpLessOrEqual destReg: ra ].<br>
-               [34] -&gt; [ self CmpCq: val R: ra.<br>
-                               self genBinaryInlineComparison: JumpLessOrEqual opFalse: JumpGreater destReg: ra ].<br>
-               [35] -&gt; [ self CmpCq: val R: ra.<br>
-                               self genBinaryInlineComparison: JumpGreaterOrEqual opFalse: JumpLess destReg: ra ].<br>
-               [36] -&gt; [ self CmpCq: val R: ra.<br>
-                               self genBinaryInlineComparison: JumpZero opFalse: JumpNonZero destReg: ra ].<br>
-               [37] -&gt; [ self CmpCq: val R: ra.<br>
-                               self genBinaryInlineComparison: JumpNonZero opFalse: JumpZero destReg: ra ].<br>
-<br>
-               &quot;2064   through 2068, Pointer Object&gt;&gt;at:, Byte Object&gt;&gt;at:, Short16 Word Object&gt;&gt;at: LongWord32 Object&gt;&gt;at: Quad64Word Object&gt;&gt;at:. obj op 0-rel SmallInteger =&gt; oop&quot;<br>
-               [64] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
-                               adjust := (objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord) - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
-                               adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra. ].<br>
-                               self genMoveConstant: val R: TempReg.<br>
-                               self MoveXwr: ra R: TempReg R: ra].<br>
-               [65] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
-                               adjust := objectMemory baseHeaderSize - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
-                               self AddCq: adjust R: ra.<br>
-                               self genMoveConstant: val R: TempReg.<br>
-                               self MoveXbr: ra R: TempReg R: ra.<br>
-                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: ra]<br>
-       }<br>
-       otherwise: [^EncounteredUnknownBytecode].<br>
-       self ssPushRegister: ra.<br>
-       ^0!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genBinaryInlineComparison:<wbr>opFalse:destReg: (in category &#39;inline primitive generators&#39;) -----<br>
- genBinaryInlineComparison: opTrue opFalse: opFalse destReg: destReg<br>
-       &quot;Inlined comparison. opTrue = jump for true and opFalse = jump for false&quot;<br>
-       &lt;var: #branchDescriptor type: #&#39;BytecodeDescriptor *&#39;&gt;<br>
-       | nextPC branchDescriptor targetBytecodePC postBranchPC |<br>
-<br>
-       self extractMaybeBranchDescriptorIn<wbr>to: [ :descr :next :postBranch :target |<br>
-               branchDescriptor := descr. nextPC := next. postBranchPC := postBranch. targetBytecodePC := target ].<br>
-<br>
-       (branchDescriptor isBranchTrue or: [branchDescriptor isBranchFalse])<br>
-               ifTrue: &quot;This is the path where the inlined comparison is followed immediately by a branch&quot;<br>
-                       [ (self fixupAt: nextPC - initialPC) notAFixup<br>
-                               ifTrue: &quot;The next instruction is dead.  we can skip it.&quot;<br>
-                                       [deadCode := true.<br>
-                                        self ensureFixupAt: targetBytecodePC - initialPC.<br>
-                                        self ensureFixupAt: postBranchPC - initialPC ]<br>
-                               ifFalse:<br>
-                                       [self ssPushConstant: objectMemory trueObject]. &quot;dummy value&quot;<br>
-                       self genConditionalBranch: (branchDescriptor isBranchTrue ifTrue: [opTrue] ifFalse: [opFalse])<br>
-                               operand: (self ensureNonMergeFixupAt: targetBytecodePC - initialPC) asUnsignedInteger.<br>
-                       deadCode ifFalse: [ self Jump: (self ensureNonMergeFixupAt: postBranchPC - initialPC) ] ]<br>
-               ifFalse: &quot;This is the path where the inlined comparison is *not* followed immediately by a branch&quot;<br>
-                       [| condJump jump |<br>
-                       condJump := self genConditionalBranch: opTrue operand: 0.<br>
-                       self genMoveFalseR: destReg.<br>
-                       jump := self Jump: 0.<br>
-                       condJump jmpTarget: (self genMoveTrueR: destReg).<br>
-                       jump jmpTarget: self Label].<br>
-       ^ 0!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genBinaryVarOpConstInlinePrimi<wbr>tive: (in category &#39;inline primitive generators&#39;) -----<br>
- genBinaryVarOpConstInlinePrimi<wbr>tive: prim<br>
-       &quot;Var op const version of inline binary inline primitives.&quot;<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>binaryInlinePrimitive:&quot;<br>
-       &lt;option: #SistaVM&gt;<br>
-       | rr val untaggedVal |<br>
-       val := self ssTop constant.<br>
-       self ssPop: 1.<br>
-       rr := self allocateRegForStackEntryAt: 0.<br>
-       self ssTop popToReg: rr.<br>
-       self ssPop: 1.<br>
-       untaggedVal := val - objectMemory smallIntegerTag.<br>
-       prim caseOf: {<br>
-               &quot;0 through 6, +, -, *, /, //, \\, quo:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
-               [0]     -&gt;      [self AddCq: untaggedVal R: rr].<br>
-               [1]     -&gt;      [self SubCq: untaggedVal R: rr ].<br>
-               [2]     -&gt;      [self flag: &#39;could use MulCq:R&#39;.<br>
-                                objectRepresentation genShiftAwaySmallIntegerTagsIn<wbr>ScratchReg: rr.<br>
-                                self MoveCq: untaggedVal R: TempReg.<br>
-                                self MulR: TempReg R: rr.<br>
-                                objectRepresentation genSetSmallIntegerTagsIn: rr].<br>
-<br>
-               &quot;2016 through 2019, bitAnd:, bitOr:, bitXor, bitShift:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
-               [16] -&gt; [ self AndCq: val R: rr ].<br>
-               [17] -&gt; [ self OrCq: val R: rr ].<br>
-               [18] -&gt; [ self flag: &#39;could use XorCq:&#39;.<br>
-                               self XorCw: untaggedVal R: rr. ].<br>
-<br>
-               &quot;2032   through 2037, &gt;, &lt;, &gt;=, &lt;=. =, ~=, SmallInteger op SmallInteger =&gt; Boolean (flags?? then in jump bytecodes if ssTop is a flags value, just generate the instruction!!!!)&quot;<br>
-               &quot;CmpCqR is SubRCq so everything is reversed.&quot;<br>
-               [32] -&gt; [ self CmpCq: val R: rr.<br>
-                               self genBinaryInlineComparison: JumpGreater opFalse: JumpLessOrEqual destReg: rr ].<br>
-               [33] -&gt; [ self CmpCq: val R: rr.<br>
-                               self genBinaryInlineComparison: JumpLess opFalse: JumpGreaterOrEqual destReg: rr ].<br>
-               [34] -&gt; [ self CmpCq: val R: rr.<br>
-                               self genBinaryInlineComparison: JumpGreaterOrEqual opFalse: JumpLess destReg: rr ].<br>
-               [35] -&gt; [ self CmpCq: val R: rr.<br>
-                               self genBinaryInlineComparison: JumpLessOrEqual opFalse: JumpGreater destReg: rr ].<br>
-               [36] -&gt; [ self CmpCq: val R: rr.<br>
-                               self genBinaryInlineComparison: JumpZero opFalse: JumpNonZero destReg: rr ].<br>
-               [37] -&gt; [ self CmpCq: val R: rr.<br>
-                               self genBinaryInlineComparison: JumpNonZero opFalse: JumpZero destReg: rr ].<br>
-<br>
-               &quot;2064   through 2068, Pointer Object&gt;&gt;at:, Byte Object&gt;&gt;at:, Short16 Word Object&gt;&gt;at: LongWord32 Object&gt;&gt;at: Quad64Word Object&gt;&gt;at:. obj op 0-rel SmallInteger =&gt; oop&quot;<br>
-               [64] -&gt; [objectRepresentation genLoadSlot: (objectMemory integerValueOf: val) - 1 sourceReg: rr destReg: rr].<br>
-               [65] -&gt; [self MoveCq: (objectMemory integerValueOf: val) + objectMemory baseHeaderSize - 1 R: TempReg.<br>
-                               self MoveXbr: TempReg R: rr R: rr.<br>
-                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: rr]<br>
-<br>
-       }<br>
-       otherwise: [^EncounteredUnknownBytecode].<br>
-       self ssPushRegister: rr.<br>
-       ^0!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genBinaryVarOpVarInlinePrimiti<wbr>ve: (in category &#39;inline primitive generators&#39;) -----<br>
- genBinaryVarOpVarInlinePrimiti<wbr>ve: prim<br>
-       &quot;Var op var version of binary inline primitives.&quot;<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>binaryInlinePrimitive:&quot;<br>
-       &lt;option: #SistaVM&gt;<br>
-       | ra rr adjust |<br>
-       self allocateRegForStackTopTwoEntri<wbr>esInto: [:rTop :rNext | ra := rTop. rr := rNext ].<br>
-       self ssTop popToReg: ra.<br>
-       self ssPop: 1.<br>
-       self ssTop popToReg: rr.<br>
-       self ssPop: 1.<br>
-       prim caseOf: {<br>
-               &quot;0 through 6, +, -, *, /, //, \\, quo:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
-               [0]     -&gt;      [objectRepresentation genRemoveSmallIntegerTagsInScr<wbr>atchReg: ra.<br>
-                                self AddR: ra R: rr].<br>
-               [1]     -&gt;      [self SubR: ra R: rr.<br>
-                                objectRepresentation genAddSmallIntegerTagsTo: rr].<br>
-               [2]     -&gt;      [self genShiftAwaySmallIntegerTagsIn<wbr>ScratchReg: rr.<br>
-                                self genRemoveSmallIntegerTagsInScr<wbr>atchReg: ra.<br>
-                                self MulR: ra R: rr.<br>
-                                self genSetSmallIntegerTagsIn: rr].<br>
-<br>
-               &quot;2016 through 2019, bitAnd:, bitOr:, bitXor, bitShift:, SmallInteger op SmallInteger =&gt; SmallInteger, no overflow&quot;<br>
-               [16] -&gt; [ self AndR: ra R: rr ].<br>
-               [17] -&gt; [ self OrR: ra R: rr ].<br>
-               [18] -&gt; [objectRepresentation genRemoveSmallIntegerTagsInScr<wbr>atchReg: ra.<br>
-                               self XorR: ra R: rr. ].<br>
-<br>
-<br>
-               &quot;2032   through 2037, &gt;, &lt;, &gt;=, &lt;=. =, ~=, SmallInteger op SmallInteger =&gt; Boolean (flags?? then in jump bytecodes if ssTop is a flags value, just generate the instruction!!!!)&quot;<br>
-               &quot;CmpCqR is SubRCq so everything is reversed.&quot;<br>
-               [32] -&gt; [ self CmpR: ra R: rr.<br>
-                               self genBinaryInlineComparison: JumpGreater opFalse: JumpLessOrEqual destReg: rr ].<br>
-               [33] -&gt; [ self CmpR: ra R: rr.<br>
-                               self genBinaryInlineComparison: JumpLess opFalse: JumpGreaterOrEqual destReg: rr ].<br>
-               [34] -&gt; [ self CmpR: ra R: rr.<br>
-                               self genBinaryInlineComparison: JumpGreaterOrEqual opFalse: JumpLess destReg: rr ].<br>
-               [35] -&gt; [ self CmpR: ra R: rr.<br>
-                               self genBinaryInlineComparison: JumpLessOrEqual opFalse: JumpGreater destReg: rr ].<br>
-               [36] -&gt; [ self CmpR: ra R: rr.<br>
-                               self genBinaryInlineComparison: JumpZero opFalse: JumpNonZero destReg: rr ].<br>
-               [37] -&gt; [ self CmpR: ra R: rr.<br>
-                               self genBinaryInlineComparison: JumpNonZero opFalse: JumpZero destReg: rr ].<br>
-<br>
-               &quot;2064   through 2068, Pointer Object&gt;&gt;at:, Byte Object&gt;&gt;at:, Short16 Word Object&gt;&gt;at: LongWord32 Object&gt;&gt;at: Quad64Word Object&gt;&gt;at:. obj op 0-rel SmallInteger =&gt; oop&quot;<br>
-               [64] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
-                               adjust := (objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord) - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
-                               adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra. ].<br>
-                               self MoveXwr: ra R: rr R: rr ].<br>
-               [65] -&gt; [objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra.<br>
-                               adjust := objectMemory baseHeaderSize - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
-                               self AddCq: adjust R: ra.<br>
-                               self MoveXbr: ra R: rr R: rr.<br>
-                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: rr]<br>
-<br>
-       }<br>
-       otherwise: [^EncounteredUnknownBytecode].<br>
-       self ssPushRegister: rr.<br>
-       ^0!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genCallPrimitiveBytecode (in category &#39;bytecode generators&#39;) -----<br>
- genCallPrimitiveBytecode<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>inlinePrimitiveBytecode:&quot;<br>
-       | prim |<br>
-       byte2 &lt; 128 ifTrue:<br>
-               [^bytecodePC = initialPC<br>
-                       ifTrue: [0]<br>
-                       ifFalse: [EncounteredUnknownBytecode]].<br>
-       prim := byte2 - 128 &lt;&lt; 8 + byte1.<br>
-<br>
-       self cppIf: SistaVM<br>
-               ifTrue:<br>
-                       [prim &lt; 1000 ifTrue:<br>
-                               [^self genNullaryInlinePrimitive: prim].<br>
-<br>
-                       prim &lt; 2000 ifTrue:<br>
-                               [^self genUnaryInlinePrimitive: prim - 1000].<br>
-<br>
-                       prim &lt; 3000 ifTrue:<br>
-                               [self ssTop type = SSConstant ifTrue:<br>
-                                       [^self genBinaryVarOpConstInlinePrimi<wbr>tive: prim - 2000].<br>
-                                (self ssValue: 1) type = SSConstant ifTrue:<br>
-                                       [^self genBinaryConstOpVarInlinePrimi<wbr>tive: prim - 2000].<br>
-                                ^self genBinaryVarOpVarInlinePrimiti<wbr>ve: prim - 2000].<br>
-<br>
-                       prim &lt; 4000 ifTrue:<br>
-                               [^self genTrinaryInlinePrimitive: prim - 3000]].<br>
-<br>
-       ^EncounteredUnknownBytecode!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genNullaryInlinePrimitive: (in category &#39;inline primitive generators&#39;) -----<br>
- genNullaryInlinePrimitive: prim<br>
-       &quot;Nullary inline primitives.&quot;<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>nullaryInlinePrimitive:&quot;<br>
-<br>
-       &lt;option: #SistaVM&gt;<br>
-       ^EncounteredUnknownBytecode!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genTrinaryInlinePrimitive: (in category &#39;inline primitive generators&#39;) -----<br>
- genTrinaryInlinePrimitive: prim<br>
-       &quot;Unary inline primitives.&quot;<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>trinaryInlinePrimitive:&quot;<br>
-       &lt;option: #SistaVM&gt;<br>
-       | ra1 ra2 rr adjust needsStoreCheck |<br>
-       &quot;The store check requires rr to be ReceiverResultReg&quot;<br>
-       needsStoreCheck := (objectRepresentation isUnannotatableConstant: self ssTop) not.<br>
-       self<br>
-               allocateRegForStackTopThreeEnt<wbr>riesInto: [:rTop :rNext :rThird | ra2 := rTop. ra1 := rNext. rr := rThird ]<br>
-               thirdIsReceiver: (prim = 0 and: [ needsStoreCheck ]).<br>
-       self assert: (rr ~= ra1 and: [rr ~= ra2 and: [ra1 ~= ra2]]).<br>
-       self ssTop popToReg: ra2.<br>
-       self ssPop: 1.<br>
-       self ssTop popToReg: ra1.<br>
-       self ssPop: 1.<br>
-       self ssTop popToReg: rr.<br>
-       self ssPop: 1.<br>
-       objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra1.<br>
-       &quot;Now: ra is the variable object, rr is long, TempReg holds the value to store.&quot;<br>
-       self flag: #TODO. &quot;This is not really working as the immutability and store check needs to be present. &quot;<br>
-       prim caseOf: {<br>
-               &quot;0 - 1 pointerAt:put: and byteAt:Put:&quot;<br>
-               [0] -&gt;  [ adjust := (objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord) - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
-                               adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra1. ].<br>
-                               self MoveR: ra2 Xwr: ra1 R: rr.<br>
-                               &quot;I added needsStoreCheck so if you initialize an array with a Smi such as 0 or a boolean you don&#39;t need the store check&quot;<br>
-                               needsStoreCheck ifTrue:<br>
-                                       [ self assert: needsFrame.<br>
-                                       objectRepresentation genStoreCheckReceiverReg: rr valueReg: ra2 scratchReg: TempReg inFrame: true] ].<br>
-               [1] -&gt;  [ objectRepresentation genConvertSmallIntegerToIntege<wbr>rInReg: ra2.<br>
-                               adjust := objectMemory baseHeaderSize - 1. &quot;shift by baseHeaderSize and then move from 1 relative to zero relative&quot;<br>
-                               self AddCq: adjust R: ra1.<br>
-                               self MoveR: ra2 Xbr: ra1 R: rr.<br>
-                               objectRepresentation genConvertIntegerToSmallIntege<wbr>rInReg: ra2. ]<br>
-       }<br>
-       otherwise: [^EncounteredUnknownBytecode].<br>
-       self ssPushRegister: ra2.<br>
-       ^0!<br>
<br>
Item was removed:<br>
- ----- Method: StackToRegisterMappingCogit&gt;&gt;<wbr>genUnaryInlinePrimitive: (in category &#39;inline primitive generators&#39;) -----<br>
- genUnaryInlinePrimitive: prim<br>
-       &quot;Unary inline primitives.&quot;<br>
-       &quot;SistaV1: 248           11111000        iiiiiiii                mjjjjjjj                Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.<br>
-        See EncoderForSistaV1&#39;s class comment and StackInterpreter&gt;&gt;#<wbr>unaryInlinePrimitive:&quot;<br>
-       &lt;option: #SistaVM&gt;<br>
-       | rcvrReg resultReg |<br>
-       rcvrReg := self allocateRegForStackEntryAt: 0.<br>
-       resultReg := self allocateRegNotConflictingWith: (self registerMaskFor: rcvrReg).<br>
-       prim<br>
-               caseOf: {<br>
-                                       &quot;00             unchecked class&quot;<br>
-                       [1] -&gt;  &quot;01             unchecked pointer numSlots&quot;<br>
-                               [self ssTop popToReg: rcvrReg.<br>
-                                self ssPop: 1.<br>
-                                objectRepresentation<br>
-                                       genGetNumSlotsOf: rcvrReg into: resultReg;<br>
-                                       genConvertIntegerToSmallIntege<wbr>rInReg: resultReg].<br>
-                                       &quot;02             unchecked pointer basicSize&quot;<br>
-                       [3] -&gt;  &quot;03             unchecked byte numBytes&quot;<br>
-                               [objectRepresentation<br>
-                                       genGetNumBytesOf: rcvrReg into: resultReg;<br>
-                                       genConvertIntegerToSmallIntege<wbr>rInReg: resultReg].<br>
-                                       &quot;04             unchecked short16Type format numShorts&quot;<br>
-                                       &quot;05             unchecked word32Type format numWords&quot;<br>
-                                       &quot;06             unchecked doubleWord64Type format numDoubleWords&quot;<br>
-                       [11] -&gt; &quot;11             unchecked fixed pointer basicNew&quot;<br>
-                               [self ssTop type ~= SSConstant ifTrue:<br>
-                                       [^EncounteredUnknownBytecode].<br>
-                                (objectRepresentation<br>
-                                       genGetInstanceOf: self ssTop constant<br>
-                                               into: resultReg<br>
-                                                       initializingIf: self extBSpecifiesInitializeInstanc<wbr>e) ~= 0 ifTrue:<br>
-                                       [^ShouldNotJIT]. &quot;e.g. bad class&quot;<br>
-                                self ssPop: 1]<br>
-                                 }<br>
-               otherwise:<br>
-                       [^EncounteredUnknownBytecode].<br>
-       extB := 0.<br>
-       self ssPushRegister: resultReg.<br>
-       ^0!<br>
<br>
Item was changed:<br>
  ----- Method: VMMaker class&gt;&gt;<wbr>generateSqueakCogVMWithInterpr<wbr>eterClass:options: (in category &#39;confs-support&#39;) -----<br>
  generateSqueakCogVMWithInterpr<wbr>eterClass: interpreterClass options: optionsArray<br>
        ^VMMaker<br>
                generate: interpreterClass<br>
+               and: SimpleStackBasedCogit<br>
-               and: StackToRegisterMappingCogit<br>
                with: optionsArray<br>
                to: (FileDirectory default pathFromURI: self sourceTree, &#39;/src&#39;)<br>
                platformDir: (FileDirectory default pathFromURI: self sourceTree, &#39;/platforms&#39;)<br>
                including:#()!<br>
<br>
Item was changed:<br>
  ----- Method: VMMaker class&gt;&gt;generateSqueakSpurCogVM (in category &#39;configurations&#39;) -----<br>
  generateSqueakSpurCogVM<br>
        &quot;No primitives since we can use those for the Cog VM&quot;<br>
        ^VMMaker<br>
                generate: CoInterpreter<br>
                and: StackToRegisterMappingCogit<br>
+               with: #(ObjectMemory Spur32BitCoMemoryManager<br>
+                               MULTIPLEBYTECODESETS true<br>
+                               bytecodeTableInitializer initializeBytecodeTableForSque<wbr>akV3PlusClosuresSistaV1Hybrid)<br>
-               with: #(ObjectMemory Spur32BitCoMemoryManager)<br>
                to: (FileDirectory default pathFromURI: self sourceTree, &#39;/spursrc&#39;)<br>
                platformDir: (FileDirectory default pathFromURI: self sourceTree, &#39;/platforms&#39;)<br>
                including:#()!<br>
<br>
</blockquote></div><br></div>