The Trunk: Compiler-nice.152.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Compiler-nice.152.mcz

commits-2
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.152.mcz

==================== Summary ====================

Name: Compiler-nice.152
Author: nice
Time: 24 July 2010, 6:38:46.043 pm
UUID: 11850e30-a071-425e-a01a-a52faffbddcd
Ancestors: Compiler-jcg.147

Add the possibility in new code generation scheme to access shared variables by sending message #value to the variable binding instead of fetching second instance variable.
This did already exist in old code generation scheme and is controlled by #isSpecialReadBinding.

=============== Diff against Compiler-jcg.147 ===============

Item was changed:
  ----- Method: LiteralVariableNode>>sizeCodeForValue: (in category 'code generation (new scheme)') -----
  sizeCodeForValue: encoder
  self reserve: encoder.
+ (key isVariableBinding and: [key isSpecialReadBinding])
+ ifFalse:
+ [^encoder sizePushLiteralVar: index].
+ readNode := MessageNode new
+ receiver: (encoder encodeLiteral: key)
+ selector: (encoder encodeSelector: #value)
+ arguments: #()
+ precedence: #value precedence.
+ ^readNode sizeCodeForValue: encoder!
- ^encoder sizePushLiteralVar: index!

Item was changed:
  ----- Method: LiteralVariableNode>>emitCodeForValue:encoder: (in category 'code generation (new scheme)') -----
  emitCodeForValue: stack encoder: encoder
+ ^readNode
+ ifNil: [stack push: 1.
+ encoder genPushLiteralVar: index]
+ ifNotNil: [readNode emitCodeForValue: stack encoder: encoder]!
- stack push: 1.
- ^encoder genPushLiteralVar: index!