<div dir="ltr"><div><div>No, the Compiler did not classify for ages...<br>The Compiler does not install the generated CompiledMethod, it either answer it, or execute it.<br>So I did not change much, I just avoided to pass an information that the Compiler does not need.<br>
</div>In fact, the category was used only in one place: to pass it to a SyntaxErrorNotification, then to a SyntaxError, just to display the category in the pop up window (the single message in message list...).<br></div>For backward compatibility it&#39;s possible to add the messages in *deprecated protocol, but since there are many messages, I&#39;d like to ear which one exactly...<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/21 Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I was too afraid to update my image because I need stability at the<br>
moment so I haven&#39;t tested or reviewed it closely yet.<br>
<br>
What&#39;s got me confused is that we&#39;ve just changed some age-old API&#39;s<br>
because, suddenly, after all these years, someone decided it wasn&#39;t<br>
the Compiler&#39;s responsibility to classify..?  To compile something we<br>
have to specify the Class to compile it in, and all classes have<br>
categories / protocols, so isn&#39;t it convenient to do that during<br>
compilation?  What is responsible for classifying now and what is the<br>
new API for code-generators to classify the methods they generate?<br>
<div class="HOEnZb"><div class="h5"><br>
On Sat, Sep 21, 2013 at 2:52 PM, Nicolas Cellier<br>
&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt; Please send reports, I&#39;m all ear.<br>
&gt; Though I&#39;m not aware of any raised: no sender no implementor in my image.<br>
&gt; Or is it raised ? It&#39;s a Morph thing...<br>
&gt;<br>
&gt;<br>
&gt; 2013/9/21 Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com">frank.shearar@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; For instance: <a href="http://build.squeak.org/job/SqueakTrunk/536/console" target="_blank">http://build.squeak.org/job/SqueakTrunk/536/console</a><br>
&gt;&gt;<br>
&gt;&gt; Look for<br>
&gt;&gt;<br>
&gt;&gt; Exception MessageNotUnderstood raised:<br>
&gt;&gt; Behavior class&gt;&gt;compile:notifying:trailer:ifFail:<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t know where it&#39;s coming from yet - that&#39;s the entire stack trace.<br>
&gt;&gt;<br>
&gt;&gt; frank<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 21 September 2013 18:17, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; I would expect these changes to break a lot of code..<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Fri, Sep 20, 2013 at 2:45 PM,  &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; Nicolas Cellier uploaded a new version of Traits to project The Trunk:<br>
&gt;&gt; &gt;&gt; <a href="http://source.squeak.org/trunk/Traits-nice.299.mcz" target="_blank">http://source.squeak.org/trunk/Traits-nice.299.mcz</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ==================== Summary ====================<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Name: Traits-nice.299<br>
&gt;&gt; &gt;&gt; Author: nice<br>
&gt;&gt; &gt;&gt; Time: 20 September 2013, 9:45:04.474 pm<br>
&gt;&gt; &gt;&gt; UUID: d6c18da8-7e93-4bcc-b94e-7f67426a2965<br>
&gt;&gt; &gt;&gt; Ancestors: Traits-nice.298<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Don&#39;t pass a category to a Compiler, classifying is not its job.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; =============== Diff against Traits-nice.298 ===============<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was changed:<br>
&gt;&gt; &gt;&gt;   ----- Method: ClassDescription&gt;&gt;traitAddSelector:withMethod: (in<br>
&gt;&gt; &gt;&gt; category &#39;*Traits-NanoKernel&#39;) -----<br>
&gt;&gt; &gt;&gt;   traitAddSelector: selector withMethod: traitMethod<br>
&gt;&gt; &gt;&gt;         &quot;Add a method inherited from a trait.<br>
&gt;&gt; &gt;&gt;         Recompiles to avoid sharing and implement aliasing.&quot;<br>
&gt;&gt; &gt;&gt;         | oldMethod source methodNode newMethod originalSelector |<br>
&gt;&gt; &gt;&gt;         oldMethod := self compiledMethodAt: selector ifAbsent:[nil].<br>
&gt;&gt; &gt;&gt;         oldMethod ifNotNil:[<br>
&gt;&gt; &gt;&gt;                 &quot;The following is an important optimization as it<br>
&gt;&gt; &gt;&gt; prevents exponential<br>
&gt;&gt; &gt;&gt;                 growth in recompilation. If T1 is used by T2 and T2 by<br>
&gt;&gt; &gt;&gt; T3 then (without<br>
&gt;&gt; &gt;&gt;                 this optimization) any change in T1 would cause all<br>
&gt;&gt; &gt;&gt; methods in T2 to be<br>
&gt;&gt; &gt;&gt;                 recompiled and each recompilation of a method in T2<br>
&gt;&gt; &gt;&gt; would cause T3<br>
&gt;&gt; &gt;&gt;                 to be fully recompiled. The test eliminates all such<br>
&gt;&gt; &gt;&gt; situations.&quot;<br>
&gt;&gt; &gt;&gt;                 (oldMethod sameTraitCodeAs: traitMethod)<br>
&gt;&gt; &gt;&gt; ifTrue:[^oldMethod].<br>
&gt;&gt; &gt;&gt;         ].<br>
&gt;&gt; &gt;&gt;         originalSelector := traitMethod selector.<br>
&gt;&gt; &gt;&gt;         source := traitMethod methodClass sourceCodeAt:<br>
&gt;&gt; &gt;&gt; originalSelector.<br>
&gt;&gt; &gt;&gt;         originalSelector == selector ifFalse:[<br>
&gt;&gt; &gt;&gt;                 &quot;Replace source selectors for aliases&quot;<br>
&gt;&gt; &gt;&gt;                 source := self replaceSelector: originalSelector<br>
&gt;&gt; &gt;&gt; withAlias: selector in: source.<br>
&gt;&gt; &gt;&gt;         ].<br>
&gt;&gt; &gt;&gt;         methodNode := self newCompiler<br>
&gt;&gt; &gt;&gt; +               compile: source in: self notifying: nil ifFail:[^nil].<br>
&gt;&gt; &gt;&gt; -               compile: source in: self classified: nil notifying: nil<br>
&gt;&gt; &gt;&gt; ifFail:[^nil].<br>
&gt;&gt; &gt;&gt;         newMethod := methodNode generate: self defaultMethodTrailer.<br>
&gt;&gt; &gt;&gt;         newMethod putSource: source fromParseNode: methodNode inFile: 2<br>
&gt;&gt; &gt;&gt;                 withPreamble: [:f | f cr; nextPut: $!!; nextChunkPut:<br>
&gt;&gt; &gt;&gt; &#39;Trait method&#39;; cr].<br>
&gt;&gt; &gt;&gt;         newMethod originalTraitMethod: traitMethod.<br>
&gt;&gt; &gt;&gt;         ^super addSelectorSilently: selector withMethod: newMethod.!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>