<div dir="ltr">Hi Subbu,<div><br></div><div>    I had to make some changes to get the Balloon plugin to simulate correctly.  You might want to take a look at BalloonArray and CArray et al in VMMaker.oscog and see your way to porting the changes to VMMaker.  Better would be to get Interpreter up-to-date in VMMaker.oscog.  A sensible end point has to be an Interpreter which is refactored like StackInterprteer is (i.e. it does not inherit from ObjectMemory) and that has the improvements Andreas implemented to e.g. the sample profile primitives, etc.  Right now we have a fork, and I have no cycles I can spend to working on Interpreter in either context.  I'd love to see someone tackle being able to derive a classic Interpreter VM from VMMaker.oscog.  VMMaker.oscog has a much improved Slang, and of course is where Cog is developed.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 7, 2020 at 12:46 AM K K Subbu <<a href="mailto:kksubbu.ml@gmail.com">kksubbu.ml@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> On 06/05/20 1:19 am, karl ramberg wrote:<br>
> <br>
> Bitmap(Object)>>at:put:<br>
> Receiver: a Bitmap of length 5499668<br>
> Arguments and temporary variables:<br>
> index: 4902231<br>
> value: 0.006711409395973154<br>
> Receiver's instance variables:<br>
> a Bitmap of length 5499668<br>
When I trace the stack, this occurs when a float value 1.0 is stored in <br>
the first slot of a float array of size 6 through an plugin <br>
(FloatArrayPlugin). The Bitmap here is memory (sized in words). When <br>
running on native VM, this code works fine but triggers an error when <br>
simulator tries to mimic a CArray at:put:.<br>
----<br>
memory 4118397 (words)<br>
a CArray<br>
arrayBaseAddress:       14488972 (bytes)<br>
ptrOffset:      0<br>
unitSize:       4<br>
<br>
CArray>>at: offset put: val<br>
   ptrOffset = 0 ifFalse: [self error: 'only expect base address to <br>
receive at:put: message'].<br>
   unitSize = 1 ifTrue: [^ interpreter byteAt: arrayBaseAddress + offset <br>
put: val].<br>
   unitSize = 4 ifTrue: [^ interpreter longAt: arrayBaseAddress + <br>
(offset * 4) put: val].<br>
<br>
InterpreterSimulatorLSB>>longAt: byteAddress put: a32BitValue<br>
   ^memory at: (byteAddress // 4) + 1 put: a32BitValue<br>
-----<br>
But I don't understand why a valid store into memory with an index <br>
within bounds raises an error:<br>
-----<br>
Object>>at: index put: value<br>
   index isInteger ifTrue:<br>
     [self class isVariable<br>
       ifTrue: [(index >= 1 and: [index <= self size])<br>
         ifTrue: [self errorImproperStore]<br>
         ifFalse: [self errorSubscriptBounds: index]]<br>
-----<br>
<br>
I could reproduce this error on released images on Ubuntu Linux (64bit <br>
host).<br>
* Run Squeak3.8.1-6747full.image (this contains VMMaker code)<br>
* Open a workspace and inspect:<br>
     InterpreterSimulator new openOn: 'Squeak32-3.8g-6548.image')<br>
* run 'self test' from the code pane of inspector<br>
* after swapping bytes and relocating objects, an error dialog pops up<br>
(see attached log)<br>
<br>
Regards .. Subbu<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>