[squeak-dev] The Trunk: Kernel-ar.385.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Feb 2 18:05:30 UTC 2010


Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ar.385.mcz

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

Name: Kernel-ar.385
Author: ar
Time: 2 February 2010, 10:03:42.112 am
UUID: ca133c5e-fb58-834d-aab1-1a61b83d6c3d
Ancestors: Kernel-ar.384

Fix handling of Class>>binding:
- Verify that the registered class in the environment is the receiver
- Install a common binding after recompilation 
- Add an accessor for installing the binding in CompiledMethod

=============== Diff against Kernel-ar.384 ===============

Item was changed:
  ----- Method: Behavior>>compileAllFrom: (in category 'compiling') -----
  compileAllFrom: oldClass
  	"Compile all the methods in the receiver's method dictionary.
  	This validates sourceCode and variable references and forces
  	all methods to use the current bytecode set"
+ 	| binding |
  	"ar 7/10/1999: Use oldClass selectors not self selectors"
+ 	oldClass selectorsDo: [:sel | self recompile: sel from: oldClass].
  	
+ 	"Ensure that we share a common binding after recompilation.
+ 	This is so that ClassBuilder reshapes avoid creating new bindings
+ 	for every method when recompiling a large class hierarchy."
+ 	binding := self binding.
+ 	self methodsDo:[:m|
+ 		m methodClassAssociation == binding 
+ 			ifFalse:[m methodClassAssociation: binding]].
+ !
- 	oldClass selectorsDo: [:sel | self recompile: sel from: oldClass].!

Item was added:
+ ----- Method: CompiledMethod>>methodClassAssociation: (in category 'accessing') -----
+ methodClassAssociation: aBinding
+ 	"sets the association to the class that I am installed in"
+ 	^self literalAt: self numLiterals put: aBinding!

Item was changed:
  ----- Method: Class>>binding (in category 'compiling') -----
  binding
+ 	"Answer a binding for the receiver, sharing if possible"
+ 	| binding |
+ 	binding := Smalltalk associationAt: name ifAbsent: [nil -> self].
+ 	^binding value == self ifTrue:[binding] ifFalse:[nil -> self].!
- 
- 	^ Smalltalk associationAt: name ifAbsent: [nil -> self]
- !




More information about the Squeak-dev mailing list