<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">On Mon, Jul 3, 2017 at 11:43 PM, Eliot Miranda </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Bert, Hi Tim,<div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 15, 2016 at 2:55 PM,  <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:</div><div class="gmail_quote">[snip]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><a href="http://lists.squeakfoundation.org/pipermail/packages/2016-September/068930.html" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/pipermail/packages/2016-Se<wbr>ptember/068930.html</a><br>
<br>
Name: System-bf.916<br>
Ancestors: System-bf.915<br>
<br>
Replace VM-level ImageSegment loading with a Smalltalk implementation for old (interpreter-era) projects.<br>
<br>
Also removes support for writing segments.<br>
<br>
This overrides the Spur support introduced in System-eem.758.</blockquote></div></div></div></div></blockquote></div></div></blockquote><div><br></div></span><div>I am currently putting back the ImageSegment support for saving projects and loading native segments produced in this way.</div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​Why?​ I thought we agreed that ImageSegments are not a great idea as a file format, for their lack of compatibility. Serialization speed isn't an issue anymore thanks to your fast jit.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">What ImageSegments *are* good at is for splitting up an image into segments that do not have to be in memory at the same time - but in that case they would not be an independent entity but be considered part of one particular image. And for that we need only very few methods (that I removed too, see storeSegment).</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>  I''ve added subclasses of ImageSegment called NativeImageSegment and LegacyImageSegment.   I have a few questions.</div><div><br></div><div>1. I'm curious about the ImageSegment>>scanFrom: method:</div><div><br></div><div><div>!ImageSegment methodsFor: 'fileIn/Out' stamp: 'RAA 6/22/2000 17:49'!</div><div>scanFrom: aStream</div><div>    "Move source code from a fileIn to the changes file for classes in an ImageSegment.  Do not compile the methods.  They already came in via the image segment.  After the ImageSegment in the file, !!ImageSegment new!! captures control, and scanFrom: is called."</div><div>    | val chunk |</div><div><br></div><div>    [aStream atEnd] whileFalse:</div><div>        [aStream skipSeparators.</div><div>        val := (aStream peekFor: $!!)</div><div>            ifTrue: ["Move (aStream nextChunk), find the method or class</div><div>                        comment, and install the file location bytes"</div><div>                    (Compiler evaluate: aStream nextChunk logged: false)</div><div>                        scanFromNoCompile: aStream forSegment: self]</div><div>            ifFalse: [chunk := aStream nextChunk.</div><div>                    aStream checkForPreamble: chunk.</div><div>                    Compiler evaluate: chunk logged: true].</div><div>        aStream skipStyleChunk].</div><div>    "regular fileIn will close the file"</div><div>    ^ val! !</div></div><div><br></div><div>I don't see this in the new (legacy, System-bf.916) image segment loading code.  Do Etoys projects not include source code and hence its irrelevant? </div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​They do, but the code path to load them does not go through this method.</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> The question boils down to whether this should be a method on ImageSegment, and hence inherited by both NativeImageSegment and LegacyImageSegment, or just NativeImageSegment.  Also, I don't see how this method attaches sources to the methods brought in.  Is it in fact useless and hence that's why you've left it out?  If so, would it not be useful to add code that does update the source pointers in loaded methods correctly?</div></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">The ImageSegment nowadays only stores uniclasses as objects. Other changes to the system are simply filed in, and not included in the segment. This method appears to be unused. I tried to trim everything not strictly need​ed for project loading</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>2. Should I pull in the Etoys extensions deleted in EToys-bf.234?  (ImageSegment>>(<wbr>classOrganizersBeRoots:,<wbr>rehashDictionaries:,<wbr>rehashMethodDictionaries:)?  I'm guessing they'll be needed for native loading.</div></div></div></div></blockquote><div><br></div><div>rehashDictionaries<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0);display:inline">​: is still there, not sure if we need the others.​</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>3. Same for the SMBase extension ImageSegment>><wbr>writeForExportOn:.  I guess this should come back in too.</div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​SqueakMap uses ImageSegments, yes. No idea if it's a good idea to write a new native segment.​</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>4.  Where should I look for tests that may have been removed?</div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​There are no tests, unfortunately ...</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">The way I was testing is taking a project written by Etoys (from <a href="http://squeakland.org">squeakland.org</a>) and dropping it into a trunk image. Before your changes this did work, more or less: If you revert to System-pre.956 and make allocateMethodContext: and allocateBlockContext: simply return nil, you can load old projects again. These contexts aren't needed anyways for Etoys projects (if we needed them I'd recreate by recompiling). </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">I'm attaching a simple project that I just tested with this.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -​</div><br></div><div> </div></div></div></div>