some code savers for common code-emit;
also a bug-fix for workspace vars.
--- a/AssignmentNode.st Wed Aug 09 13:58:47 2006 +0200
+++ b/AssignmentNode.st Wed Aug 09 13:59:12 2006 +0200
@@ -158,15 +158,12 @@
"/ and coding a #value: message here.
litIdx := aCompiler addLiteral:variable token.
- aStream nextPut:#pushLitS; nextPut:litIdx.
+ self emitPushLiteralIndex:litIdx on:aStream for:aCompiler.
+
expression codeOn:aStream inBlock:b for:aCompiler.
selLitIdx := aCompiler addLiteral:#value:.
- selLitIdx <= 255 ifTrue:[
- aStream nextPut:#send1; nextPut:(lineNr ? 1); nextPut:selLitIdx.
- ] ifFalse:[
- aStream nextPut:#sendL; nextPut:(lineNr ? 1); nextPut:selLitIdx; nextPut:0; nextPut:1 "nargs".
- ].
+ self emitSendLiteralIndex:selLitIdx numArgs:1 line:(lineNr ? 1) on:aStream.
aStream nextPut:#drop.
forValue ifTrue:[
@@ -174,14 +171,10 @@
expression codeOn:aStream inBlock:b for:aCompiler.
] ifFalse:[
"/ fetch value from the holder - sigh
- aStream nextPut:#pushLitS; nextPut:litIdx.
+ self emitPushLiteralIndex:litIdx on:aStream for:aCompiler.
selLitIdx := aCompiler addLiteral:#value.
- selLitIdx <= 255 ifTrue:[
- aStream nextPut:#send0; nextPut:(lineNr ? 1); nextPut:selLitIdx.
- ] ifFalse:[
- aStream nextPut:#sendL; nextPut:(lineNr ? 1); nextPut:selLitIdx; nextPut:0; nextPut:1 "nargs".
- ].
+ self emitSendLiteralIndex:selLitIdx numArgs:0 line:(lineNr ? 1) on:aStream.
]
].
^ self
@@ -271,5 +264,5 @@
!AssignmentNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/AssignmentNode.st,v 1.36 2005-04-20 14:43:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/AssignmentNode.st,v 1.37 2006-08-09 11:59:12 cg Exp $'
! !