oops - dont try to inline: (expr or:expr2) ifXXX
authorClaus Gittinger <cg@exept.de>
Thu, 18 Jul 1996 10:01:16 +0200
changeset 308 fe3b95e6d9c0
parent 307 2552fd5e8592
child 309 11b78163a914
oops - dont try to inline: (expr or:expr2) ifXXX if expr2 is not a block-expression.
MessageNd.st
MessageNode.st
--- a/MessageNd.st	Sat Jul 13 01:02:48 1996 +0200
+++ b/MessageNd.st	Thu Jul 18 10:01:16 1996 +0200
@@ -17,7 +17,7 @@
 	category:'System-Compiler-Support'
 !
 
-!MessageNode class methodsFor:'documentation'!
+!MessageNode  class methodsFor:'documentation'!
 
 copyright
 "
@@ -43,7 +43,7 @@
 "
 ! !
 
-!MessageNode class methodsFor:'instance creation'!
+!MessageNode  class methodsFor:'instance creation'!
 
 receiver:recNode selector:selectorString 
     ^ (self basicNew) receiver:recNode selector:selectorString args:nil lineno:0
@@ -606,51 +606,56 @@
     theReceiver := receiver.
 
     (theReceiver isMessage) ifTrue:[
-	subsel := theReceiver selector.
-	(subsel == #and:) ifTrue:[
-	    self codeAndIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
-	    ^ self
-	].
-	(subsel == #or:) ifTrue:[
-	    self codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
-	    ^ self
-	]
+        subsel := theReceiver selector.
+
+        (subsel == #and:) ifTrue:[
+            theReceiver arg1 isBlockNode ifTrue:[
+                self codeAndIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
+                ^ self
+            ]
+        ].
+        (subsel == #or:) ifTrue:[
+            theReceiver arg1 isBlockNode ifTrue:[
+                self codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
+                ^ self
+            ]
+        ]
     ].
     (selector == #ifTrue:) ifTrue:[
-	theByteCode := #falseJump
+        theByteCode := #falseJump
     ] ifFalse:[
-	theByteCode := #trueJump
+        theByteCode := #trueJump
     ].
     optByteCode := self optimizedConditionFor:theReceiver
-					 with:theByteCode.
+                                         with:theByteCode.
     optByteCode notNil ifTrue:[
-	((optByteCode == #eqJump) or:[optByteCode == #notEqJump]) ifTrue:[
-	    theArg := theReceiver arg1
-	].
-	theReceiver := theReceiver receiver.
-	theByteCode := optByteCode
+        ((optByteCode == #eqJump) or:[optByteCode == #notEqJump]) ifTrue:[
+            theArg := theReceiver arg1
+        ].
+        theReceiver := theReceiver receiver.
+        theByteCode := optByteCode
     ].
 
     theReceiver codeOn:aStream inBlock:b for:aCompiler.
     theArg notNil ifTrue:[
-	theArg codeOn:aStream inBlock:b for:aCompiler
+        theArg codeOn:aStream inBlock:b for:aCompiler
     ].
 
     needLineNr := true.
     theArg isNil ifTrue:[
-	theReceiver isMessage ifTrue:[
-	    (aCompiler hasLineNumber:(theReceiver selector)) ifTrue:[
-		theReceiver lineNumber == lineNr ifTrue:[
-		    needLineNr := false
-		]
-	    ]
-	]
+        theReceiver isMessage ifTrue:[
+            (aCompiler hasLineNumber:(theReceiver selector)) ifTrue:[
+                theReceiver lineNumber == lineNr ifTrue:[
+                    needLineNr := false
+                ]
+            ]
+        ]
     ].
 
     needLineNr ifTrue:[
-	(lineNr between:1 and:255) ifTrue:[
-	    aStream nextPut:#lineno; nextPut:lineNr.
-	]
+        (lineNr between:1 and:255) ifTrue:[
+            aStream nextPut:#lineno; nextPut:lineNr.
+        ]
     ].
 
     aStream nextPut:theByteCode.
@@ -660,15 +665,17 @@
 
     code := aStream contents.
     valueNeeded ifTrue:[
-	aStream nextPut:#jump.
-	pos2 := aStream position.
-	aStream nextPut:0.
-	code at:pos put:(aStream position).
-	aStream nextPut:#pushNil.
-	code at:pos2 put:(aStream position)
+        aStream nextPut:#jump.
+        pos2 := aStream position.
+        aStream nextPut:0.
+        code at:pos put:(aStream position).
+        aStream nextPut:#pushNil.
+        code at:pos2 put:(aStream position)
     ] ifFalse:[
-	code at:pos put:(aStream position)
+        code at:pos put:(aStream position)
     ]
+
+    "Modified: 18.7.1996 / 09:58:53 / cg"
 !
 
 codeOn:aStream inBlock:b for:aCompiler
@@ -1554,8 +1561,8 @@
     ^ true
 ! !
 
-!MessageNode class methodsFor:'documentation'!
+!MessageNode  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.48 1996-06-17 14:13:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.49 1996-07-18 08:01:16 cg Exp $'
 ! !
--- a/MessageNode.st	Sat Jul 13 01:02:48 1996 +0200
+++ b/MessageNode.st	Thu Jul 18 10:01:16 1996 +0200
@@ -17,7 +17,7 @@
 	category:'System-Compiler-Support'
 !
 
-!MessageNode class methodsFor:'documentation'!
+!MessageNode  class methodsFor:'documentation'!
 
 copyright
 "
@@ -43,7 +43,7 @@
 "
 ! !
 
-!MessageNode class methodsFor:'instance creation'!
+!MessageNode  class methodsFor:'instance creation'!
 
 receiver:recNode selector:selectorString 
     ^ (self basicNew) receiver:recNode selector:selectorString args:nil lineno:0
@@ -606,51 +606,56 @@
     theReceiver := receiver.
 
     (theReceiver isMessage) ifTrue:[
-	subsel := theReceiver selector.
-	(subsel == #and:) ifTrue:[
-	    self codeAndIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
-	    ^ self
-	].
-	(subsel == #or:) ifTrue:[
-	    self codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
-	    ^ self
-	]
+        subsel := theReceiver selector.
+
+        (subsel == #and:) ifTrue:[
+            theReceiver arg1 isBlockNode ifTrue:[
+                self codeAndIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
+                ^ self
+            ]
+        ].
+        (subsel == #or:) ifTrue:[
+            theReceiver arg1 isBlockNode ifTrue:[
+                self codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler.
+                ^ self
+            ]
+        ]
     ].
     (selector == #ifTrue:) ifTrue:[
-	theByteCode := #falseJump
+        theByteCode := #falseJump
     ] ifFalse:[
-	theByteCode := #trueJump
+        theByteCode := #trueJump
     ].
     optByteCode := self optimizedConditionFor:theReceiver
-					 with:theByteCode.
+                                         with:theByteCode.
     optByteCode notNil ifTrue:[
-	((optByteCode == #eqJump) or:[optByteCode == #notEqJump]) ifTrue:[
-	    theArg := theReceiver arg1
-	].
-	theReceiver := theReceiver receiver.
-	theByteCode := optByteCode
+        ((optByteCode == #eqJump) or:[optByteCode == #notEqJump]) ifTrue:[
+            theArg := theReceiver arg1
+        ].
+        theReceiver := theReceiver receiver.
+        theByteCode := optByteCode
     ].
 
     theReceiver codeOn:aStream inBlock:b for:aCompiler.
     theArg notNil ifTrue:[
-	theArg codeOn:aStream inBlock:b for:aCompiler
+        theArg codeOn:aStream inBlock:b for:aCompiler
     ].
 
     needLineNr := true.
     theArg isNil ifTrue:[
-	theReceiver isMessage ifTrue:[
-	    (aCompiler hasLineNumber:(theReceiver selector)) ifTrue:[
-		theReceiver lineNumber == lineNr ifTrue:[
-		    needLineNr := false
-		]
-	    ]
-	]
+        theReceiver isMessage ifTrue:[
+            (aCompiler hasLineNumber:(theReceiver selector)) ifTrue:[
+                theReceiver lineNumber == lineNr ifTrue:[
+                    needLineNr := false
+                ]
+            ]
+        ]
     ].
 
     needLineNr ifTrue:[
-	(lineNr between:1 and:255) ifTrue:[
-	    aStream nextPut:#lineno; nextPut:lineNr.
-	]
+        (lineNr between:1 and:255) ifTrue:[
+            aStream nextPut:#lineno; nextPut:lineNr.
+        ]
     ].
 
     aStream nextPut:theByteCode.
@@ -660,15 +665,17 @@
 
     code := aStream contents.
     valueNeeded ifTrue:[
-	aStream nextPut:#jump.
-	pos2 := aStream position.
-	aStream nextPut:0.
-	code at:pos put:(aStream position).
-	aStream nextPut:#pushNil.
-	code at:pos2 put:(aStream position)
+        aStream nextPut:#jump.
+        pos2 := aStream position.
+        aStream nextPut:0.
+        code at:pos put:(aStream position).
+        aStream nextPut:#pushNil.
+        code at:pos2 put:(aStream position)
     ] ifFalse:[
-	code at:pos put:(aStream position)
+        code at:pos put:(aStream position)
     ]
+
+    "Modified: 18.7.1996 / 09:58:53 / cg"
 !
 
 codeOn:aStream inBlock:b for:aCompiler
@@ -1554,8 +1561,8 @@
     ^ true
 ! !
 
-!MessageNode class methodsFor:'documentation'!
+!MessageNode  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.48 1996-06-17 14:13:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.49 1996-07-18 08:01:16 cg Exp $'
 ! !