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

commits at source.squeak.org commits at source.squeak.org
Tue Dec 1 06:08:42 UTC 2009

Andreas Raab uploaded a new version of Kernel to project The Trunk:

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

Name: Kernel-ar.315
Author: ar
Time: 30 November 2009, 10:08:08 am
UUID: b39007e6-1381-184d-a2c8-58052fd71231
Ancestors: Kernel-ul.314

Future proofing: For speed and simplicity, Cog requires LargeNegativeInteger to be compact at 4 (replacing PseudoContext). Integer>>initialize now takes care of that and documents (via LPITest and LNITest) the compact class requirements of LPI and LNI.

There  is no actual impact except that LNIs will shave off a header word which in typical images makes no difference whatsover (LargeNegativeInteger instanceCount < 100 in a typical trunk image).

=============== Diff against Kernel-ul.314 ===============

Item was added:
+ ----- Method: Integer class>>initialize (in category 'class initialization') -----
+ initialize	"Integer initialize"
+ 	"Ensure we have the right compact class index"
+ 	"LPI has been a compact class forever - just ensure basic correctness"
+ 	(LargePositiveInteger indexIfCompact = 5) ifFalse:[
+ 		(Smalltalk compactClassesArray at: 5)
+ 			ifNil:[LargePositiveInteger becomeCompactSimplyAt: 5]
+ 			ifNotNil:[self error: 'Unexpected compact class setup']].
+ 	"Cog requires LNI to be compact at 4 (replacing PseudoContext)"
+ 	(LargeNegativeInteger indexIfCompact = 4) ifFalse:[
+ 		"PseudoContext will likely get removed at some point so write this test
+ 		without introducing a hard dependency"
+ 		(Smalltalk compactClassesArray at: 4) name == #PseudoContext
+ 			ifTrue:[Smalltalk compactClassesArray at: 4 put: nil].
+ 		(Smalltalk compactClassesArray at: 4)
+ 			ifNil:[LargeNegativeInteger becomeCompactSimplyAt: 4]
+ 			ifNotNil:[self error: 'Unexpected compact class setup']].
+ !

More information about the Squeak-dev mailing list