<div dir="ltr">Hi Eliot, guys,<div><br></div><div>Does anybody know what is the right way to initialize the simulator when I have no image (yet) ? That means: I have no contexts, no processes, no special objects array, no nil. Nothing :).</div><div><br></div><div>I want to create an empty simulator that I will fill with objects later, with bootstrapping purposes. And I know Eliot is doing something like that to initialize the Spur bootstrap.</div><div><br></div><div>I tried to get that working by myself, but when I updated to the latest VM code everything went bananas. My code was something like:</div><div><br></div><div><div><span class="" style="white-space:pre">        </span>simulator := StackInterpreterSimulator new.<span style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>simulator objectMemory setEndOfMemory: 0.</div><div><span class="" style="white-space:pre">        </span>simulator objectMemory edenBytes: simulator objectMemory defaultEdenBytes.</div><div><span class="" style="white-space:pre">        </span>simulator objectMemory specialObjectsOop: 0. &quot;We don&#39;t have one yet&quot;</div><div><span class="" style="white-space:pre">        </span>simulator objectMemory allocateMemoryOfSize: 25000000. &quot;Extra bytes&quot;</div><div><span class="" style="white-space:pre">        </span>simulator objectMemory initialize.<span style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>simulator initializeOzInterpreter: 0. &quot;its initializeInterpreter: but a bit tweeked&quot;</div></div><div><br></div><div>But it stops in an assert because firstFree = end of memory... Which is wrong as we have an empty memory :D. And i&#39;m a bit lost in this one...</div><div><br></div><div>I was looking at how the Spur bootstrap was doing it</div><div><br></div><div><div>on: imageName</div><div><span class="" style="white-space:pre">        </span>StackInterpreter initializeWithOptions: Dictionary new.</div><div><span class="" style="white-space:pre">        </span>(oldInterpreter := StackInterpreterSimulator new)</div><div><span class="" style="white-space:pre">                </span>openOn: imageName extraMemory: 0;</div><div><span class="" style="white-space:pre">                </span>assertValidExecutionPointersAtEachStep: false.</div><div><span class="" style="white-space:pre">        </span>oldHeap := oldInterpreter objectMemory.</div><div><span class="" style="white-space:pre">        </span>newHeap := Spur32BitMMLESimulator new.</div><div><span class="" style="white-space:pre">        </span>newHeap</div><div><span class="" style="white-space:pre">                </span>allocateMemoryOfSize: (oldHeap youngStart * 3 / 2 roundUpTo: 1024 * 1024)</div><div><span class="" style="white-space:pre">                </span>newSpaceSize: 2 * 1024 * 1024</div><div><span class="" style="white-space:pre">                </span>stackSize: 1024 * 1024</div><div><span class="" style="white-space:pre">                </span>codeSize: 0.</div><div><span class="" style="white-space:pre">        </span>newHeap setCheckForLeaks: 15 - 6. &quot;don&#39;t check become; or newSpace; soooo many rehashes in bootstrap&quot;</div><div><span class="" style="white-space:pre">        </span>newHeap bootstrapping: true.</div><div><span class="" style="white-space:pre">        </span>self initMaps</div></div><div><br></div><div>But well, the NewObjectMemory does not have the same API as SpurMemoryManager.</div><div><br></div><div>I&#39;d appreciate any hints on it!</div><div>Thanks and cheers,</div><div>Guille</div></div>