<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Ryan, sorry about the instability. &nbsp;It's just while I get the x64 JIT to work. &nbsp;I expect to have the builds fixed today (wed) or tmrw at the latest<br><br><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div><div><br>On Dec 13, 2015, at 6:27 PM, Ryan Macnak &lt;<a href="mailto:rmacnak@gmail.com">rmacnak@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr">JIT builds still <a href="https://travis-ci.org/newspeaklanguage/nsvm-linux-ci/jobs/96659717">failing</a>.<div><br></div>/home/travis/build/newspeaklanguage/nsvm-linux-ci/oscogvm/nsspursrc/vm/cogitIA32.c: In function ‘genNSSendnumArgsdepthsendTable’:<br>/home/travis/build/newspeaklanguage/nsvm-linux-ci/oscogvm/nsspursrc/vm/cogitIA32.c:23996:15: warning: assignment makes integer from pointer without a cast [enabled by default]<div>/home/travis/build/newspeaklanguage/nsvm-linux-ci/oscogvm/nsspursrc/vm/cogitIA32.c:23997:10: error: called object ‘selector’ is not a function<br>/home/travis/build/newspeaklanguage/nsvm-linux-ci/oscogvm/nsspursrc/vm/cogitIA32.c:23998:9: error: called object ‘numArgs’ is not a function<br>/home/travis/build/newspeaklanguage/nsvm-linux-ci/oscogvm/nsspursrc/vm/cogitIA32.c:23999:7: error: called object ‘depth’ is not a function</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 13, 2015 at 5:25 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1594.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1594.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-eem.1594<br>
Author: eem<br>
Time: 13 December 2015, 5:24:57.076 pm<br>
UUID: 79da8b81-d1f3-469a-869c-16c79d12649a<br>
Ancestors: VMMaker.oscog-eem.1593<br>
<br>
Cogit:<br>
Don't inline AndCq:R:R: because its translation contains a jump and hence won't work in a statement list expression (e.g. as in x86's genJumpSmallInteger:scratchReg:).<br>
<br>
Nuke genJump[Not]SmallInteger:scratch: in favour of genJump[Not]SmallInteger:scratchReg:<br>
<br>
Slang:<br>
Eliminate leaves in statement lists generated as expressions.<br>
<br>
=============== Diff against VMMaker.oscog-eem.1593 ===============<br>
<br>
Item was removed:<br>
- ----- Method: CogObjectRepresentation&gt;&gt;genJumpNotSmallInteger:scratch: (in category 'compile abstract instructions') -----<br>
- genJumpNotSmallInteger: aRegister scratch: scratchReg<br>
-&nbsp; &nbsp; &nbsp; &nbsp;"Generate a test for aRegister containing a SmallInteger and a jump if not, answering the jump.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; If necessary use scratch reg (since testing for SmallInteger may be destructive)."<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;returnTypeC: #'AbstractInstruction *'&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;| jumpNotInt |<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: true&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;var: 'jumpNotInt' type: #'AbstractInstruction *'&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpNotInt := self genJumpNotSmallInteger: aRegister.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpNotInt asInteger = UnimplementedOperation ifTrue:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[cogit MoveR: aRegister R: scratchReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpNotInt := self genJumpNotSmallIntegerInScratchReg: TempReg].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;^jumpNotInt!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentation&gt;&gt;genJumpNotSmallInteger:scratchReg: (in category 'compile abstract instructions') -----<br>
&nbsp; genJumpNotSmallInteger: aRegister scratchReg: scratch<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Generate a compare and branch to test if aRegister contains other than a SmallInteger.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Answer the jump.&nbsp; Use scratch if required.&nbsp; Subclasses will override if scratch is needed."<br>
+&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: true&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;returnTypeC: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^self genJumpNotSmallInteger: aRegister!<br>
<br>
Item was removed:<br>
- ----- Method: CogObjectRepresentation&gt;&gt;genJumpSmallInteger:scratch: (in category 'compile abstract instructions') -----<br>
- genJumpSmallInteger: aRegister scratch: scratchReg<br>
-&nbsp; &nbsp; &nbsp; &nbsp;"Generate a test for aRegister containing a SmallInteger and a jump if so, answering the jump.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; If necessary use scratch reg (since testing for SmallInteger may be destructive)."<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;returnTypeC: #'AbstractInstruction *'&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;| jumpInt |<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: true&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;var: 'jumpInt' type: #'AbstractInstruction *'&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpInt := self genJumpSmallInteger: aRegister.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpInt asInteger = UnimplementedOperation ifTrue:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[cogit MoveR: aRegister R: scratchReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpInt := self genJumpSmallIntegerInScratchReg: TempReg].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;^jumpInt!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentation&gt;&gt;genJumpSmallInteger:scratchReg: (in category 'compile abstract instructions') -----<br>
&nbsp; genJumpSmallInteger: aRegister scratchReg: scratch<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Generate a compare and branch to test if aRegister contains a SmallInteger.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Answer the jump.&nbsp; Use scratch if required.&nbsp; Subclasses will override if scratch is needed."<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;returnTypeC: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^self genJumpSmallInteger: aRegister!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentationFor32BitSpur&gt;&gt;genInnerPrimitiveAt: (in category 'primitive generators') -----<br>
&nbsp; genInnerPrimitiveAt: retNoffset<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Implement the guts of primitiveAt"<br>
&nbsp; &nbsp; &nbsp; &nbsp; | formatReg convertToIntAndReturn<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable jumpImmediate jumpBadIndex<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes jumpIsShorts jumpIsWords jumpWordTooBig jumpIsArray jumpHasFixedFields jumpIsContext<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds jumpShortsOutOfBounds jumpWordsOutOfBounds jumpArrayOutOfBounds jumpFixedFieldsOutOfBounds |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;inline: true&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; "c.f. StackInterpreter&gt;&gt;stSizeOf: SpurMemoryManager&gt;&gt;lengthOf:format: fixedFieldsOf:format:length:"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsBytes type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsShorts type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBadIndex type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsContext type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpImmediate type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpWordTooBig type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpNotIndexable type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpHasFixedFields type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #convertToIntAndReturn type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpArrayOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBytesOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpShortsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpWordsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpFixedFieldsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpImmediate := self genJumpImmediate: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: Arg0Reg R: Arg1Reg.<br>
+&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratch: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubCq: 1 R: Arg1Reg. "1-rel =&gt; 0-rel"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "formatReg := self formatOf: ReceiverResultReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetFormatOf: ReceiverResultReg<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; into: (formatReg := SendNumArgsReg)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leastSignificantHalfOfBaseHeaderIntoScratch: TempReg.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetNumSlotsOf: ReceiverResultReg into: ClassReg.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "dispatch on format in a combination of highest dynamic frequency order first and convenience.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 = 0 sized objects (UndefinedObject True False et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 = non-indexable objects with inst vars (Point et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 = indexable objects with no inst vars (Array et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 = weak indexable objects with inst vars (WeakArray et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 unused, reserved for exotic pointer objects?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 Forwarded Object, 1st field is pointer, rest of fields are ignored<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 unused, reserved for exotic non-pointer objects?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9 (?) 64-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10 - 11 32-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12 - 15 16-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 - 23 byte indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24 - 31 compiled method"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstByteFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory arrayFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsArray := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable := cogit JumpBelow: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory weakArrayFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpHasFixedFields := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstShortFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsShorts := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstLongFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsWords := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "For now ignore 64-bit indexability."<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable jmpTarget: cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable := cogit Jump: 0.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit LogicalShiftLeftCq: objectMemory shiftForWord R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: objectMemory wordSize - 1 R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit backEnd byteReadsZeroExtend<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cogit MoveXbr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg]<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFalse:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cogit "formatReg already contains a value &lt;= 16r1f, so no need to zero it"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MoveXbr: Arg1Reg R: ReceiverResultReg R: formatReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MoveR: formatReg R: ReceiverResultReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; convertToIntAndReturn := cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertIntegerToSmallIntegerInReg: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsShorts jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit LogicalShiftLeftCq: objectMemory shiftForWord - 1 R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: 1 R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpShortsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: Arg1Reg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveM16: objectMemory baseHeaderSize r: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit Jump: convertToIntAndReturn.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsWords jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpR: Arg1Reg R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpWordsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXwr: Arg1Reg R: ReceiverResultReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpWordTooBig := self jumpNotSmallIntegerUnsignedValueInRegister: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: TempReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit Jump: convertToIntAndReturn.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpHasFixedFields jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit AndCq: objectMemory classIndexMask R: TempReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: TempReg R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: ClassMethodContextCompactIndex R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsContext := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit PushR: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetClassObjectOfClassIndex: formatReg into: ClassReg scratchReg: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genLoadSlot: InstanceSpecificationIndex sourceReg: ClassReg destReg: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit PopR: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AndCq: objectMemory fixedFieldsOfClassFormatMask R: formatReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFixedFieldsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "index is (formatReg (fixed fields) + Arg1Reg (0-rel index)) * wordSize + baseHeaderSize"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: formatReg R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXwr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsArray jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpR: Arg1Reg R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpArrayOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXwr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFixedFieldsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpArrayOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpBytesOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpShortsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpWordsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpWordTooBig jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpNotIndexable jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpIsContext jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpBadIndex jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpImmediate jmpTarget: cogit Label))))))))).<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^0!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentationFor64BitSpur&gt;&gt;genInnerPrimitiveAt: (in category 'primitive generators') -----<br>
&nbsp; genInnerPrimitiveAt: retNoffset<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Implement the guts of primitiveAt"<br>
&nbsp; &nbsp; &nbsp; &nbsp; | formatReg convertToIntAndReturn<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable jumpImmediate jumpBadIndex<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes jumpIsShorts jumpIsWords jumpIsArray jumpHasFixedFields jumpIsContext<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds jumpShortsOutOfBounds jumpWordsOutOfBounds jumpArrayOutOfBounds jumpFixedFieldsOutOfBounds |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;inline: true&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; "c.f. StackInterpreter&gt;&gt;stSizeOf: SpurMemoryManager&gt;&gt;lengthOf:format: fixedFieldsOf:format:length:"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsBytes type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsShorts type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBadIndex type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsContext type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpImmediate type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpNotIndexable type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpHasFixedFields type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #convertToIntAndReturn type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpArrayOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBytesOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpShortsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpWordsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpFixedFieldsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpImmediate := self genJumpImmediate: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: Arg0Reg R: Arg1Reg.<br>
+&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratch: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubCq: 1 R: Arg1Reg. "1-rel =&gt; 0-rel"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "formatReg := self formatOf: ReceiverResultReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetFormatOf: ReceiverResultReg<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; into: (formatReg := SendNumArgsReg)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leastSignificantHalfOfBaseHeaderIntoScratch: TempReg.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetNumSlotsOf: ReceiverResultReg into: ClassReg.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "dispatch on format in a combination of highest dynamic frequency order first and convenience.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 = 0 sized objects (UndefinedObject True False et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 = non-indexable objects with inst vars (Point et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 = indexable objects with no inst vars (Array et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 = weak indexable objects with inst vars (WeakArray et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 unused, reserved for exotic pointer objects?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 Forwarded Object, 1st field is pointer, rest of fields are ignored<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 unused, reserved for exotic non-pointer objects?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9 (?) 64-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10 - 11 32-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12 - 15 16-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 - 23 byte indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24 - 31 compiled method"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstByteFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory arrayFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsArray := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable := cogit JumpBelow: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory weakArrayFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpHasFixedFields := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstShortFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsShorts := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstLongFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsWords := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "For now ignore 64-bit indexability."<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable jmpTarget: cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable := cogit Jump: 0.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit LogicalShiftLeftCq: objectMemory shiftForWord R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: objectMemory wordSize - 1 R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit backEnd byteReadsZeroExtend<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cogit MoveXbr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg]<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFalse:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cogit "formatReg already contains a value &lt;= 16r1f, so no need to zero it"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MoveXbr: Arg1Reg R: ReceiverResultReg R: formatReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MoveR: formatReg R: ReceiverResultReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; convertToIntAndReturn := cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertIntegerToSmallIntegerInReg: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsShorts jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit LogicalShiftLeftCq: objectMemory shiftForWord - 1 R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: 1 R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpShortsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: Arg1Reg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveM16: objectMemory baseHeaderSize r: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit Jump: convertToIntAndReturn.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsWords jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpR: Arg1Reg R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpWordsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt;&nbsp; (objectMemory shiftForWord - 1) R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveX32r: Arg1Reg R: ReceiverResultReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: TempReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit Jump: convertToIntAndReturn.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpHasFixedFields jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit AndCq: objectMemory classIndexMask R: TempReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: TempReg R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: ClassMethodContextCompactIndex R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsContext := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetClassObjectOfClassIndex: formatReg into: Scratch0Reg scratchReg: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genLoadSlot: InstanceSpecificationIndex sourceReg: Scratch0Reg destReg: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AndCq: objectMemory fixedFieldsOfClassFormatMask R: formatReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFixedFieldsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "index is (formatReg (fixed fields) + Arg1Reg (0-rel index)) * wordSize + baseHeaderSize"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: formatReg R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXwr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsArray jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpR: Arg1Reg R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpArrayOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXwr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFixedFieldsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpArrayOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpBytesOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpShortsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpWordsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpNotIndexable jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpIsContext jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpBadIndex jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpImmediate jmpTarget: cogit Label)))))))).<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^0!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentationFor64BitSpur&gt;&gt;genInnerPrimitiveNewWithArg: (in category 'primitive generators') -----<br>
&nbsp; genInnerPrimitiveNewWithArg: retNoffset<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Implement primitiveNewWithArg for convenient cases:<br>
&nbsp; &nbsp; &nbsp; &nbsp; - the receiver has a hash<br>
&nbsp; &nbsp; &nbsp; &nbsp; - the receiver is variable and not compiled method<br>
&nbsp; &nbsp; &nbsp; &nbsp; - single word header/num slots &lt; numSlotsMask<br>
&nbsp; &nbsp; &nbsp; &nbsp; - the result fits in eden<br>
&nbsp; &nbsp; &nbsp; &nbsp; See superclass method for dynamic frequencies of formats.<br>
&nbsp; &nbsp; &nbsp; &nbsp; For the moment we implement only arrayFormat, firstByteFormat &amp; firstLongFormat"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; | headerReg fillReg instSpecReg byteSizeReg maxSlots<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpArrayTooBig jumpByteTooBig jumpLongTooBig<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpArrayFormat jumpByteFormat jumpBytePrepDone jumpLongPrepDone<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpUnhashed jumpNElementsNonInt jumpFailCuzFixed jumpNoSpace jumpHasSlots fillLoop skip |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'skip' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'fillLoop' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpHasSlots' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpNoSpace' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpUnhashed' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpByteFormat' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpByteTooBig' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpLongTooBig' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpArrayFormat' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpArrayTooBig' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpFailCuzFixed' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpBytePrepDone' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpLongPrepDone' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpNElementsNonInt' type: #'AbstractInstruction *'&gt;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "header will contain classIndex/class's hash &amp; format &amp; numSlots/fixed size"<br>
&nbsp; &nbsp; &nbsp; &nbsp; headerReg := SendNumArgsReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Assume there's an available scratch register on 64-bit machines.&nbsp; This holds the saved numFixedFileds and then the value to fill with"<br>
&nbsp; &nbsp; &nbsp; &nbsp; fillReg := Scratch0Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self assert: (cogit backEnd concreteRegister: fillReg) &gt; 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "inst spec will hold class's instance specification and then byte size"<br>
&nbsp; &nbsp; &nbsp; &nbsp; instSpecReg := byteSizeReg := ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "The max slots we'll allocate here are those for a single header"<br>
&nbsp; &nbsp; &nbsp; &nbsp; maxSlots := objectMemory numSlotsMask - 1.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get freeStart as early as possible so as not to wait later..."<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveAw: objectMemory freeStartAddress R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get class's hash &amp; fail if 0"<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetHashFieldNonImmOf: ReceiverResultReg into: headerReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpUnhashed := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get index and fail if not a +ve integer"<br>
+&nbsp; &nbsp; &nbsp; &nbsp;jumpNElementsNonInt := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpNElementsNonInt := self genJumpNotSmallInteger: Arg0Reg scratch: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get class's format inst var for inst spec (format field)"<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genLoadSlot: InstanceSpecificationIndex sourceReg: ReceiverResultReg destReg: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftRightCq: objectMemory fixedFieldsFieldWidth + self numSmallIntegerTagBits R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: objectMemory formatMask R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Add format to classIndex/format header now"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: instSpecReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftLeftCq: objectMemory formatShift R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: TempReg R: headerReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get integer value of num fields in fillReg now"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: Arg0Reg R: fillReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: fillReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "dispatch on format, failing if not variable or if compiled method"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory arrayFormat R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpArrayFormat := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstByteFormat R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpByteFormat := cogit JumpZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstLongFormat R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailCuzFixed := cogit JumpNonZero: 0.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: (objectMemory integerObjectOf: maxSlots * 2) R: Arg0Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpLongTooBig := cogit JumpAbove: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "save num elements/slot size to instSpecReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: fillReg R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "compute odd bits and add into headerReg; oddBits := 2 - nElements bitAnd: 1"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveCq: objectMemory wordSize / 4 R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: instSpecReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: objectMemory wordSize / 4 - 1 R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftLeftCq: objectMemory formatShift R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: TempReg R: headerReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "round up num elements to numSlots in instSpecReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory wordSize / 4 - 1 R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftRightCq: objectMemory shiftForWord - 2 R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveCq: 0 R: fillReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpLongPrepDone := cogit Jump: 0. "go allocate"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpByteFormat jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpCq: (objectMemory integerObjectOf: maxSlots * objectMemory wordSize) R: Arg0Reg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpByteTooBig := cogit JumpAbove: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "save num elements to instSpecReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: fillReg R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "compute odd bits and add into headerReg; oddBits := 4 - nElements bitAnd: 3"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveCq: objectMemory wordSize R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: instSpecReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: objectMemory wordSize - 1 R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftLeftCq: objectMemory formatShift R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: TempReg R: headerReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "round up num elements to numSlots in instSpecReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory wordSize - 1 R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftRightCq: objectMemory shiftForWord R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveCq: 0 R: fillReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBytePrepDone := cogit Jump: 0. "go allocate"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpArrayFormat jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpCq: (objectMemory integerObjectOf: maxSlots) R: Arg0Reg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpArrayTooBig := cogit JumpAbove: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "save num elements/slot size to instSpecReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: fillReg R: instSpecReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveCq: objectMemory nilObject R: fillReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "fall through to allocate"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBytePrepDone jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpLongPrepDone jmpTarget: cogit Label).<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "store numSlots to headerReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: instSpecReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftLeftCq: objectMemory numSlotsFullShift R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: TempReg R: headerReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "compute byte size; remember 0-sized objects still need 1 slot."<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: 0 R: byteSizeReg. "a.k.a. instSpecReg"<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpHasSlots := cogit JumpNonZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveCq: objectMemory baseHeaderSize * 2 R: byteSizeReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; skip := cogit Jump: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpHasSlots jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (cogit AddCq: objectMemory baseHeaderSize / objectMemory wordSize R: byteSizeReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LogicalShiftLeftCq: objectMemory shiftForWord R: byteSizeReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; skip jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; "check if allocation fits"<br>
&nbsp; &nbsp; &nbsp; &nbsp; (cogit AddR: Arg1Reg R: byteSizeReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory getScavengeThreshold R: byteSizeReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNoSpace := cogit JumpAboveOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get result, increment freeStart and write it back. Arg1Reg holds new freeStart, the limit of the object"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: Arg1Reg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: byteSizeReg Aw: objectMemory freeStartAddress.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "write other half of header (numSlots/0 identityHash)"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: headerReg Mw: 0 r: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "now fill"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit LoadEffectiveAddressMw: objectMemory baseHeaderSize r: ReceiverResultReg R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; fillLoop :=<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: fillReg Mw: 0 r: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: 8 R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpR: Arg1Reg R: byteSizeReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit JumpAbove: fillLoop.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNoSpace jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpUnhashed jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpFailCuzFixed jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpArrayTooBig jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpByteTooBig jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpLongTooBig jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpNElementsNonInt jmpTarget: cogit Label)))))).<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^0!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentationForSpur&gt;&gt;genInnerPrimitiveAsCharacter:inReg: (in category 'primitive generators') -----<br>
&nbsp; genInnerPrimitiveAsCharacter: retNOffset inReg: reg<br>
&nbsp; &nbsp; &nbsp; &nbsp; | jumpNotInt jumpOutOfRange |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpNotInt' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'jumpOutOfRange' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; reg ~= ReceiverResultReg ifTrue:<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[jumpNotInt := self genJumpNotSmallInteger: reg scratchReg: TempReg].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[jumpNotInt := self genJumpNotSmallInteger: reg scratch: TempReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: reg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: 1 &lt;&lt; 30 - 1 R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpOutOfRange := cogit JumpAbove: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToCharacterInReg: reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; reg ~= ReceiverResultReg ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cogit MoveR: reg R: ReceiverResultReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNOffset.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpOutOfRange jmpTarget: cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; reg ~= ReceiverResultReg ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [jumpNotInt jmpTarget: jumpOutOfRange getJmpTarget].<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^0!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentationForSpur&gt;&gt;genInnerPrimitiveObjectAt: (in category 'primitive generators') -----<br>
&nbsp; genInnerPrimitiveObjectAt: retNOffset<br>
&nbsp; &nbsp; &nbsp; &nbsp; | headerReg<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpBadIndex jumpNotCogMethod jumpBounds jumpNotHeaderIndex |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBadIndex type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpNotCogMethod type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpNotHeaderIndex type: #'AbstractInstruction *'&gt;<br>
+&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratch: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "get header into Arg1Reg..."<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveMw: objectMemory baseHeaderSize r: ReceiverResultReg R: (headerReg := Arg1Reg).<br>
+&nbsp; &nbsp; &nbsp; &nbsp;jumpNotCogMethod := self genJumpSmallInteger: headerReg scratchReg: TempReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpNotCogMethod := self genJumpSmallInteger: headerReg scratch: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveMw: (cogit offset: CogMethod of: #methodHeader) r: headerReg R: headerReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotCogMethod jmpTarget: (cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpCq: (objectMemory integerObjectOf: 1) R: Arg0Reg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotHeaderIndex := cogit JumpNonZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MoveR: headerReg R: ReceiverResultReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RetN: retNOffset.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotHeaderIndex jmpTarget: (cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AndCq: (objectMemory integerObjectOf: coInterpreter alternateHeaderNumLiteralsMask) R: headerReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SubCq: (objectMemory integerObjectOf: 1) - objectMemory smallIntegerTag R: Arg0Reg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: headerReg R: Arg0Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBounds := cogit JumpAbove: 0.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: Arg0Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg0Reg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MoveXwr: Arg0Reg R: ReceiverResultReg R: ReceiverResultReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RetN: retNOffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBounds jmpTarget: (cogit<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddCq: (objectMemory integerObjectOf: 1) - objectMemory smallIntegerTag R: Arg0Reg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBadIndex jmpTarget: cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^CompletePrimitive!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: CogObjectRepresentationForSpur&gt;&gt;genInnerPrimitiveStringAt: (in category 'primitive generators') -----<br>
&nbsp; genInnerPrimitiveStringAt: retNoffset<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Implement the guts of primitiveStringAt; dispatch on size"<br>
&nbsp; &nbsp; &nbsp; &nbsp; | formatReg jumpNotIndexable jumpBadIndex done<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes jumpIsShorts jumpIsWords jumpWordTooBig<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds jumpShortsOutOfBounds jumpWordsOutOfBounds |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;inline: true&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; "c.f. StackInterpreter&gt;&gt;stSizeOf: SpurMemoryManager&gt;&gt;lengthOf:format: fixedFieldsOf:format:length:"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #done type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsBytes type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsShorts type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpIsWords type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBadIndex type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpWordTooBig type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpNotIndexable type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpBytesOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpShortsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpWordsOutOfBounds type: #'AbstractInstruction *'&gt;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: Arg0Reg R: Arg1Reg.<br>
+&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg.<br>
-&nbsp; &nbsp; &nbsp; &nbsp;jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratch: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertSmallIntegerToIntegerInReg: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubCq: 1 R: Arg1Reg. "1-rel =&gt; 0-rel"<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetFormatOf: ReceiverResultReg<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; into: (formatReg := SendNumArgsReg)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leastSignificantHalfOfBaseHeaderIntoScratch: NoReg.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genGetNumSlotsOf: ReceiverResultReg into: ClassReg.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; "dispatch on format in a combination of highest dynamic frequency order first and convenience.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 = 0 sized objects (UndefinedObject True False et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 = non-indexable objects with inst vars (Point et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 = indexable objects with no inst vars (Array et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 = weak indexable objects with inst vars (WeakArray et al)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 unused, reserved for exotic pointer objects?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 Forwarded Object, 1st field is pointer, rest of fields are ignored<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 unused, reserved for exotic non-pointer objects?<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9 (?) 64-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10 - 11 32-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12 - 15 16-bit indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 - 23 byte indexable<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24 - 31 compiled method"<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstByteFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes := cogit JumpGreaterOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstShortFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsShorts := cogit JumpGreaterOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit CmpCq: objectMemory firstLongFormat R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsWords := cogit JumpGreaterOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpNotIndexable := cogit Jump: 0.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsBytes jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit LogicalShiftLeftCq: objectMemory shiftForWord R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: objectMemory wordSize - 1 R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXbr: Arg1Reg R: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit backEnd byteReadsZeroExtend ifFalse:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cogit AndCq: 255 R: ReceiverResultReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; done := cogit Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self genConvertIntegerToCharacterInReg: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit RetN: retNoffset.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsShorts jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit LogicalShiftLeftCq: objectMemory shiftForWord - 1 R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit AndCq: 1 R: formatReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cogit SubR: formatReg R: ClassReg;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmpR: Arg1Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpShortsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddR: Arg1Reg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveM16: objectMemory baseHeaderSize r: ReceiverResultReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit Jump: done.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpIsWords jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (cogit CmpR: Arg1Reg R: ClassReg).<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpWordsOutOfBounds := cogit JumpBelowOrEqual: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit AddCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveXwr: Arg1Reg R: ReceiverResultReg R: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit SubCq: objectMemory baseHeaderSize &gt;&gt; objectMemory shiftForWord R: Arg1Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpWordTooBig := self jumpNotCharacterUnsignedValueInRegister: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit MoveR: TempReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; cogit Jump: done.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpBytesOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpShortsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpWordsOutOfBounds jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpWordTooBig jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpNotIndexable jmpTarget:<br>
&nbsp; &nbsp; &nbsp; &nbsp; (jumpBadIndex jmpTarget: cogit Label))))).<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^0!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: Cogit&gt;&gt;AndCq:R:R: (in category 'abstract instructions') -----<br>
&nbsp; AndCq: quickConstant R: srcReg R: destReg<br>
+&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: false&gt;<br>
-&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: true&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;returnTypeC: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; | first |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: 'first' type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; backEnd hasThreeAddressArithmetic ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [^self gen: AndCqRR quickConstant: quickConstant operand: srcReg operand: destReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; srcReg = destReg ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [^self gen: AndCqR quickConstant: quickConstant operand: destReg.].<br>
&nbsp; &nbsp; &nbsp; &nbsp; first := self gen: MoveRR operand: srcReg operand: destReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self gen: AndCqR quickConstant: quickConstant operand: destReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^first!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: OutOfLineLiteralsManager&gt;&gt;checkQuickConstant:forInstruction: (in category 'compile abstract instructions') -----<br>
&nbsp; checkQuickConstant: literal forInstruction: anInstruction<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #anInstruction type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;returnTypeC: #'AbstractInstruction *'&gt;<br>
+&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: true&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; anInstruction usesOutOfLineLiteral ifTrue:<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[anInstruction dependent: (self locateLiteral: (self cCode: [literal] inSmalltalk: [literal bitAnd: 1 &lt;&lt; (objectMemory wordSize * 8) - 1]))].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[anInstruction dependent: (self locateLiteral: (self cCode: [literal] inSmalltalk: [literal bitAnd: 16rFFFFFFFF]))].<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^anInstruction!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: StackToRegisterMappingCogit&gt;&gt;genDoubleArithmetic:preOpCheck: (in category 'primitive generators') -----<br>
&nbsp; genDoubleArithmetic: arithmeticOperator preOpCheck: preOpCheckOrNil<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Receiver and arg in registers.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Stack looks like<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return address"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #preOpCheckOrNil declareC: 'AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; | jumpFailClass jumpFailClass2 jumpFailAlloc jumpFailCheck jumpImmediate jumpNonInt doOp |<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpFailClass type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpFailClass2 type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpFailAlloc type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpImmediate type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpNonInt type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #jumpFailCheck type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;var: #doOp type: #'AbstractInstruction *'&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation genGetDoubleValueOf: ReceiverResultReg into: DPFPReg0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self MoveR: Arg0Reg R: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpImmediate := objectRepresentation genJumpImmediate: Arg0Reg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation genGetCompactClassIndexNonImmOf: Arg0Reg into: SendNumArgsReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation genCmpClassFloatCompactIndexR: SendNumArgsReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailClass := self JumpNonZero: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation genGetDoubleValueOf: Arg0Reg into: DPFPReg1.<br>
&nbsp; &nbsp; &nbsp; &nbsp; doOp := self Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; preOpCheckOrNil ifNotNil:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [jumpFailCheck := self perform: preOpCheckOrNil with: DPFPReg0 with: DPFPReg1].<br>
&nbsp; &nbsp; &nbsp; &nbsp; self gen: arithmeticOperator operand: DPFPReg1 operand: DPFPReg0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailAlloc := objectRepresentation<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; genAllocFloatValue: DPFPReg0<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; into: SendNumArgsReg<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scratchReg: ClassReg<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scratchReg: TempReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self MoveR: SendNumArgsReg R: ReceiverResultReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self RetN: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpImmediate jmpTarget: self Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation maybeGenConvertIfSmallFloatIn: Arg0Reg scratchReg: TempReg into: DPFPReg1 andJumpTo: doOp.<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation smallIntegerIsOnlyImmediateType ifFalse:<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[jumpNonInt := objectRepresentation genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[jumpNonInt := objectRepresentation genJumpNotSmallInteger: Arg0Reg scratch: TempReg].<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation genConvertSmallIntegerToIntegerInReg: ClassReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self ConvertR: ClassReg Rd: DPFPReg1.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self Jump: doOp.<br>
&nbsp; &nbsp; &nbsp; &nbsp; "We need to push the register args on two paths; this one and the interpreter primitive path.<br>
&nbsp; &nbsp; &nbsp; &nbsp; But the interpreter primitive path won't unless regArgsHaveBeenPushed is false."<br>
&nbsp; &nbsp; &nbsp; &nbsp; self assert: methodOrBlockNumArgs &lt;= self numRegArgs.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailClass jmpTarget: self Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; objectRepresentation smallIntegerIsOnlyImmediateType ifFalse:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [jumpNonInt jmpTarget: jumpFailClass getJmpTarget].<br>
&nbsp; &nbsp; &nbsp; &nbsp; preOpCheckOrNil ifNotNil:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [jumpFailCheck jmpTarget: jumpFailClass getJmpTarget].<br>
&nbsp; &nbsp; &nbsp; &nbsp; backEnd genPushRegisterArgsForNumArgs: methodOrBlockNumArgs scratchReg: SendNumArgsReg.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailClass2 := self Jump: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailAlloc jmpTarget: self Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; self compileFallbackToInterpreterPrimitive: 0.<br>
&nbsp; &nbsp; &nbsp; &nbsp; jumpFailClass2 jmpTarget: self Label.<br>
&nbsp; &nbsp; &nbsp; &nbsp; ^0!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: TReturnNode&gt;&gt;emitCCodeOn:level:generator: (in category 'C code generation') -----<br>
&nbsp; emitCCodeOn: aStream level: level generator: aCodeGen<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; (expression isSwitch<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [expression isCaseStmt]) ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [^expression emitCCodeOn: aStream addToEndOfCases: self level: level generator: aCodeGen].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; (expression isSend and: [expression isValueExpansion]) ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [^self emitValueExpansionOn: aStream level: level generator: aCodeGen].<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; 'void' = aCodeGen currentMethod returnType ifTrue: "If the function is void, don't say 'return x' instead say ' x; return' "<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [expression isLeaf ifFalse:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [expression emitCCodeAsArgumentOn: aStream level: level generator: aCodeGen.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aStream nextPut: $;; crtab: level].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aStream nextPutAll: 'return'.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^self].<br>
&nbsp; &nbsp; &nbsp; &nbsp; aStream nextPutAll: 'return '.<br>
+&nbsp; &nbsp; &nbsp; &nbsp;expression<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;emitCCodeAsArgumentOn: aStream<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;level: (expression isStmtList ifTrue: [level + 1] ifFalse: [level])<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generator: aCodeGen!<br>
-&nbsp; &nbsp; &nbsp; &nbsp;expression emitCCodeAsArgumentOn: aStream level: level generator: aCodeGen!<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: TStmtListNode&gt;&gt;emitCCodeAsArgumentOn:level:generator: (in category 'C code generation') -----<br>
&nbsp; emitCCodeAsArgumentOn: aStream level: level generator: aCodeGen<br>
+&nbsp; &nbsp; &nbsp; &nbsp;| size |<br>
+&nbsp; &nbsp; &nbsp; &nbsp;(size := statements size) = 1 ifTrue:<br>
-<br>
-&nbsp; &nbsp; &nbsp; &nbsp;| statementWasComment |<br>
-&nbsp; &nbsp; &nbsp; &nbsp;statements size = 1 ifTrue:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [^statements first emitCCodeAsArgumentOn: aStream level: level generator: aCodeGen].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;statementWasComment := false.<br>
&nbsp; &nbsp; &nbsp; &nbsp; aStream nextPut: $(. "N.B.&nbsp; Comma binds weakest of all C operators."<br>
+&nbsp; &nbsp; &nbsp; &nbsp;statements withIndexDo:<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[:s :idx| | p1 p2 |<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p1 := aStream position.<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s emitCCommentOn: aStream level: level.<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(s isLeaf and: [s isLabel not and: [idx &lt; statements size]]) ifFalse:<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[s emitCCodeAsArgumentOn: aStream level: level + 1 generator: aCodeGen].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p2 := aStream position.<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(idx &lt; size and: [p2 &gt; p1]) ifTrue:<br>
-&nbsp; &nbsp; &nbsp; &nbsp;statements<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;do:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[:s |<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s emitCCommentOn: aStream level: level.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s emitCCodeAsArgumentOn: aStream level: level + 1 generator: aCodeGen.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;statementWasComment := s isComment]<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;separatedBy:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [((self endsWithCloseBracket: aStream)<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [s isComment]) ifFalse: [aStream nextPut: $,].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aStream crtab: level]].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or: [statementWasComment]) ifFalse: [aStream nextPut: $,].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aStream crtab: level].<br>
&nbsp; &nbsp; &nbsp; &nbsp; aStream nextPut: $)!<br>
<br>
</blockquote></div><br></div>
</div></blockquote></body></html>