[squeak-dev] The Trunk: Compiler-nice.152.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jul 24 16:39:00 UTC 2010


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!




More information about the Squeak-dev mailing list