[squeak-dev] The Trunk: Kernel-nice.1311.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Mar 8 11:24:23 UTC 2020


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1311.mcz

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

Name: Kernel-nice.1311
Author: nice
Time: 8 March 2020, 12:24:19.658773 pm
UUID: 65fc97e5-6304-4459-ad5e-c2f3c94f5e34
Ancestors: Kernel-dtl.1310

Fix comparison of FullBlockClosures

Note: it's a bit misleading to get the compiledBlock into the startpc inst.var.
Note that other usage of startpc could as well be protected thru (self startpc).
I did not do it, because all other messages using the inst. var. are redefined in FullBlockClosure.

=============== Diff against Kernel-mt.1309 ===============

Item was changed:
  ----- Method: BlockClosure>>= (in category 'comparing') -----
  = aClosure
  	self == aClosure ifTrue: [^true].
  	aClosure class = self class ifFalse: [^false].
+ 	(self method == aClosure method and: [self startpc = aClosure startpc and: [self isClean]])
- 	(self method == aClosure method and: [startpc = aClosure startpc and: [self isClean]])
  		ifTrue: [^true].
+ 	^outerContext = aClosure outerContext and: [self startpc = aClosure startpc]!
- 	^outerContext = aClosure outerContext and: [startpc = aClosure startpc]!

Item was added:
+ ----- Method: CompiledCode class>>multipleBytecodeSetsActive: (in category 'method encoding') -----
+ multipleBytecodeSetsActive: aBoolean
+ 	"Inform the VM when multiple bytecode sets, typically the Sista bytecodes
+ 	in addition to the traditional V3 bytecode set, are now in use is this image.
+ 	The VM may use this information to update the image format number when
+ 	saving the image to the file system."
+ 
+ 	<primitive: 'primitiveMultipleBytecodeSetsActive'>
+ !

Item was added:
+ ----- Method: CompiledCode class>>useSista: (in category 'method encoding') -----
+ useSista: useSistaEncoder
+ 	"Switch to or from the Sista bytecode encoder, and recompile the system
+ 	using that encoder. Assumes that Compiler recompileAll is working for the
+ 	existing system. Assumes that the currently available primary and secondary
+ 	bytecode encoders are EncoderForV3PlusClosures and EncoderForSistaV1.
+ 	This is a convenience method that must be updated as the available encoders
+ 	are changed."
+ 
+ 	"CompiledCode useSista: true"
+ 	"CompiledCode useSista: false"
+ 
+ 	| standardEncoder sistaEncoder activeEncoder |
+ 	standardEncoder := Smalltalk classNamed: #EncoderForV3PlusClosures.
+ 	sistaEncoder := Smalltalk classNamed: #EncoderForSistaV1.
+ 	activeEncoder := self preferredBytecodeSetEncoderClass.
+ 	useSistaEncoder
+ 		ifTrue: [sistaEncoder ifNil: [self error: 'EncoderForSistaV1 not present in this image'].
+ 			self preferredBytecodeSetEncoderClass: sistaEncoder.
+ 			activeEncoder ~= sistaEncoder
+ 				ifTrue: [(Smalltalk classNamed: #Compiler) recompileAll.
+ 			self multipleBytecodeSetsActive: true "VM should support Sista plus V3" ]]
+ 		ifFalse: [standardEncoder ifNil: [self error: 'EncoderForV3PlusClosures not present in this image'].
+ 			self preferredBytecodeSetEncoderClass: standardEncoder.
+ 			activeEncoder ~= standardEncoder
+ 				ifTrue: [(Smalltalk classNamed: #Compiler) recompileAll.
+ 			self multipleBytecodeSetsActive: false "VM needs to support V3 only" ]].
+ 
+ !

Item was changed:
+ (PackageInfo named: 'Kernel') postscript: '"Activate Sista bytecodes in the image"
+ 
+ CompiledCode useSista: true.
+ '!
- (PackageInfo named: 'Kernel') postscript: '"below, add code to be run after the loading of this package"
- "Since Kernel-eem.1198 redefines LargePositiveInteger hash,
-  rehash all hashed collections that contain hashed large integers."
- HashedCollection allSubclassesDo:
- 	[:c| | f |
- 	f := (c includesBehavior: Set)
- 			ifTrue: [[:i| i]]
- 			ifFalse: [[:i| i keys]].
- 	c allInstancesDo:
- 		[:h|
- 		 ((f value: h) detect: [:e| e isInteger and: [e class ~~ SmallInteger]] ifNone: nil) ifNotNil:
- 			[h rehash]]]'!



More information about the Squeak-dev mailing list