--- a/MessageNode.st Thu Feb 25 15:48:48 1999 +0100
+++ b/MessageNode.st Thu Feb 25 15:49:27 1999 +0100
@@ -1896,9 +1896,9 @@
codeWhileOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler
"generate code for
- [...] whileXXX:[ ... ]
+ [...] whileXXX:[ ... ]
and also
- [...] whileXXX
+ [...] whileXXX
"
|pos pos2 theReceiver theArg theByteCode optByteCode needLineNr blockExpr
@@ -1906,18 +1906,18 @@
hasLoopBlock := true.
(selector == #whileTrue:) ifTrue:[
- theByteCode := #falseJump.
+ theByteCode := #falseJump.
] ifFalse:[
- (selector == #whileFalse:) ifTrue:[
- theByteCode := #trueJump
- ] ifFalse:[
- hasLoopBlock := false.
- (selector == #whileTrue) ifTrue:[
- theByteCode := #trueJump
- ] ifFalse:[
- theByteCode := #falseJump
- ].
- ]
+ (selector == #whileFalse:) ifTrue:[
+ theByteCode := #trueJump
+ ] ifFalse:[
+ hasLoopBlock := false.
+ (selector == #whileTrue) ifTrue:[
+ theByteCode := #trueJump
+ ] ifFalse:[
+ theByteCode := #falseJump
+ ].
+ ]
].
theReceiver := receiver.
@@ -1927,18 +1927,18 @@
and:[receiver statements nextStatement isNil
and:[receiver statements expression notNil]]])
ifTrue:[
- fastReceiver := receiver statements expression.
- optByteCode := self optimizedConditionFor:fastReceiver with:theByteCode.
+ fastReceiver := receiver statements expression.
+ optByteCode := self optimizedConditionFor:fastReceiver with:theByteCode.
] ifFalse:[
- optByteCode := self optimizedConditionFor:theReceiver with:theByteCode.
+ optByteCode := self optimizedConditionFor:theReceiver with:theByteCode.
].
optByteCode notNil ifTrue:[
- ((optByteCode == #eqJump) or:[optByteCode == #notEqJump]) ifTrue:[
- theArg := receiver statements expression arg1
- ].
- theReceiver := receiver statements expression receiver.
- theByteCode := optByteCode
+ ((optByteCode == #eqJump) or:[optByteCode == #notEqJump]) ifTrue:[
+ theArg := receiver statements expression arg1
+ ].
+ theReceiver := receiver statements expression receiver.
+ theByteCode := optByteCode
].
"/ OLD:
@@ -1949,90 +1949,90 @@
pos := aStream position.
"/ aCompiler lineNumberInfo == #full ifTrue:[
- ParseNode codeLineNumber:lineNr on:aStream for:aCompiler.
- needLineNr := false.
+ self codeLineNumber:lineNr on:aStream for:aCompiler.
+ needLineNr := false.
"/ ].
optByteCode notNil ifTrue:[
- theReceiver codeOn:aStream inBlock:b for:aCompiler.
- theArg notNil ifTrue:[
- theArg codeOn:aStream inBlock:b for:aCompiler
- ]
+ theReceiver codeOn:aStream inBlock:b for:aCompiler.
+ theArg notNil ifTrue:[
+ theArg codeOn:aStream inBlock:b for:aCompiler
+ ]
] ifFalse:[
- fastReceiver notNil ifTrue:[
- theByteCode == #trueJump ifTrue:[
- fastReceiver isConstant ifTrue:[
- fastReceiver evaluate == true ifTrue:[
- theByteCode := #jump
- ] ifFalse:[
- fastReceiver evaluate == false ifTrue:[
- theByteCode := #never
- ]
- ]
- ]
- ] ifFalse:[
- theByteCode == #falseJump ifTrue:[
- fastReceiver isConstant ifTrue:[
- fastReceiver evaluate == false ifTrue:[
- theByteCode := #jump
- ] ifFalse:[
- fastReceiver evaluate == true ifTrue:[
- theByteCode := #never
- ]
- ]
- ]
- ]
- ]
- ].
+ fastReceiver notNil ifTrue:[
+ theByteCode == #trueJump ifTrue:[
+ fastReceiver isConstant ifTrue:[
+ fastReceiver evaluate == true ifTrue:[
+ theByteCode := #jump
+ ] ifFalse:[
+ fastReceiver evaluate == false ifTrue:[
+ theByteCode := #never
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ theByteCode == #falseJump ifTrue:[
+ fastReceiver isConstant ifTrue:[
+ fastReceiver evaluate == false ifTrue:[
+ theByteCode := #jump
+ ] ifFalse:[
+ fastReceiver evaluate == true ifTrue:[
+ theByteCode := #never
+ ]
+ ]
+ ]
+ ]
+ ]
+ ].
- (theByteCode ~~ #jump
- and:[theByteCode ~~ #never]) ifTrue:[
- theReceiver codeInlineOn:aStream inBlock:b for:aCompiler.
- ].
+ (theByteCode ~~ #jump
+ and:[theByteCode ~~ #never]) ifTrue:[
+ theReceiver codeInlineOn:aStream inBlock:b for:aCompiler.
+ ].
- "/
- "/ cannot enable code below
- "/ (tiny loops would not be debuggable with next, since lineNo remains the same)
- "/ think about it ...
- "/
- blockExpr := theReceiver simpleSendBlockExpression.
- blockExpr notNil ifTrue:[
- blockExpr isMessage ifTrue:[
- (aCompiler hasLineNumber:(blockExpr selector)) ifTrue:[
- blockExpr lineNumber == lineNr ifTrue:[
- needLineNr := false
- ]
- ]
- ]
- ].
+ "/
+ "/ cannot enable code below
+ "/ (tiny loops would not be debuggable with next, since lineNo remains the same)
+ "/ think about it ...
+ "/
+ blockExpr := theReceiver simpleSendBlockExpression.
+ blockExpr notNil ifTrue:[
+ blockExpr isMessage ifTrue:[
+ (aCompiler hasLineNumber:(blockExpr selector)) ifTrue:[
+ blockExpr lineNumber == lineNr ifTrue:[
+ needLineNr := false
+ ]
+ ]
+ ]
+ ].
].
needLineNr ifTrue:[
- ParseNode codeLineNumber:lineNr on:aStream for:aCompiler.
+ ParseNode codeLineNumber:lineNr on:aStream for:aCompiler.
].
hasLoopBlock ifFalse:[
- "/ simple [...] whileXXX
- theByteCode ~~ #never ifTrue:[
- aStream nextPut:theByteCode; nextPut:pos.
- ].
+ "/ simple [...] whileXXX
+ theByteCode ~~ #never ifTrue:[
+ aStream nextPut:theByteCode; nextPut:pos.
+ ].
- valueNeeded ifTrue:[aStream nextPut:#pushNil].
- ^ self
+ valueNeeded ifTrue:[aStream nextPut:#pushNil].
+ ^ self
].
"/ [...] whileXXX:[...]
theByteCode ~~ #never ifTrue:[
- aStream nextPut:theByteCode.
- pos2 := aStream position.
- aStream nextPut:0.
+ aStream nextPut:theByteCode.
+ pos2 := aStream position.
+ aStream nextPut:0.
].
(argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler.
aStream nextPut:#jump; nextPut:pos.
theByteCode ~~ #never ifTrue:[
- (aStream contents) at:pos2 put:(aStream position).
+ (aStream contents) at:pos2 put:(aStream position).
].
valueNeeded ifTrue:[aStream nextPut:#pushNil].
@@ -2352,5 +2352,5 @@
!MessageNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.89 1999-02-17 19:35:07 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.90 1999-02-25 14:49:10 cg Exp $'
! !