Hi Nicolas,<br><br><div class="gmail_quote">On Tue, Mar 12, 2013 at 4:54 AM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
As I understand it, there is a nuclear weapon<br>
- primitive 89 for cleaning all caches<br>
and more chirurgical tools:<br>
- primitive 116 for cleaning method cache of a single CompiledMethod<br>
- primitive 119 for cleaning method cache for all CompiledMethod<br>
corresponding to a given selector<br>
<br>
Currently, when we replace a CompiledMethod in some MethodDictionary,<br>
we call both primitive 116 then primitive 119.<br>
As I understand it from image code comments, this was to support old<br>
VM that would support either one or the other form.<br>
Modern VM (interpreter VM4.x serie, Stack or Cog) are mandatory to run<br>
a modern image all implement both forms, so backward support argument<br>
is gone.<br>
I think it&#39;s time to clean some dust.<br>
So my question is which one is necessary ?<br>
<span class="HOEnZb"><font color="#888888"><br>
Nicolas<br>
</font></span></blockquote></div><br><br><div><div class="gmail_quote"><div><br></div><div>Primitive 119.  Primitive 116 will give bugs.  For example, if we have</div><div><br></div><div>Object subclass: #A</div><div><br>
</div><div>A subclass: #B</div><div><br></div><div>A foo</div><div>    ^#A</div><div><br></div><div>A bar</div><div>    ^self foo</div><div><br></div><div>and we evaluate</div><div>    B new bar</div><div><br></div><div>then there is an inline cache entry in A&gt;&gt;#bar and an entry in the first-level method lookup cache that says instances of B receiving #foo should execute A&gt;&gt;#foo.  If we add </div>
<div><br></div><div>B foo</div><div>   ^#B</div><div><br></div><div>then we haven&#39;t changed A&gt;&gt;#foo but the cache entries in A&gt;&gt;#bar and the first-level method cache for B #foo =&gt; A&gt;&gt;#foo must still be flushed.  Make sense?</div>
</div>-- <br>best,<div>Eliot</div>
</div>