<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-04-08 2:26 GMT+02:00  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span>:<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.1779.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1779.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-eem.1779<br>
Author: eem<br>
Time: 7 April 2016, 5:26:14.093395 pm<br>
UUID: eb3139fc-9d6f-432c-83b9-099675dcb37d<br>
Ancestors: VMMaker.oscog-eem.1778<br>
<br>
Fix simulation of the LargeIntegersPlugin.  The issue is that interpreterProxy firstIndexableField: answers a CArray whose unitSize reflects the object&#39;s unit size, and becuase LargeIntegers are byte objects, the CArray is a byte accssor by default.  So add InterpreterPlugin&gt;&gt;firstIndexableField:as:, which uses cCoerce:to: to provide a CArray typed as requested, and use it everywhere the LargeIntegersPlugin takes the firstIndexableField of a LargeInteger, and cast to #&#39;unsigned int *&#39;.<br>
<br>
Go some way to speed up the warppers by<br>
a) improving CArray&gt;at:[put:] to assume unitSize is a suitable power of two, and<br>
b) add CFloatArray to access float or double<br>
<br>
Later on we can add CUnsignedIntegerArray, as required.<br>
<br>
<br>
N.B.  While this fixes simulation of the LargeIntegerPlugin there is still something wrong under simulation in whatever produces large fonts.  Start up the Squeak 5.0 release image with the &quot;Squeak 5.0 Release Notes&quot; text in huge letters in a workspace towards the front and you&#39;ll notice that in the simulator none of the large fonts are displayed, although the text from &quot;Fast Become&quot; works fine.<br>
<br>
=============== Diff against VMMaker.oscog-eem.1778 ===============<br>
<br>
Item was changed:<br>
  ----- Method: CArray&gt;&gt;at: (in category &#39;accessing&#39;) -----<br>
  at: offset<br>
+       | address |<br>
+       address := unitSize * offset + self ptrAddress.<br>
+       ^unitSize &lt;= 2<br>
+               ifTrue:<br>
+                       [unitSize = 1<br>
+                               ifTrue: [interpreter byteAt: address]<br>
+                               ifFalse: [interpreter shortAt: address]]<br>
+               ifFalse:<br>
+                       [unitSize = 4<br>
+                               ifTrue: [interpreter long32At: address]<br>
+                               ifFalse: [interpreter long64At: address]]!<br>
-       | ptrAddress |<br>
-       ptrAddress := self ptrAddress.<br>
-       unitSize = 1 ifTrue: [^ interpreter byteAt: ptrAddress + offset].<br>
-       unitSize = 2 ifTrue: [^ interpreter shortAt: ptrAddress + (offset * 2)].<br>
-       unitSize = 4 ifTrue: [^ interpreter long32At: ptrAddress + (offset * 4)].<br>
-       unitSize = 8 ifTrue: [^ interpreter long64At: ptrAddress + (offset * 8)].<br>
-       self halt: &#39;Can&#39;&#39;t handle unitSize &#39;, unitSize printString!<br>
<br>
Item was changed:<br>
  ----- Method: CArray&gt;&gt;at:put: (in category &#39;accessing&#39;) -----<br>
  at: offset put: val<br>
+       | address |<br>
+       address := unitSize * offset + self ptrAddress.<br>
+       ^unitSize &lt;= 2<br>
+               ifTrue:<br>
+                       [unitSize = 1<br>
+                               ifTrue: [interpreter byteAt: address put: val]<br>
+                               ifFalse: [interpreter shortAt: address put: val]]<br>
+               ifFalse:<br>
+                       [unitSize = 4<br>
+                               ifTrue: [interpreter long32At: address put: val]<br>
+                               ifFalse: [interpreter long64At: address put: val]]!<br>
-       | ptrAddress |<br>
-       ptrAddress := self ptrAddress.<br>
-       unitSize = 1 ifTrue: [^ interpreter byteAt: ptrAddress + offset put: val].<br>
-       unitSize = 2 ifTrue: [^ interpreter byteAt: ptrAddress + (offset * 2) put: val].<br>
-       unitSize = 4 ifTrue: [^ interpreter long32At: ptrAddress + (offset * 4) put: val].<br>
-       unitSize = 8 ifTrue: [^ interpreter long64At: ptrAddress + (offset * 8) put: val].<br>
-       self halt: &#39;Can&#39;&#39;t handle unitSize &#39;, unitSize printString!<br>
<br>
Item was changed:<br>
  ----- Method: CArray&gt;&gt;interpreter:address:unitSize: (in category &#39;private&#39;) -----<br>
  interpreter: interpreterSimulator address: arrayAddress unitSize: numBytes<br>
<br>
        interpreter := interpreterSimulator.<br>
        arrayBaseAddress := arrayAddress.<br>
+       self unitSize: numBytes.<br>
+       ptrOffset := 0!<br>
-       unitSize := numBytes.<br>
-       ptrOffset := 0.<br>
- !<br>
<br>
Item was changed:<br>
  ----- Method: CArray&gt;&gt;unitSize: (in category &#39;accessing&#39;) -----<br>
  unitSize: n<br>
+       (n isPowerOfTwo and: [n &lt;= 8]) ifFalse:<br>
+               [self error: &#39;unitSize must be 1, 2, 4 or 8&#39;].<br>
        unitSize := n!<br>
<br>
Item was added:<br>
+ CArray subclass: #CFloatArray<br>
+       instanceVariableNames: &#39;&#39;<br>
+       classVariableNames: &#39;&#39;<br>
+       poolDictionaries: &#39;&#39;<br>
+       category: &#39;VMMaker-InterpreterSimulation&#39;!<br>
+<br>
+ !CFloatArray commentStamp: &#39;eem 4/7/2016 09:39&#39; prior: 0!<br>
+ A CFloatArray is a subclass of CArray that provides access via C float or double values!<br>
<br>
Item was added:<br>
+ ----- Method: CFloatArray&gt;&gt;at: (in category &#39;accessing&#39;) -----<br>
+ at: offset<br>
+       | address |<br>
+       address := unitSize * offset + self ptrAddress.<br>
+       ^unitSize &gt;= 4<br>
+               ifTrue:<br>
+                       [unitSize = 4<br>
+                               ifTrue: [Float fromIEEE32Bit: (interpreter long32At: address)]<br>
+                               ifFalse: [Float fromIEEE64BitWord: (interpreter long64At: address)]]<br>
+               ifFalse:<br>
+                       [self error: &#39;unitSize must be 4 or 8&#39;]!<br>
<br>
Item was added:<br>
+ ----- Method: CFloatArray&gt;&gt;at:put: (in category &#39;accessing&#39;) -----<br>
+ at: offset put: val<br>
+       | address |<br>
+       address := unitSize * offset + self ptrAddress.<br>
+       ^unitSize &gt;= 4<br>
+               ifTrue:<br>
+                       [unitSize = 4<br>
+                               ifTrue: [interpreter long32At: address put: val]<br>
+                               ifFalse: [interpreter long64At: address put: val]]<br>
+               ifFalse:<br>
+                       [self error: &#39;unitSize must be 4 or 8&#39;]!<br>
<br>
Item was changed:<br>
  ----- Method: Integer&gt;&gt;coerceTo:sim: (in category &#39;*VMMaker-interpreter simulator&#39;) -----<br>
  coerceTo: cTypeString sim: interpreter<br>
<br>
        | unitSize |<br>
        cTypeString last = $* ifTrue:  &quot;C pointer&quot;<br>
                [unitSize := cTypeString caseOf: {<br>
                [&#39;char *&#39;] -&gt; [1].<br>
                [&#39;short *&#39;] -&gt; [2].<br>
                [&#39;int *&#39;] -&gt; [4].<br>
+               [&#39;float *&#39;] -&gt; [^CFloatArray basicNew interpreter: interpreter address: self unitSize: 4; yourself].<br>
+               [&#39;double *&#39;] -&gt; [^CFloatArray basicNew interpreter: interpreter address: self unitSize: 8; yourself].<br>
-               [&#39;long *&#39;] -&gt; [interpreter wordSize].<br></blockquote><div><br></div><div>Hi Eliot,<br></div><div>I presume you suppressed long * and do not need unsigned long * because they are handled in otherwise.<br></div><div>But there&#39;s also no (unsigned) long long * / (u)sqLong *<br></div><div>We never coerce to these types (or only inside cCode: []), or this is handled elsewhere?<br></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-               [&#39;float *&#39;] -&gt; [4].<br>
-               [&#39;double *&#39;] -&gt; [8].<br>
                [&#39;unsigned *&#39;] -&gt; [4].<br>
                [&#39;unsigned int *&#39;] -&gt; [4].<br>
+               [&#39;unsigned char *&#39;] -&gt; [1].<br>
+               [&#39;signed char *&#39;] -&gt; [1].<br>
+               [&#39;unsigned short *&#39;] -&gt; [2].<br>
-               [&#39;unsigned char *&#39;] -&gt; [4].<br>
-               [&#39;unsigned short *&#39;] -&gt; [4].<br>
                [&#39;oop *&#39;] -&gt; [interpreter bytesPerOop].<br>
                }<br>
+               otherwise: [interpreter wordSize].<br>
-               otherwise: [ (cTypeString beginsWith: &#39;char&#39;) ifTrue: [1] ifFalse: [interpreter wordSize] ].<br>
                ^CArray basicNew<br>
                        interpreter: interpreter address: self unitSize: unitSize;<br>
                        yourself].<br>
+       ^self  &quot;C number (int, char, float, etc)&quot;!<br>
-       ^ self  &quot;C number (int, char, float, etc)&quot;!<br>
<br>
Item was added:<br>
+ ----- Method: InterpreterPlugin&gt;&gt;firstIndexableField:as: (in category &#39;casting support&#39;) -----<br>
+ firstIndexableField: obj as: cType<br>
+       &lt;inline: true&gt;<br>
+       ^interpreterProxy cCoerce: (interpreterProxy firstIndexableField: obj) to: cType!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;createLargeFromSmallInteger: (in category &#39;oop util&#39;) -----<br>
  createLargeFromSmallInteger: anOop<br>
        &quot;anOop has to be a SmallInteger!!&quot;<br>
        | val res pDigit byteSize digitSize |<br>
        &lt;var: #pDigit type: #&#39;unsigned int *&#39;&gt;<br>
        val := interpreterProxy integerValueOf: anOop.<br>
        byteSize := self byteSizeOfCSI: val.<br>
        res := self createLargeIntegerNeg: val &lt; 0 byteLength: byteSize.<br>
+       pDigit := self firstIndexableField: res as: #&#39;unsigned int *&#39;.<br>
-       pDigit := interpreterProxy firstIndexableField: res.<br>
        digitSize := byteSize + 3 // 4.<br>
        1 to: digitSize do: [:ix | self cDigitOf: pDigit at: ix - 1 put: (self digitOfCSI: val at: ix)].<br>
        ^ res!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digit:Lshift: (in category &#39;oop functions&#39;) -----<br>
  digit: anOop Lshift: shiftCount<br>
        &quot;Attention: this method invalidates all oop&#39;s!! Only newOop is valid at return.&quot;<br>
        &quot;Does not normalize.&quot;<br>
        | newOop highBit newDigitLen newByteLen oldDigitLen |<br>
        oldDigitLen := self digitSizeOfLargeInt: anOop.<br>
+       (highBit := self cDigitHighBit: (self firstIndexableField: anOop as: #&#39;unsigned int *&#39;)<br>
-       (highBit := self cDigitHighBit: (interpreterProxy firstIndexableField: anOop)<br>
                                len: oldDigitLen) = 0 ifTrue: [^  interpreterProxy instantiateClass: (interpreterProxy fetchClassOf: anOop) indexableSize: 1].<br>
        newByteLen := highBit + shiftCount + 7 // 8.<br>
        self remapOop: anOop in: [newOop := interpreterProxy instantiateClass: (interpreterProxy fetchClassOf: anOop)<br>
                                        indexableSize: newByteLen].<br>
        newDigitLen := newByteLen + 3 // 4.<br>
        self<br>
                cDigitLshift: shiftCount<br>
+               from: (self firstIndexableField: anOop as: #&#39;unsigned int *&#39;)<br>
-               from: (interpreterProxy firstIndexableField: anOop)<br>
                len: oldDigitLen<br>
+               to: (self firstIndexableField: newOop as: #&#39;unsigned int *&#39;)<br>
-               to: (interpreterProxy firstIndexableField: newOop)<br>
                len: newDigitLen.<br>
        ^ newOop!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digit:Rshift:lookfirst: (in category &#39;oop functions&#39;) -----<br>
  digit: anOop Rshift: shiftCount lookfirst: a<br>
        &quot;Attention: this method invalidates all oop&#39;s!! Only newBytes is valid at return.&quot;<br>
        &quot;Shift right 32*digitShift+bitShift bits, 0&lt;=bitShift&lt;32.<br>
        Discard all digits beyond a, and all zeroes at or below a.&quot;<br>
        &quot;Does not normalize.&quot;<br>
        | newByteLen newOop oldBitLen newBitLen oldDigitLen newDigitLen |<br>
+       oldBitLen := self cDigitHighBit: (self firstIndexableField: anOop as: #&#39;unsigned int *&#39;) len: a.<br>
-       oldBitLen := self cDigitHighBit: (interpreterProxy firstIndexableField: anOop) len: a.<br>
        oldDigitLen := oldBitLen + 31 // 32.<br>
        newBitLen := oldBitLen - shiftCount.<br>
        newBitLen &lt;= 0 ifTrue: [&quot;All bits lost&quot;<br>
                ^ interpreterProxy<br>
                        instantiateClass: (interpreterProxy fetchClassOf: anOop)<br>
                        indexableSize: 0].<br>
        newByteLen := newBitLen + 7 // 8.<br>
        newDigitLen := newByteLen + 3 // 4.<br>
        self remapOop: anOop in: [newOop := interpreterProxy instantiateClass: (interpreterProxy fetchClassOf: anOop)<br>
                                        indexableSize: newByteLen].<br>
        self<br>
                cDigitRshift: shiftCount<br>
+               from: (self firstIndexableField: anOop as: #&#39;unsigned int *&#39;)<br>
-               from: (interpreterProxy firstIndexableField: anOop)<br>
                len: oldDigitLen<br>
+               to: (self firstIndexableField: newOop as: #&#39;unsigned int *&#39;)<br>
-               to: (interpreterProxy firstIndexableField: newOop)<br>
                len: newDigitLen.<br>
        ^ newOop!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitAddLarge:with: (in category &#39;oop functions&#39;) -----<br>
  digitAddLarge: firstInteger with: secondInteger<br>
        &quot;Does not need to normalize!!&quot;<br>
        | over firstDigitLen secondDigitLen shortInt shortDigitLen longInt longDigitLen sum newSum neg |<br>
        &lt;var: #over type: #&#39;unsigned int&#39;&gt;<br>
        firstDigitLen := self digitSizeOfLargeInt: firstInteger.<br>
        secondDigitLen := self digitSizeOfLargeInt: secondInteger.<br>
        neg := (interpreterProxy fetchClassOf: firstInteger)<br>
                = interpreterProxy classLargeNegativeInteger.<br>
        firstDigitLen &lt;= secondDigitLen<br>
                ifTrue:<br>
                        [shortInt := firstInteger.<br>
                        shortDigitLen := firstDigitLen.<br>
                        longInt := secondInteger.<br>
                        longDigitLen := secondDigitLen]<br>
                ifFalse:<br>
                        [shortInt := secondInteger.<br>
                        shortDigitLen := secondDigitLen.<br>
                        longInt := firstInteger.<br>
                        longDigitLen := firstDigitLen].<br>
        &quot;       sum := Integer new: len neg: firstInteger negative.&quot;<br>
        self remapOop: #(shortInt longInt ) in: [sum := self createLargeIntegerNeg: neg digitLength: longDigitLen].<br>
        over := self<br>
+                               cDigitAdd: (self firstIndexableField: shortInt as: #&#39;unsigned int *&#39;)<br>
-                               cDigitAdd: (interpreterProxy firstIndexableField: shortInt)<br>
                                len: shortDigitLen<br>
+                               with: (self firstIndexableField: longInt as: #&#39;unsigned int *&#39;)<br>
-                               with: (interpreterProxy firstIndexableField: longInt)<br>
                                len: longDigitLen<br>
+                               into: (self firstIndexableField: sum as: #&#39;unsigned int *&#39;).<br>
-                               into: (interpreterProxy firstIndexableField: sum).<br>
        over &gt; 0<br>
                ifTrue:<br>
                        [&quot;sum := sum growby: 1.&quot;<br>
                        self remapOop: sum in: [newSum := self createLargeIntegerNeg: neg byteLength: longDigitLen * 4 + 1].<br>
                        self<br>
+                               cDigitCopyFrom: (self firstIndexableField: sum as: #&#39;unsigned int *&#39;)<br>
+                               to: (self firstIndexableField: newSum as: #&#39;unsigned int *&#39;)<br>
-                               cDigitCopyFrom: (interpreterProxy firstIndexableField: sum)<br>
-                               to: (interpreterProxy firstIndexableField: newSum)<br>
                                len: longDigitLen.<br>
                        sum := newSum.<br>
                        &quot;C index!!&quot;<br>
+                       self cDigitOf: (self firstIndexableField: sum as: #&#39;unsigned int *&#39;)<br>
-                       self cDigitOf: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: sum) to: &#39;unsigned int *&#39;)<br>
                                at: longDigitLen put: over]<br>
                ifFalse:<br>
                        [sum := neg<br>
                                ifTrue: [self normalizeNegative: sum]<br>
                                ifFalse: [self normalizePositive: sum]].<br>
        ^ sum!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitBitLogic:with:opIndex: (in category &#39;oop functions&#39;) -----<br>
  digitBitLogic: firstInteger with: secondInteger opIndex: opIx<br>
        &quot;Bit logic here is only implemented for positive integers or Zero;<br>
        if rec or arg is negative, it fails.&quot;<br>
        | firstLarge secondLarge firstLen secondLen shortLen shortLarge longLen longLarge result |<br>
        (interpreterProxy isIntegerObject: firstInteger)<br>
                ifTrue:<br>
                        [(interpreterProxy integerValueOf: firstInteger)<br>
                                &lt; 0 ifTrue: [^ interpreterProxy primitiveFail].<br>
                        &quot;convert it to a not normalized LargeInteger&quot;<br>
                        self remapOop: secondInteger in: [firstLarge := self createLargeFromSmallInteger: firstInteger]]<br>
                ifFalse:<br>
                        [(interpreterProxy fetchClassOf: firstInteger)<br>
                                = interpreterProxy classLargeNegativeInteger ifTrue: [^ interpreterProxy primitiveFail].<br>
                        firstLarge := firstInteger].<br>
        (interpreterProxy isIntegerObject: secondInteger)<br>
                ifTrue:<br>
                        [(interpreterProxy integerValueOf: secondInteger)<br>
                                &lt; 0 ifTrue: [^ interpreterProxy primitiveFail].<br>
                        &quot;convert it to a not normalized LargeInteger&quot;<br>
                        self remapOop: firstLarge in: [secondLarge := self createLargeFromSmallInteger: secondInteger]]<br>
                ifFalse:<br>
                        [(interpreterProxy fetchClassOf: secondInteger)<br>
                                = interpreterProxy classLargeNegativeInteger ifTrue: [^ interpreterProxy primitiveFail].<br>
                        secondLarge := secondInteger].<br>
        firstLen := self byteSizeOfLargeInt: firstLarge.<br>
        secondLen := self byteSizeOfLargeInt: secondLarge.<br>
        firstLen &lt; secondLen<br>
                ifTrue:<br>
                        [shortLen := firstLen.<br>
                        shortLarge := firstLarge.<br>
                        longLen := secondLen.<br>
                        longLarge := secondLarge]<br>
                ifFalse:<br>
                        [shortLen := secondLen.<br>
                        shortLarge := secondLarge.<br>
                        longLen := firstLen.<br>
                        longLarge := firstLarge].<br>
        self remapOop: #(shortLarge longLarge ) in: [result := interpreterProxy instantiateClass: interpreterProxy classLargePositiveInteger indexableSize: longLen].<br>
        self<br>
                cDigitOp: opIx<br>
+               short: (self firstIndexableField: shortLarge as: #&#39;unsigned int *&#39;)<br>
-               short: (interpreterProxy firstIndexableField: shortLarge)<br>
                len: shortLen + 3 // 4<br>
+               long: (self firstIndexableField: longLarge as: #&#39;unsigned int *&#39;)<br>
-               long: (interpreterProxy firstIndexableField: longLarge)<br>
                len: longLen + 3 // 4<br>
+               into: (self firstIndexableField: result as: #&#39;unsigned int *&#39;).<br>
-               into: (interpreterProxy firstIndexableField: result).<br>
        interpreterProxy failed ifTrue: [^ 0].<br>
        ^ self normalizePositive: result!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitCompareLarge:with: (in category &#39;oop functions&#39;) -----<br>
  digitCompareLarge: firstInteger with: secondInteger<br>
        &quot;Compare the magnitude of firstInteger with that of secondInteger.<br>
        Return a code of 1, 0, -1 for firstInteger &gt;, = , &lt; secondInteger&quot;<br>
        | firstDigitLen secondDigitLen |<br>
        firstDigitLen := self digitSizeOfLargeInt: firstInteger.<br>
        secondDigitLen := self digitSizeOfLargeInt: secondInteger.<br>
        secondDigitLen ~= firstDigitLen<br>
                ifTrue: [secondDigitLen &gt; firstDigitLen<br>
                                ifTrue: [^ -1 asOop: SmallInteger]<br>
                                ifFalse: [^ 1 asOop: SmallInteger]].<br>
        ^ (self<br>
+               cDigitCompare: (self firstIndexableField: firstInteger as: #&#39;unsigned int *&#39;)<br>
+               with: (self firstIndexableField: secondInteger as: #&#39;unsigned int *&#39;)<br>
-               cDigitCompare: (interpreterProxy firstIndexableField: firstInteger)<br>
-               with: (interpreterProxy firstIndexableField: secondInteger)<br>
                len: firstDigitLen)<br>
                asOop: SmallInteger!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitDivLarge:with:negative: (in category &#39;oop functions&#39;) -----<br>
  digitDivLarge: firstInteger with: secondInteger negative: neg<br>
        &quot;Does not normalize.&quot;<br>
        &quot;Division by zero has to be checked in caller.&quot;<br>
        | firstDigitLen secondDigitLen quoDigitLen d div rem quo result |<br>
        firstDigitLen := self digitSizeOfLargeInt: firstInteger.<br>
        secondDigitLen := self digitSizeOfLargeInt: secondInteger.<br>
        quoDigitLen := firstDigitLen - secondDigitLen + 1.<br>
        quoDigitLen &lt;= 0<br>
                ifTrue:<br>
                        [self remapOop: firstInteger in: [result := interpreterProxy instantiateClass: interpreterProxy classArray indexableSize: 2].<br>
                        result stAt: 1 put: (0 asOop: SmallInteger).<br>
                        result stAt: 2 put: firstInteger.<br>
                        ^ result].<br>
        &quot;set rem and div to copies of firstInteger and secondInteger, respectively.<br>
          However,<br>
         to facilitate use of Knuth&#39;s algorithm, multiply rem and div by 2 (that<br>
         is, shift)<br>
         until the high word of div is &gt;=16r80000000&quot;<br>
        d := 32 - (self cHighBit32: (self unsafeDigitOfLargeInt: secondInteger at: secondDigitLen)).<br>
        self remapOop: firstInteger<br>
                in:<br>
                        [div := self digit: secondInteger Lshift: d.<br>
                        div := self largeInt: div growTo: (self digitSizeOfLargeInt: div) + 1 * 4].<br>
        self remapOop: div<br>
                in:<br>
                        [rem := self digit: firstInteger Lshift: d.<br>
                        (self digitSizeOfLargeInt: rem) = firstDigitLen<br>
                                ifTrue: [rem := self largeInt: rem growTo: firstDigitLen + 1 * 4]].<br>
        self remapOop: #(div rem ) in: [quo := self createLargeIntegerNeg: neg digitLength: quoDigitLen].<br>
        self<br>
+               cDigitDiv: (self firstIndexableField: div as: #&#39;unsigned int *&#39;)<br>
-               cDigitDiv: (interpreterProxy firstIndexableField: div)<br>
                len: (self digitSizeOfLargeInt: div)<br>
+               rem: (self firstIndexableField: rem as: #&#39;unsigned int *&#39;)<br>
-               rem: (interpreterProxy firstIndexableField: rem)<br>
                len: (self digitSizeOfLargeInt: rem)<br>
+               quo: (self firstIndexableField: quo as: #&#39;unsigned int *&#39;)<br>
-               quo: (interpreterProxy firstIndexableField: quo)<br>
                len: (self digitSizeOfLargeInt: quo).<br>
        self remapOop: #(quo ) in: [rem := self<br>
                                        digit: rem<br>
                                        Rshift: d<br>
                                        lookfirst: (self digitSizeOfLargeInt: div)<br>
                                                        - 1].<br>
        &quot;^ Array with: quo with: rem&quot;<br>
        self remapOop: #(quo rem ) in: [result := interpreterProxy instantiateClass: interpreterProxy classArray indexableSize: 2].<br>
        result stAt: 1 put: quo.<br>
        result stAt: 2 put: rem.<br>
        ^ result!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitMontgomery:times:modulo:mInvModB: (in category &#39;oop functions&#39;) -----<br>
  digitMontgomery: firstLarge times: secondLarge modulo: thirdLarge mInvModB: mInv<br>
        &lt;var: #mInv type: #&#39;unsigned int&#39;&gt;<br>
        | firstLen secondLen thirdLen prod |<br>
        firstLen := self digitSizeOfLargeInt: firstLarge.<br>
        secondLen := self digitSizeOfLargeInt: secondLarge.<br>
        thirdLen := self digitSizeOfLargeInt: thirdLarge.<br>
+       (firstLen &lt;= thirdLen and: [secondLen &lt;= thirdLen]) ifFalse: [^interpreterProxy primitiveFail].<br>
<br>
+       self remapOop: #(firstLarge secondLarge thirdLarge)<br>
+               in: [prod := interpreterProxy instantiateClass: interpreterProxy classLargePositiveInteger indexableSize: thirdLen * 4].<br>
-       firstLen &lt;= thirdLen ifFalse: [^interpreterProxy primitiveFail].<br>
-       secondLen &lt;= thirdLen ifFalse: [^interpreterProxy primitiveFail].<br>
-       self remapOop: #(firstLarge secondLarge thirdLarge) in: [prod := interpreterProxy instantiateClass: interpreterProxy classLargePositiveInteger indexableSize: thirdLen * 4].<br>
        self<br>
+               cDigitMontgomery: (self firstIndexableField: firstLarge as: #&#39;unsigned int *&#39;)<br>
+               len: firstLen<br>
+               times: (self firstIndexableField: secondLarge as: #&#39;unsigned int *&#39;)<br>
+               len: secondLen<br>
+               modulo: (self firstIndexableField: thirdLarge as: #&#39;unsigned int *&#39;)<br>
+               len: thirdLen<br>
+               mInvModB: mInv<br>
+               into: (self firstIndexableField: prod as: #&#39;unsigned int *&#39;).<br>
-                               cDigitMontgomery: (interpreterProxy firstIndexableField: firstLarge)<br>
-                               len: firstLen<br>
-                               times: (interpreterProxy firstIndexableField: secondLarge)<br>
-                               len: secondLen<br>
-                               modulo: (interpreterProxy firstIndexableField: thirdLarge)<br>
-                               len: thirdLen<br>
-                               mInvModB: mInv<br>
-                               into: (interpreterProxy firstIndexableField: prod).<br>
        ^self normalizePositive: prod!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitMultiplyLarge:with:negative: (in category &#39;oop functions&#39;) -----<br>
  digitMultiplyLarge: firstInteger with: secondInteger negative: neg<br>
        &quot;Normalizes.&quot;<br>
        | firstLen secondLen shortInt shortLen longInt longLen prod |<br>
        firstLen := self byteSizeOfLargeInt: firstInteger.<br>
        secondLen := self byteSizeOfLargeInt: secondInteger.<br>
        firstLen &lt;= secondLen<br>
                ifTrue:<br>
                        [shortInt := firstInteger.<br>
                        shortLen := firstLen.<br>
                        longInt := secondInteger.<br>
                        longLen := secondLen]<br>
                ifFalse:<br>
                        [shortInt := secondInteger.<br>
                        shortLen := secondLen.<br>
                        longInt := firstInteger.<br>
                        longLen := firstLen].<br>
+       self remapOop: #(shortInt longInt) in: [prod := self createLargeIntegerNeg: neg byteLength: longLen + shortLen].<br>
-       self remapOop: #(shortInt longInt ) in: [prod := self createLargeIntegerNeg: neg byteLength: longLen + shortLen].<br>
        self<br>
+               cDigitMultiply: (self firstIndexableField: shortInt as: #&#39;unsigned int *&#39;)<br>
-               cDigitMultiply: (interpreterProxy firstIndexableField: shortInt)<br>
                len: shortLen + 3 // 4<br>
+               with: (self firstIndexableField: longInt as: #&#39;unsigned int *&#39;)<br>
-               with: (interpreterProxy firstIndexableField: longInt)<br>
                len: longLen + 3 // 4<br>
+               into: (self firstIndexableField: prod as: #&#39;unsigned int *&#39;)<br>
-               into: (interpreterProxy firstIndexableField: prod)<br>
                len: longLen + shortLen + 3 // 4.<br>
        ^neg<br>
                ifTrue: [self normalizeNegative: prod]<br>
                ifFalse: [self normalizePositive: prod]!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;digitSubLarge:with: (in category &#39;oop functions&#39;) -----<br>
  digitSubLarge: firstInteger with: secondInteger<br>
        &quot;Normalizes.&quot;<br>
        | firstDigitLen secondDigitLen larger largeDigitLen smaller smallerDigitLen neg resDigitLen res firstNeg |<br>
        firstNeg := (interpreterProxy fetchClassOf: firstInteger)<br>
                                = interpreterProxy classLargeNegativeInteger.<br>
        firstDigitLen := self digitSizeOfLargeInt: firstInteger.<br>
        secondDigitLen := self digitSizeOfLargeInt: secondInteger.<br>
        firstDigitLen = secondDigitLen ifTrue:<br>
                [[firstDigitLen &gt; 1<br>
                  and: [(self unsafeDigitOfLargeInt: firstInteger at: firstDigitLen) = (self unsafeDigitOfLargeInt: secondInteger at: firstDigitLen)]]<br>
                        whileTrue: [firstDigitLen := firstDigitLen - 1].<br>
                secondDigitLen := firstDigitLen].<br>
        (firstDigitLen &lt; secondDigitLen<br>
         or: [firstDigitLen = secondDigitLen<br>
                 and: [(self unsafeDigitOfLargeInt: firstInteger at: firstDigitLen) &lt; (self unsafeDigitOfLargeInt: secondInteger at: firstDigitLen)]])<br>
                ifTrue:<br>
                        [larger := secondInteger.<br>
                        largeDigitLen := secondDigitLen.<br>
                        smaller := firstInteger.<br>
                        smallerDigitLen := firstDigitLen.<br>
                        neg := firstNeg == false]<br>
                ifFalse:<br>
                        [larger := firstInteger.<br>
                        largeDigitLen := firstDigitLen.<br>
                        smaller := secondInteger.<br>
                        smallerDigitLen := secondDigitLen.<br>
                        neg := firstNeg].<br>
        resDigitLen := largeDigitLen.<br>
        self remapOop: #(smaller larger)<br>
                in: [res := self createLargeIntegerNeg: neg digitLength: resDigitLen].<br>
        self<br>
+               cDigitSub: (self firstIndexableField: smaller as: #&#39;unsigned int *&#39;)<br>
-               cDigitSub: (interpreterProxy firstIndexableField: smaller)<br>
                len: smallerDigitLen<br>
+               with: (self firstIndexableField: larger as: #&#39;unsigned int *&#39;)<br>
-               with: (interpreterProxy firstIndexableField: larger)<br>
                len: largeDigitLen<br>
+               into: (self firstIndexableField: res as: #&#39;unsigned int *&#39;).<br>
-               into: (interpreterProxy firstIndexableField: res).<br>
        ^neg<br>
                ifTrue: [self normalizeNegative: res]<br>
                ifFalse: [self normalizePositive: res]!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;highBitOfLargeInt: (in category &#39;util&#39;) -----<br>
  highBitOfLargeInt: anOop<br>
        &lt;inline: true&gt;<br>
        ^ self<br>
+               cDigitHighBit: (self firstIndexableField: anOop as: #&#39;unsigned int *&#39;)<br>
-               cDigitHighBit: (interpreterProxy firstIndexableField: anOop)<br>
                len: (self digitSizeOfLargeInt: anOop)!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;largeInt:growTo: (in category &#39;oop util&#39;) -----<br>
  largeInt: aBytesObject growTo: newByteLen<br>
        &quot;Attention: this method invalidates all oop&#39;s!! Only newBytes is valid at return.&quot;<br>
        &quot;Does not normalize.&quot;<br>
        | newBytes oldDigitLen newDigitLen copyLen |<br>
        self remapOop: aBytesObject in: [newBytes := interpreterProxy instantiateClass: (interpreterProxy fetchClassOf: aBytesObject)<br>
                                        indexableSize: newByteLen].<br>
        newDigitLen := newByteLen + 3 // 4.<br>
        oldDigitLen := self digitSizeOfLargeInt: aBytesObject.<br>
+       copyLen := oldDigitLen &lt; newDigitLen<br>
+                                       ifTrue: [oldDigitLen]<br>
+                                       ifFalse: [newDigitLen].<br>
-       oldDigitLen &lt; newDigitLen<br>
-               ifTrue: [copyLen := oldDigitLen]<br>
-               ifFalse: [copyLen := newDigitLen].<br>
        self<br>
+               cDigitCopyFrom: (self firstIndexableField: aBytesObject as: #&#39;unsigned int *&#39;)<br>
+               to: (self firstIndexableField: newBytes as: #&#39;unsigned int *&#39;)<br>
-               cDigitCopyFrom: (interpreterProxy firstIndexableField: aBytesObject)<br>
-               to: (interpreterProxy firstIndexableField: newBytes)<br>
                len: copyLen.<br>
+       ^newBytes!<br>
-       ^ newBytes!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;unsafeByteOfLargeInt:at: (in category &#39;util&#39;) -----<br>
  unsafeByteOfLargeInt: bytesObj at: ix<br>
        &quot;Argument bytesObj must not be aSmallInteger!!&quot;<br>
        &lt;inline: true&gt;<br>
        &lt;returnTypeC: #&#39;unsigned char&#39;&gt;<br>
+       ^(self firstIndexableField: bytesObj as: #&#39;unsigned char *&#39;) at: ix - 1!<br>
-       ^(interpreterProxy cCoerce: (interpreterProxy firstIndexableField: bytesObj) to: #&#39;unsigned char *&#39;) at: ix - 1!<br>
<br>
Item was changed:<br>
  ----- Method: LargeIntegersPlugin&gt;&gt;unsafeDigitOfLargeInt:at: (in category &#39;util&#39;) -----<br>
  unsafeDigitOfLargeInt: anOop at: ix<br>
        &quot;Argument must not be aSmallInteger!!&quot;<br>
        &lt;inline: true&gt;<br>
        &lt;returnTypeC: #&#39;unsigned int&#39;&gt;<br>
+       ^self cDigitOf: (self firstIndexableField: anOop as: #&#39;unsigned int *&#39;) at: ix - 1!<br>
-       ^self cDigitOf: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: anOop) to: #&#39;unsigned int *&#39;) at: ix - 1!<br>
<br>
</blockquote></div><br></div></div>