The Trunk: Kernel-dtl.1310.mcz

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

The Trunk: Kernel-dtl.1310.mcz

commits-2
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.1310.mcz

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

Name: Kernel-dtl.1310
Author: dtl
Time: 6 March 2020, 7:29:11.316779 pm
UUID: 683e4e14-fc18-4d55-a776-eece91f579f5
Ancestors: Kernel-mt.1309

Change the Squeak default bytecode set to Sista in trunk.

Add CompiledCode>>multipleBytecodeSetsActive: to optionally inform the VM that Sista is in use, see VMMaker.oscog-dtl.2711 and http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html.

Add CompiledCode>>useSista: convenience method for switching to and from Sista bytecodes.

Package postscript activates the change to Sista bytecodes, which can be reversed by evaluating CompiledCode useSista: false.

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

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]]]'!