<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font face="Georgia">Thanks, Dave,</font></p>
    <p><font face="Georgia">There are a number of errors possible in
        that primitive and I don't know if one can see the particular
        code after a failure. I was able to narrow it down, though.
        Adding this to FloatArray:<br>
      </font></p>
    <p><font face="Georgia">testreplaceFrom: start to: stop with:
        replacement startingAt: repStart <br>
        "<br>
        (FloatArray new: 8) testreplaceFrom: 1 to: 3 with: (FloatArray
        new: 3) startingAt: 1<br>
        "<br>
            <primitive: 105><br>
            self halt.</font></p>
    <p>Runs fine in 32-bit squeak and halts in 64-bit.</p>
    <p>-----------succeeds on-----------</p>
    <p>Virtual Machine<br>
      ---------------<br>
      /Users/bob/squeak/old squeak5.1/ast 5.1.app/Contents/MacOS/Squeak<br>
      Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives
      VMMaker.oscog-cb.1919] 32 bit<br>
      Mac OS X built on Aug 17 2016 18:59:49 UTC Compiler: 4.2.1
      Compatible Apple LLVM 6.0 (clang-600.0.54)<br>
      platform sources revision VM: 201608171728
      <a class="moz-txt-link-freetext" href="https://github.com/OpenSmalltalk/opensmalltalk-vm.git">https://github.com/OpenSmalltalk/opensmalltalk-vm.git</a> $ Date: Wed
      Aug 17 10:28:01 2016 -0700 $ Plugins: 201608171728
      <a class="moz-txt-link-freetext" href="https://github.com/OpenSmalltalk/opensmalltalk-vm.git">https://github.com/OpenSmalltalk/opensmalltalk-vm.git</a> $<br>
      CoInterpreter VMMaker.oscog-cb.1919 uuid:
      00a8dd2a-bc8d-4552-b400-be781c8aabec Aug 17 2016<br>
      StackToRegisterMappingCogit VMMaker.oscog-cb.1919 uuid:
      00a8dd2a-bc8d-4552-b400-be781c8aabec Aug 17 2016<br>
    </p>
    <p>--------fails on--------</p>
    <p>Virtual Machine<br>
      ---------------<br>
/Users/bob/squeak/Squeak5.1-16548-64bit-All-in-One/Squeak5.1-16548-64bit-All-in-One.app/Contents/MacOS/Squeak<br>
      Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives
      VMMaker.oscog-cb.1919] 64 bit<br>
      Mac OS X built on Aug 17 2016 18:51:56 UTC Compiler: 4.2.1
      Compatible Apple LLVM 6.0 (clang-600.0.54)<br>
      platform sources revision VM: 201608171728
      <a class="moz-txt-link-freetext" href="https://github.com/OpenSmalltalk/opensmalltalk-vm.git">https://github.com/OpenSmalltalk/opensmalltalk-vm.git</a> $ Date: Wed
      Aug 17 10:28:01 2016 -0700 $ Plugins: 201608171728
      <a class="moz-txt-link-freetext" href="https://github.com/OpenSmalltalk/opensmalltalk-vm.git">https://github.com/OpenSmalltalk/opensmalltalk-vm.git</a> $<br>
      CoInterpreter VMMaker.oscog-cb.1919 uuid:
      00a8dd2a-bc8d-4552-b400-be781c8aabec Aug 17 2016<br>
      StackToRegisterMappingCogit VMMaker.oscog-cb.1919 uuid:
      00a8dd2a-bc8d-4552-b400-be781c8aabec Aug 17 2016<br>
      <br>
      <br>
    </p>
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 1/10/17 9:06 AM, David T. Lewis
      wrote:<br>
    </div>
    <blockquote cite="mid:20170110140632.GA97191@shell.msen.com"
      type="cite">
      <pre wrap="">How to see primitive source these days:

The code is in the VMMaker repository '<a class="moz-txt-link-freetext" href="http://source.squeak.org/VMMaker">http://source.squeak.org/VMMaker</a>'.

For the Spur VM, the package is 'VMMaker.oscog'. For purposes of just
taking a quick look at the code, you can load the latest version
VMMaker.oscog-eem.2079 (this will not exactly corresponding to the version
you are running but here I assume you just want a quick look at what
primitive 105 is doing).

To find the numbered primitive, see CoInterpreter class>>initializePrimitiveTable,
which calls StackInterpreter class>>initializePrimitiveTable, which shows
primitive 105 as #primitiveStringReplace.

The Smalltalk code for this primitive is InterpreterPrimitives>>primitiveStringReplace.
The generated C code for this can be found in the GitHub repository
<a class="moz-txt-link-freetext" href="https://github.com/OpenSmalltalk/opensmalltalk-vm">https://github.com/OpenSmalltalk/opensmalltalk-vm</a>, look for the
primitiveStringReplace function in opensmalltalk-vm/src/vm/gcc3x-cointerpmt.c.

Dave



On Tue, Jan 10, 2017 at 07:57:31AM -0500, Bob Arning wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">I'm was copying a FloatArray and it seems not to be using the primitive 
to move the data over to the copy. 
Float>>replaceFrom:to:with:startingAt: says it uses a primitive, but it 
seem to fallback to the code in SequenceableCollection. How can I see 
the priitive code to see what the issue may be? This is what it says it 
does:

replaceFrom: start to: stop with: replacement startingAt: repStart     
"Primitive. This destructively replaces elements from start to stop in 
the receiver starting at index, repStart, in the collection, 
replacement. Answer the receiver. Range checks are performed in the 
primitive only. Optional. See Object documentation whatIsAPrimitive." 
    <primitive: 105>     super replaceFrom: start to: stop with: 
replacement startingAt: repStart

This is what I did to see if the prim failed:

replaceFrom: start to: stop with: replacement startingAt: repStart     
"Primitive. This destructively replaces elements from start to stop in 
the receiver starting at index, repStart, in the collection, 
replacement. Answer the receiver. Range checks are performed in the 
primitive only. Optional. See Object documentation whatIsAPrimitive." 
    <primitive: 105>     WOOPS ifNil: [         WOOPS _ #WOOPS.         
self halt     ].     super replaceFrom: start to: stop with: replacement 
startingAt: repStart

And it did fail and I'm puzzled as to why:

Halt:
10 January 2017 7:46:09.382669 am

VM: Mac OS - Smalltalk
Image: Squeak5.1 [latest update: #16548]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir 
/Users/bob/squeak/Squeak5.1-16548-64bit-All-in-One/Squeak5.1-16548-64bit-All-in-One.app/Contents/Resources
Trusted Dir /Users/bob/Library/Application Support/Squeak/
Untrusted Dir /Users/bob/Documents/Squeak/

FloatArray(Object)>>halt
    Receiver: a FloatArray(0.0 0.0 0.0)
    Arguments and temporary variables:

    Receiver's instance variables:
a FloatArray(0.0 0.0 0.0)
FloatArray>>replaceFrom:to:with:startingAt:
    Receiver: a FloatArray(0.0 0.0 0.0)
    Arguments and temporary variables:
        start:     1
        stop:     3
        replacement:     a FloatArray(1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 
1.0 1.0 1.0 1.0 1.0 1...etc...
        repStart:     1
    Receiver's instance variables:
a FloatArray(0.0 0.0 0.0)
FloatArray(SequenceableCollection)>>copyFrom:to:
    Receiver: a FloatArray(1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1...etc...
    Arguments and temporary variables:
        start:     1
        stop:     3
        newSize:     3
    Receiver's instance variables:
a FloatArray(1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 
1.0 1.0 1.0 1.0 1...etc...
ConvolutionalLayer>>forward:isTraining:

</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">
</pre>
      </blockquote>
      <pre wrap="">

</pre>
    </blockquote>
    <br>
  </body>
</html>