Hi Levente,<div><br></div><div> don't know about you, but I'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"><<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>></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 >> #actualClass to the System package<br>
- CompiledMethod >> #getPreambleFrom:at: allocates a non-empty buffer<br>
- added Behavior >> #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>>thoroughWhichSelectorsReferTo:special:byte: (in category 'testing method dictionary') -----<br>
thoroughWhichSelectorsReferTo: literal special: specialFlag byte: specialByte<br>
"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 "<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>>whichSelectorsReferTo:special:byte: (in category 'testing method dictionary') -----<br>
whichSelectorsReferTo: literal special: specialFlag byte: specialByte<br>
"Answer a set of selectors whose methods access the argument as a literal."<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>>whichSelectorsReferTo:special:byte:thorough: (in category 'testing method dictionary') -----<br>
+ whichSelectorsReferTo: literal special: specialFlag byte: specialByte thorough: thorough<br>
+ "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 "<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>>getPreambleFrom:at: (in category 'source code management') -----<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>>actualClass (in category '*Kernel-Traits') -----<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>