[squeak-dev] The Trunk: Kernel-nice.609.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jul 20 07:30:21 UTC 2011
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.609.mcz
==================== Summary ====================
Name: Kernel-nice.609
Author: nice
Time: 20 July 2011, 9:29:30.183 am
UUID: 50b9cca2-c2a0-47c3-a367-2eae2ed530de
Ancestors: Kernel-eem.608
Use literalEqual: in hasLiteral: and hasLiteralThorough:
Remove hasLiteralThorough:from: because it is suspect:
- it is not sent
- it checks whether aLiteral == aBlock which cannot happen in Squeak implementation
- it send hasLiteralThorough: to literals which was weired and is now deprecated
=============== Diff against Kernel-eem.608 ===============
Item was changed:
----- Method: CompiledMethod>>hasLiteral: (in category 'literals') -----
hasLiteral: literal
- | litClass lit |
"Answer whether the receiver references the argument, literal."
- litClass := literal class.
2 to: self numLiterals - 1 do: "exclude superclass + selector/properties"
[:index |
+ ((self objectAt: index) literalEqual: literal) ifTrue: [^true]].
- lit := self objectAt: index.
- (litClass == lit class and: [literal = lit]) ifTrue: [^true]].
^false!
Item was changed:
----- Method: CompiledMethod>>hasLiteralThorough: (in category 'literals') -----
hasLiteralThorough: literal
"Answer true if any literal in this method is literal,
even if embedded in array structure."
(self penultimateLiteral isMethodProperties
and: [self penultimateLiteral hasLiteralThorough: literal]) ifTrue:[^true].
2 to: self numLiterals - 1 "exclude superclass + selector/properties"
do:[:index | | lit |
+ (((lit := self objectAt: index) literalEqual: literal)
- ((lit := self objectAt: index) == literal
or: [(lit isVariableBinding and: [lit key == literal])
or: [lit isArray and: [lit hasLiteral: literal]]]) ifTrue:
[^ true]].
^ false !
Item was removed:
- ----- Method: CompiledMethod>>hasLiteralThorough:from: (in category 'literals') -----
- hasLiteralThorough: aLiteral from: aBlock
- "Answer true if any literal in this method is literal, even if embedded in array structure or within its pragmas."
-
- | literal |
- self pragmas do: [ :pragma |
- (pragma hasLiteral: aLiteral) ifTrue: [ ^ true ] ].
- 2 to: self numLiterals + 1 do: [ :index |
- literal := self objectAt: index.
- literal == aLiteral ifTrue: [ ^ true ].
- literal == aBlock ifFalse:[ (literal hasLiteralThorough: aLiteral) ifTrue: [ ^ true ]] ].
- ^ false.!
More information about the Squeak-dev
mailing list
|