156 (variable type == #WorkspaceVariable) ifTrue:[ |
156 (variable type == #WorkspaceVariable) ifTrue:[ |
157 "/ this is done by keeping the valueHolder in the literalArray, |
157 "/ this is done by keeping the valueHolder in the literalArray, |
158 "/ and coding a #value: message here. |
158 "/ and coding a #value: message here. |
159 |
159 |
160 litIdx := aCompiler addLiteral:variable token. |
160 litIdx := aCompiler addLiteral:variable token. |
161 aStream nextPut:#pushLitS; nextPut:litIdx. |
161 self emitPushLiteralIndex:litIdx on:aStream for:aCompiler. |
|
162 |
162 expression codeOn:aStream inBlock:b for:aCompiler. |
163 expression codeOn:aStream inBlock:b for:aCompiler. |
163 |
164 |
164 selLitIdx := aCompiler addLiteral:#value:. |
165 selLitIdx := aCompiler addLiteral:#value:. |
165 selLitIdx <= 255 ifTrue:[ |
166 self emitSendLiteralIndex:selLitIdx numArgs:1 line:(lineNr ? 1) on:aStream. |
166 aStream nextPut:#send1; nextPut:(lineNr ? 1); nextPut:selLitIdx. |
|
167 ] ifFalse:[ |
|
168 aStream nextPut:#sendL; nextPut:(lineNr ? 1); nextPut:selLitIdx; nextPut:0; nextPut:1 "nargs". |
|
169 ]. |
|
170 aStream nextPut:#drop. |
167 aStream nextPut:#drop. |
171 |
168 |
172 forValue ifTrue:[ |
169 forValue ifTrue:[ |
173 (expression isConstant or:[expression isVariable]) ifTrue:[ |
170 (expression isConstant or:[expression isVariable]) ifTrue:[ |
174 expression codeOn:aStream inBlock:b for:aCompiler. |
171 expression codeOn:aStream inBlock:b for:aCompiler. |
175 ] ifFalse:[ |
172 ] ifFalse:[ |
176 "/ fetch value from the holder - sigh |
173 "/ fetch value from the holder - sigh |
177 aStream nextPut:#pushLitS; nextPut:litIdx. |
174 self emitPushLiteralIndex:litIdx on:aStream for:aCompiler. |
178 |
175 |
179 selLitIdx := aCompiler addLiteral:#value. |
176 selLitIdx := aCompiler addLiteral:#value. |
180 selLitIdx <= 255 ifTrue:[ |
177 self emitSendLiteralIndex:selLitIdx numArgs:0 line:(lineNr ? 1) on:aStream. |
181 aStream nextPut:#send0; nextPut:(lineNr ? 1); nextPut:selLitIdx. |
|
182 ] ifFalse:[ |
|
183 aStream nextPut:#sendL; nextPut:(lineNr ? 1); nextPut:selLitIdx; nextPut:0; nextPut:1 "nargs". |
|
184 ]. |
|
185 ] |
178 ] |
186 ]. |
179 ]. |
187 ^ self |
180 ^ self |
188 ]. |
181 ]. |
189 |
182 |