[squeak-dev] The Inbox: Compiler-ul.193.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Feb 20 16:23:53 UTC 2011
A new version of Compiler was added to project The Inbox:
http://source.squeak.org/inbox/Compiler-ul.193.mcz
==================== Summary ====================
Name: Compiler-ul.193
Author: ul
Time: 20 February 2011, 5:23:51.585 pm
UUID: 59f8e102-e41a-7547-abe7-a210bcbe4b74
Ancestors: Compiler-nice.192
- simplified MessageNode >> #checkBlock:as:from:maxArgs: and MessageNode >> #transformCase:
- deprecated all implementors of #canBeSpecialArgument, because it has no senders
=============== Diff against Compiler-nice.192 ===============
Item was changed:
----- Method: BlockNode>>canBeSpecialArgument (in category 'testing') -----
canBeSpecialArgument
"Can I be an argument of (e.g.) ifTrue:?"
+ self deprecated: 'Anything can be argument of inlined messages'.
^arguments size = 0!
Item was changed:
----- Method: MessageNode>>checkBlock:as:from:maxArgs: (in category 'private') -----
checkBlock: node as: nodeName from: encoder maxArgs: maxArgs
"Answer true if node is a BlockNode with at most maxArgs arguments.
This check is required in order to inline some special messages.
Notify some undue usage of these special messages."
+ node isBlockNode ifFalse: [ ^false ].
+ node numberOfArguments <= maxArgs ifTrue: [ ^true ].
+ ^encoder notify: '<- ', nodeName , ' of ' , (MacroSelectors at: special) , ' has too many arguments'!
- node isBlockNode
- ifTrue:
- [node numberOfArguments <= maxArgs
- ifTrue: [^true]
- ifFalse: [encoder notify: '<- ', nodeName , ' of ' ,
- (MacroSelectors at: special) , ' has too many arguments']].
- ^false!
Item was changed:
----- Method: MessageNode>>transformCase: (in category 'macro transformations') -----
transformCase: encoder
| caseNode |
caseNode := arguments first.
+ (caseNode isMemberOf: BraceNode) ifFalse: [ ^false ].
+ ((caseNode blockAssociationCheck: encoder)
+ and: [arguments size = 1
+ or: [self checkBlock: arguments last as: 'otherwise arg' from: encoder]]) ifFalse:
+ [^false].
+ caseNode elements do:
+ [:messageNode|
+ messageNode receiver noteOptimizedIn: self.
+ messageNode arguments first noteOptimizedIn: self].
+ arguments size = 2 ifTrue:
+ [arguments last noteOptimizedIn: self].
+ ^true!
- (caseNode isMemberOf: BraceNode) ifTrue:
- [((caseNode blockAssociationCheck: encoder)
- and: [arguments size = 1
- or: [self checkBlock: arguments last as: 'otherwise arg' from: encoder]]) ifFalse:
- [^false].
- caseNode elements do:
- [:messageNode|
- messageNode receiver noteOptimizedIn: self.
- messageNode arguments first noteOptimizedIn: self].
- arguments size = 2 ifTrue:
- [arguments last noteOptimizedIn: self].
- ^true].
- ^false!
Item was changed:
----- Method: ParseNode>>canBeSpecialArgument (in category 'testing') -----
canBeSpecialArgument
"Can I be an argument of (e.g.) ifTrue:?"
+ self deprecated: 'Anything can be argument of inlined messages'.
^false!
Item was changed:
----- Method: VariableNode>>canBeSpecialArgument (in category 'testing') -----
canBeSpecialArgument
"Can I be an argument of (e.g.) ifTrue:?"
+ self deprecated: 'Anything can be argument of inlined messages'.
^code < LdNil!
More information about the Squeak-dev
mailing list
|