<div dir="ltr">moved from elsewhere<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 16, 2017 at 2:21 PM, tim Rowledge <span dir="ltr"><<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="gmail-"><br>
> On 16-03-2017, at 12:56 PM, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br>
><br>
> IIRC, the source is encoded in the method trailer bytes.  Currently there's no encoding type for WideString.  But Igor's CompiledMethodTrailer reimplementation makes it easy to add new types.  So it should only be a little work to add an encoder and decoder for WideStrings.<br>
<br>
</span>The *nicest* way to fix this would have been an actual instvar (and separate objects for the literals, bytecodes etc) instead of magic bytes; we did that at Interval (amongst other similar approaches I’ve read about) and it made it really easy to have simple string, a file reference, a database key, a URL, a compressed string etc.<br></blockquote><div><br></div><div>Note that AdditionalMethodState provides another way to add inst vars.  One can subclass AdditionalMethodState to add inst vars.  i think I even when as far as adding the compiler support to access the inst vars from AdditionalMethodState implicitly (rather like accessing context temps in the lower right hand pane of the debugger).</div><div><br></div><div>The thing you're not mentioning is that adding the additional inst var for bytes and literals adds significant overhead in the in terpreter.  Either the method variable splits into a byte codes and a literals variable, both of which have to be set on activation and return, or one adds an indirection on each byte code and/or literal fetch, indirecting through the method object to access byte codes and/or literals.</div><div><br></div><div>So for as long as we have an interpreter VM the current flat representation, while ugly if viewed from one point of view, works really well for the interpreter, and is quite nice when viewed from this other point of view.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">But yes, Igor’s work makes it practical to do much the same thing albeit in a rather roundabout way.<br></blockquote><div> </div><div>Remember that Dan implemented eliminating sources and disassembling with temp names by compressing the temp names to the method trailer.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class="gmail-"><br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
</span>Strange OpCodes: MD: Move and Drop bits<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div 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>
</div></div>