[squeak-dev] The Trunk: Compiler-ul.175.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 27 22:26:07 UTC 2010


Levente Uzonyi uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ul.175.mcz

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

Name: Compiler-ul.175
Author: ul
Time: 24 October 2010, 7:32:36.364 am
UUID: de13fc25-c32d-3444-986d-8d54b0c34689
Ancestors: Compiler-nice.174

- replace LiteralDictionaries with PluggableDictionaries part 1.

=============== Diff against Compiler-nice.174 ===============

Item was changed:
  ----- Method: Encoder>>sharableLitIndex: (in category 'encoding') -----
  sharableLitIndex: literal
  	"Special access prevents multiple entries for post-allocated super send special selectors"
  	1 to: literalStream position do:
  		[:index|
+ 		(literal literalEqual: (literalStream originalContents at: index)) ifTrue:
- 		(litSet literalEquality: literal and: (literalStream originalContents at: index)) ifTrue:
  			[^index - 1]].
  	^self litIndex: literal!

Item was changed:
  ----- Method: VariableNode class>>initialize (in category 'class initialization') -----
  initialize    "VariableNode initialize.  Decompiler initialize"
  	| encoder |
  	encoder := Encoder new.
  	StdVariables := Dictionary new: 16.
  	encoder
  		fillDict: StdVariables
  		with: VariableNode
  		mapping: #('self' 'thisContext' 'super' 'nil' 'false' 'true' )
  		to: (Array with: LdSelf with: LdThisContext with: LdSuper)
  				, (Array with: LdNil with: LdFalse with: LdTrue).
  	StdSelectors := Dictionary new: 64.
  	encoder
  		fillDict: StdSelectors
  		with: SelectorNode
  		mapping: ((1 to: Smalltalk specialSelectorSize) collect: 
  							[:i | Smalltalk specialSelectorAt: i])
  		to: (SendPlus to: SendPlus + 31).
+ 	StdLiterals := PluggableDictionary new equalBlock: [ :x :y | x literalEqual: y ].
- 	StdLiterals := LiteralDictionary new: 16.
  	encoder
  		fillDict: StdLiterals
  		with: LiteralNode
  		mapping: #(-1 0 1 2 )
  		to: (LdMinus1 to: LdMinus1 + 3).
  	encoder initScopeAndLiteralTables.
  
  	NodeNil := encoder encodeVariable: 'nil'.
  	NodeTrue := encoder encodeVariable: 'true'.
  	NodeFalse := encoder encodeVariable: 'false'.
  	NodeSelf := encoder encodeVariable: 'self'.
  	NodeThisContext := encoder encodeVariable: 'thisContext'.
  	NodeSuper := encoder encodeVariable: 'super'!

Item was changed:
+ (PackageInfo named: 'Compiler') postscript: '"Replace all LiteralDictionaries with PluggableDictionaries."
+ | instances newInstances |
+ instances := LiteralDictionary allInstances.
+ newInstances := instances collect: [ :literalDictionary | 
+ 	| pluggableDictionary |
+ 	pluggableDictionary := (PluggableDictionary new: literalDictionary size)
+ 		equalBlock: [ :a :b | a literalEqual: b ];
+ 		yourself.
+ 	literalDictionary associationsDo: [ :each |
+ 		pluggableDictionary add: each ].
+ 	pluggableDictionary ].
+ instances elementsForwardIdentityTo: newInstances'!
- (PackageInfo named: 'Compiler') postscript: '"After switching to closures, recompile everything"
- Utilities compileUsingClosures.
- '!




More information about the Squeak-dev mailing list