[squeak-dev] The Trunk: Kernel-eem.1065.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 22 18:41:03 UTC 2017


Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1065.mcz

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

Name: Kernel-eem.1065
Author: eem
Time: 22 March 2017, 11:40:47.118625 am
UUID: f4ab499b-630a-4aa6-8d66-2a0c8132383d
Ancestors: Kernel-eem.1064

Add the script that morphs the class hierarchy to my liking in installing CompiledCode and CompiledBlock.

=============== Diff against Kernel-eem.1064 ===============

Item was added:
+ ----- Method: CompiledMethod class>>addCompiledCodeAndCompiledBlock (in category 'full block bootstrap') -----
+ addCompiledCodeAndCompiledBlock
+ 	| cmHash cmInstCount cc |
+ 	"Ensure that
+ 		- CompiledMethod is a subclass of CompiledCode
+ 		- CompiledMethod has a sibling called CompiledBlock,
+ 		- CompiledMethod's class vars are moved to CompiledCode
+ 		- CompiledMethod preserves its identityHash and instances"
+ 	self compiledCodeAndCompiledBlockArePresent ifTrue:
+ 		[^self].
+ 	cmHash := CompiledMethod identityHash.
+ 	cmInstCount := CompiledMethod instanceCount.
+ 	cc := CompiledMethod variableByteSubclass: #CompiledCode
+ 			instanceVariableNames: ''
+ 			classVariableNames: ''
+ 			poolDictionaries: ''
+ 			category: 'Kernel-Methods'.
+ 	self assert: cc == (ByteArray variableByteSubclass: #CompiledCode
+ 		instanceVariableNames: ''
+ 		classVariableNames: ''
+ 		poolDictionaries: ''
+ 		category: 'Kernel-Methods').
+ 	self assert: cc typeOfClass == #compiledMethod.
+ 	cc ensureClassPool.
+ 	CompiledMethod classPool keys do:
+ 		[:classVar|
+ 		cc classPool declare: classVar from: CompiledMethod classPool].
+ 	self assert: CompiledMethod classPool isEmpty.
+ 	CompiledMethod superclass: cc.
+ 	CompiledMethod class superclass: cc class.
+ 	cc addSubclass: CompiledMethod.
+ 	self assert: cmHash = CompiledMethod identityHash.
+ 	self assert: cmInstCount = CompiledMethod instanceCount.
+ 	self assert: (CompiledMethod inheritsFrom: cc).
+ 	self assert: (CompiledMethod class inheritsFrom: cc class).
+ 	cc variableByteSubclass: #CompiledBlock
+ 		instanceVariableNames: ''
+ 		classVariableNames: ''
+ 		poolDictionaries: ''
+ 		category: 'Kernel-Methods'.
+ 	self assert: self compiledCodeAndCompiledBlockArePresent!

Item was added:
+ ----- Method: CompiledMethod class>>compiledCodeAndCompiledBlockArePresent (in category 'full block bootstrap') -----
+ compiledCodeAndCompiledBlockArePresent
+ 	^((Smalltalk classNamed: #CompiledCode) notNil
+ 	   and: [((Smalltalk classNamed: #CompiledCode) subclasses collect: [:ea| ea name])
+ 						= #(CompiledMethod CompiledBlock)])!



More information about the Squeak-dev mailing list