<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 <<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>> 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. 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 <<a href="mailto:eliot.miranda@gmail.com" class="">eliot.miranda@gmail.com</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="">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 <<a href="mailto:pharo-dev@lists.pharo.org" class="">pharo-dev@lists.pharo.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="">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 <<a href="mailto:vm-dev@lists.squeakfoundation.org" class="">vm-dev@lists.squeakfoundation.org</a>><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 <<a href="mailto:stepharo@free.fr" class="">stepharo@free.fr</a>> 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. Interesting to consider what the minimum knowledge programmers have when first using the system. 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>>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 >> flushCache<br class="">
"Tell the interpreter to remove the contents of its method
lookup cache, if it has <br class="">
one. Essential. See Object documentation whatIsAPrimitive."<br class="">
<br class="">
<primitive: 89><br class="">
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 </span><span style="background-color: rgba(255, 255, 255, 0);" class="">any. This must be done when the system modifies the class hierarchy so that message lookups reflect the revised organization. c.f. Symbol>>flushCache & CompiledMethod>>flushCache. Essential. 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 >> flushCache<br class="">
"Tell the interpreter to remove all entries with this symbol as
a selector from its method lookup cache, if it has one. This
primitive must be called whenever a method is redefined or removed.<br class="">
NOTE: Only one of the two selective flush methods (Symbol or
CompiledMethod) needs to be used."<br class="">
<br class="">
<primitive: 119><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 all entries with this symbol as a selector from its method lookup caches, if it has any. This must be done whenever a method is added, redefined or removed, so that message lookups reflect the revised organization. c.f. Behavior>>flushCache & CompiledMethod>>flushCache. Essential. See Object documentation whatIsAPrimitive."</span><br class=""><br class=""><br class=""><blockquote type="cite" class=""><div class="">CompiledMethod >> flushCache<br class="">
"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="">
NOTE: Only one of two selective flush methods (Symbol or
CompiledMethod) needs to be used."<br class="">
<br class="">
<primitive: 116><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 all references to this method from its method lookup caches, and to discard any optimized version of the method, if it has any of these. This must be done whenever a method is modified in place, such as modifying its literals or machine code, to reflect the revised code. c.f. Behavior>>flushCache & Symbol>>flushCache. Essential. See Object documentation whatIsAPrimitive."</span><span style="background-color: rgba(255, 255, 255, 0);" class=""> </span></div></div></div></div></blockquote></div><br class=""></div></div></blockquote></div></body></html>