<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div><br>On Nov 25, 2015, at 9:40 AM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br><br></div><div><span></span></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8">… from vm-dev list. Who’d like to take care of this? :)</div></blockquote><div><br></div>I will. &nbsp;I just wanted the message thread to be read here.<div><br><blockquote type="cite"><div><div class=""><br class=""></div><div class="">- Bert -<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" class="">eliot.miranda@gmail.com</a>&gt;<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">[Vm-dev] Re: [Pharo-dev] what is exactly flushCache?</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">25. November 2015 18:25:01 MEZ<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Pharo Development List &lt;<a href="mailto:pharo-dev@lists.pharo.org" class="">pharo-dev@lists.pharo.org</a>&gt;<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Cc: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><a href="mailto:vm-dev@lists.squeakfoundation.org" class="">vm-dev@lists.squeakfoundation.org</a><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Reply-To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Squeak Virtual Machine Development Discussion &lt;<a href="mailto:vm-dev@lists.squeakfoundation.org" class="">vm-dev@lists.squeakfoundation.org</a>&gt;<br class=""></span></div><br class=""><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">Hi Stef,<br class=""></div><div class=""><br class="">On Nov 24, 2015, at 12:00 PM, stepharo &lt;<a href="mailto:stepharo@free.fr" class="">stepharo@free.fr</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class="">
  
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
  
  
    Thanks for this great explanation and yes I know about this cache
    but I do not why<br class="">
    I was wondering that we did not need to update it from the image. <br class="">
    Now I would like to add such comment inside the system because I
    like self explanation. <br class="">
    <br class="">
    "See Object documentation whatIsAPrimitive." gets frustrates me. <br class=""></div></blockquote><div class=""><br class=""></div>It's still appropriate to explain to newbies what primitives are and how they are invoked. &nbsp;Interesting to consider what the minimum knowledge programmers have when first using the system. &nbsp;Do they know, for example, that methods contain bytecode for a stack machine, or that underneath the system is a virtual machine containing a bytecode execution engine, a set of primitives and (a) garbage collector(s)?<div class=""><br class=""><blockquote type="cite" class=""><div class="">So I imagine that is Behavior flushCache flushing for the class in
    the class,selector pair.<br class=""></div></blockquote><div class=""><br class=""></div>Again because of inheritance the VM can't just flush entries for a specific class, so the VM responds to Behavior&gt;&gt;flushCache flushes the entire cache.</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">
    What would be a good place to add such comment? MethodDictionary. It
    sounds reasonable to me but tell me.<br class=""></div></blockquote><div class=""><br class=""></div>If the comments in the various flushCache implementations are correct and reference each other then I think that's enough.</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">TBehavior &gt;&gt; flushCache<br class="">
    &nbsp;&nbsp;&nbsp; "Tell the interpreter to remove the contents of its method
    lookup cache, if it has <br class="">
    &nbsp;&nbsp;&nbsp; one.&nbsp; Essential.&nbsp; See Object documentation whatIsAPrimitive."<br class="">
    <br class="">
    &nbsp;&nbsp;&nbsp; &lt;primitive: 89&gt;<br class="">
    &nbsp;&nbsp;&nbsp; self primitiveFailed<br class=""></div></blockquote><div class=""><br class=""></div>I would rewrite this to say</div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">"Tell the virtual machine to remove the contents of its method lookup caches, if it has&nbsp;</span><span style="background-color: rgba(255, 255, 255, 0);" class="">any. &nbsp;This must be done when the system modifies the class hierarchy so that message lookups reflect the revised organization. &nbsp;c.f. Symbol&gt;&gt;flushCache &amp; CompiledMethod&gt;&gt;flushCache. &nbsp;Essential.&nbsp; See Object documentation whatIsAPrimitive."</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><blockquote type="cite" class=""><div class="">Symbol &gt;&gt; flushCache<br class="">
    &nbsp;&nbsp;&nbsp; "Tell the interpreter to remove all entries with this symbol as
    a selector from its method lookup cache, if it has one.&nbsp; This
    primitive must be called whenever a method is redefined or removed.<br class="">
    &nbsp;&nbsp;&nbsp; NOTE:&nbsp; Only one of the two selective flush methods (Symbol or
    CompiledMethod) needs to be used."<br class="">
    <br class="">
    &nbsp;&nbsp;&nbsp; &lt;primitive: 119&gt;<br class=""></div></blockquote><div class=""><br class=""></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">I would rewrite this to say</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><span style="background-color: rgba(255, 255, 255, 0);" class="">"Tell the virtual machine to remove&nbsp;all entries with this symbol as a selector from its&nbsp;method lookup caches, if it has&nbsp;any. &nbsp;This must be done&nbsp;whenever a method is added, redefined or removed, so that message lookups reflect the revised organization. &nbsp;c.f. Behavior&gt;&gt;flushCache &amp; CompiledMethod&gt;&gt;flushCache. &nbsp;Essential.&nbsp; See Object documentation whatIsAPrimitive."</span><br class=""><br class=""><br class=""><blockquote type="cite" class=""><div class="">CompiledMethod &gt;&gt; flushCache<br class="">
    &nbsp;&nbsp;&nbsp; "Tell the interpreter to remove all references to this method
    from its method lookup cache, if it has one. This primitive must be
    called whenever a method is redefined or removed.<br class="">
    &nbsp;&nbsp;&nbsp; NOTE:&nbsp; Only one of two selective flush methods (Symbol or
    CompiledMethod) needs to be used."<br class="">
    <br class="">
    &nbsp;&nbsp;&nbsp; &lt;primitive: 116&gt;<br class=""></div></blockquote><div class=""><br class=""></div><div class=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">I would rewrite this to say</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><span style="background-color: rgba(255, 255, 255, 0);" class="">"Tell the virtual machine to remove&nbsp;all references to this method from&nbsp;its&nbsp;method lookup caches, and to discard any optimized version of the method, if it has&nbsp;any of these. &nbsp;This must be done&nbsp;whenever a method is modified in place, such as modifying its literals or machine code, to reflect the revised code. &nbsp;c.f. Behavior&gt;&gt;flushCache &amp; Symbol&gt;&gt;flushCache. &nbsp;Essential.&nbsp; See Object documentation whatIsAPrimitive."</span><span style="background-color: rgba(255, 255, 255, 0);" class="">&nbsp;</span></div></div></div></div></blockquote></div><br class=""></div></div></blockquote></div></body></html>