--- a/MessageNode.st Wed Feb 04 11:14:21 2015 +0100
+++ b/MessageNode.st Fri Feb 06 09:33:09 2015 +0100
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libcomp' }"
+"{ NameSpace: Smalltalk }"
+
ParseNode subclass:#MessageNode
instanceVariableNames:'receiver selector argArray lineNr selectorPosition lines
endLineNr endCharPosition selectorPartPositions'
@@ -3277,7 +3279,9 @@
withConstantValueDo:aBlock
"return true, if this evaluates to a constant value
- and evaluate aBlock with it. Used for constant folding"
+ and evaluate aBlock with it.
+ Also return true, if the node can be evaluated at compile time.
+ Used for constant folding"
|recVal argValues allArgsConstant fold cond2 condVal2|
@@ -3286,7 +3290,9 @@
(selector == #respondsTo:) ifTrue:[
argArray size == 1 ifTrue:[
argArray first isConstant ifTrue:[
- argArray first value == #isSmalltalkX ifTrue:[
+ (#(isSmalltalkX isVisualSmalltalkEnterprise isVisualWorks isSqueak)
+ includesIdentical: argArray first value)
+ ifTrue:[
"/ true here !!
aBlock value:true.
^ true
@@ -3300,6 +3306,14 @@
aBlock value:true.
^ true
].
+ "/ (Smalltalk isVisualSmalltalkEnterprise) -> false
+ ((selector == #isVisualSmalltalkEnterprise)
+ or:[ (selector == #isVisualWorks)
+ or:[ (selector == #isSqueak) ]]) ifTrue:[
+ "/ true here !!
+ aBlock value:false.
+ ^ true
+ ].
].
(receiver withConstantValueDo:[:val | recVal := val]) ifTrue:[
@@ -3398,11 +3412,11 @@
!MessageNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.212 2014-07-12 05:41:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.213 2015-02-06 08:33:09 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.212 2014-07-12 05:41:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.213 2015-02-06 08:33:09 cg Exp $'
!
version_SVN