Hi Levente,<div><br></div><div>    don&#39;t know about you, but I&#39;d like to see all of MethodReference in the base, and not have it as a series of extensions all over the place.  This is really important reflective infrastructure.  </div>
<div><br></div><div>best,</div><div>Eliot<br><br><div class="gmail_quote">On Mon, Mar 14, 2011 at 9:51 AM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Levente Uzonyi uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-ul.550.mcz" target="_blank">http://source.squeak.org/trunk/Kernel-ul.550.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-ul.550<br>
Author: ul<br>
Time: 13 March 2011, 8:55:41.533 pm<br>
UUID: 0fbe4def-75cd-a747-9d26-44e6a9daaa04<br>
Ancestors: Kernel-ul.549<br>
<br>
- moved MethodReference &gt;&gt; #actualClass to the System package<br>
- CompiledMethod &gt;&gt; #getPreambleFrom:at: allocates a non-empty buffer<br>
- added Behavior &gt;&gt; #whichSelectorsReferTo:special:byte:thorough: which unifies<br>
#whichSelectorsReferTo:special:byte: and #thoroughWhichSelectorsReferTo:special:byte:<br>
<br>
=============== Diff against Kernel-ul.549 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Behavior&gt;&gt;thoroughWhichSelectorsReferTo:special:byte: (in category &#39;testing method dictionary&#39;) -----<br>
  thoroughWhichSelectorsReferTo: literal special: specialFlag byte: specialByte<br>
        &quot;Answer a set of selectors whose methods access the argument as a<br>
        literal. Dives into the compact literal notation, making it slow but<br>
        thorough &quot;<br>
<br>
+       ^self whichSelectorsReferTo: literal special: specialFlag byte: specialByte thorough: true!<br>
-       | who |<br>
-       who := IdentitySet new.<br>
-       self selectorsAndMethodsDo:<br>
-               [:sel :method |<br>
-               ((method hasLiteralThorough: literal) or: [specialFlag and: [method scanFor: specialByte]])<br>
-                       ifTrue:<br>
-                               [((literal isVariableBinding) not<br>
-                                       or: [method literals allButLast includes: literal])<br>
-                                               ifTrue: [who add: sel]]].<br>
-       ^ who!<br>
<br>
Item was changed:<br>
  ----- Method: Behavior&gt;&gt;whichSelectorsReferTo:special:byte: (in category &#39;testing method dictionary&#39;) -----<br>
  whichSelectorsReferTo: literal special: specialFlag byte: specialByte<br>
        &quot;Answer a set of selectors whose methods access the argument as a literal.&quot;<br>
<br>
+       ^self whichSelectorsReferTo: literal special: specialFlag byte: specialByte thorough: false!<br>
-       | who |<br>
-       who := IdentitySet new.<br>
-       self selectorsAndMethodsDo:<br>
-               [:sel :method |<br>
-               ((method hasLiteral: literal) or: [specialFlag and: [method scanFor: specialByte]])<br>
-                       ifTrue:<br>
-                               [((literal isVariableBinding) not<br>
-                                       or: [method literals allButLast includes: literal])<br>
-                                               ifTrue: [who add: sel]]].<br>
-       ^ who!<br>
<br>
Item was added:<br>
+ ----- Method: Behavior&gt;&gt;whichSelectorsReferTo:special:byte:thorough: (in category &#39;testing method dictionary&#39;) -----<br>
+ whichSelectorsReferTo: literal special: specialFlag byte: specialByte thorough: thorough<br>
+       &quot;Answer a set of selectors whose methods access the argument as a literal. If thorough is true, then dives into the compact literal notation, making it slow but thorough &quot;<br>
+<br>
+       | who |<br>
+       who := IdentitySet new.<br>
+       self selectorsAndMethodsDo: [ :selector :method |<br>
+               (((thorough<br>
+                       ifFalse: [ method hasLiteral: literal ]<br>
+                       ifTrue: [ method hasLiteralThorough: literal ]) or: [<br>
+                               specialFlag and: [ method scanFor: specialByte ] ]) and: [<br>
+                       literal isVariableBinding not or: [<br>
+                               method literals allButLast includes: literal] ]) ifTrue: [<br>
+                       who add: selector ] ].<br>
+       ^who!<br>
<br>
Item was changed:<br>
  ----- Method: CompiledMethod&gt;&gt;getPreambleFrom:at: (in category &#39;source code management&#39;) -----<br>
  getPreambleFrom: aFileStream at: position<br>
<br>
        |  writeStream |<br>
+       writeStream := (String new: 100) writeStream.<br>
-       writeStream := String new writeStream.<br>
        position to: 0 by: -1 do: [ :p |<br>
                | c |<br>
                aFileStream position: p.<br>
                (c := aFileStream basicNext) == $!!<br>
                        ifTrue: [ ^writeStream contents reversed ]<br>
                        ifFalse: [ writeStream nextPut: c ] ]!<br>
<br>
Item was removed:<br>
- ----- Method: MethodReference&gt;&gt;actualClass (in category &#39;*Kernel-Traits&#39;) -----<br>
- actualClass<br>
-<br>
-       | actualClass |<br>
-<br>
-       actualClass := Smalltalk at: classSymbol ifAbsent: [^nil].<br>
-       classIsMeta ifTrue: [^actualClass classSide].<br>
-       ^actualClass<br>
-<br>
- !<br>
<br>
<br>
</blockquote></div><br></div>