[Vm-dev] VM Maker: Cog-eem.267.mcz

commits at source.squeak.org commits at source.squeak.org
Tue May 12 22:17:36 UTC 2015


Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.267.mcz

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

Name: Cog-eem.267
Author: eem
Time: 12 May 2015, 3:17:21.516 pm
UUID: ff1bbadc-a019-45fb-954a-abfba8b25fdf
Ancestors: Cog-eem.266

SpurBootstrap:
Fix bug in patches:forSnapshot: that was causing
patches to accumulate and overwrite each other.

Make sure all patch comments patch from
trunkpackages to spurpackages.

More careful checking for package overwrite.

Add prototype to delete Character>>comeFullyUpOnReload:

=============== Diff against Cog-eem.266 ===============

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>patchAndUploadNewer (in category 'patching') -----
  patchAndUploadNewer
  	"Look for unbranched versions on the default repository that are newer than the
  	 image''s versions. Download and patch them and upload the patched versions."
  	"(SpurBootstrapMonticelloPackagePatcher new
+ 		from: 'trunkpackages'
+ 		to: 'spurpackages')
- 		from: 'spurpackages'
- 		to: 'trunkpackages')
  			patchAndUploadNewer"
  	| repo sourceRepo |
  	sourceDir deleteLocalFiles.
  	destDir deleteLocalFiles.
  	repo := self repositoryForUrl: MCMcmUpdater defaultUpdateURL.
  	sourceRepo := MCDirectoryRepository directory: sourceDir.
  	repo cacheAllFileNamesDuring:
  		[self packages do:
  			[:package| | workingCopy |
  			workingCopy := MCWorkingCopy allManagers detect: [:pkg| pkg packageName = package packageName].
  			(workingCopy possiblyNewerVersionsIn: repo) do:
  				[:newerVersion|
  				 newerVersion packageAndBranchName = package packageName ifTrue: "Don't patch already patched packages!!!!"
  					[(sourceRepo includesVersionNamed: newerVersion) ifFalse:
  						[sourceRepo storeVersion: (repo versionNamed: newerVersion)]]]].
  		 self patchAsNeeded.
  		 self uploadFrom: (MCDirectoryRepository directory: destDir) to: repo]!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>patchAndUploadUnpatchedInTrunk (in category 'patching') -----
  patchAndUploadUnpatchedInTrunk
  	"Look for unbranched versions in the default repository that are newer than the
  	 latest patched versions there-in. Download and patch them and upload the patched
  	 versions."
  	"(SpurBootstrapMonticelloPackagePatcher new
+ 		from: 'trunkpackages'
+ 		to: 'spurpackages')
- 		from: 'spurpackages'
- 		to: 'trunkpackages')
  			patchAndUploadUnpatchedInTrunk"
  	| trunk sourceRepo cacheRepo |
  	sourceDir assureExistence; deleteLocalFiles.
  	destDir assureExistence; deleteLocalFiles.
  	sourceRepo := MCDirectoryRepository directory: sourceDir.
  	cacheRepo := MCCacheRepository default.
  	(trunk := self trunk) cacheAllFileNamesDuring:
  		[| latestBranches latestUnbranched |
  		latestBranches := self packages collect:
  							[:package|
  							(trunk versionNamesForPackageNamed: package name, '.spur') detectMax: [:vn | vn asMCVersionName versionNumber]]
  							thenSelect: [:branch| branch notNil].
  		latestUnbranched := latestBranches collect: [:verName| (verName copyReplaceAll: '.spur' with: '') asMCVersionName].
  		((trunk possiblyNewerVersionsOfAnyOf: latestUnbranched)
  			reject: [:unpatched| unpatched includesSubString: '.spur'])
  			do: [:unpatched|
  				"it is claimed that whether a repository contains a .mcz or a .mcd is irrelevant.  At least for the cache repositoriy that's not true."
  				sourceRepo storeVersion: (self cachedNonDiffyVersionNamed: unpatched from: trunk)].
  		 self patchAsNeeded.
  		 self uploadFrom: (MCDirectoryRepository directory: destDir) to: trunk]!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>patchAsNeeded (in category 'patching') -----
  patchAsNeeded
  	(sourceDir exists and: [destDir exists]) ifFalse:
  		[self error: 'one or both of the directories don''t exist'].
  	self packagesAndPatches keysAndValuesDo:
  		[:package :patches|
  		 (self filesForPackage: package in: sourceDir) do:
+ 			[:packageFile| | spurPackageFile |
+ 			 spurPackageFile := self spurBranchNameForInfo: packageFile package: package.
+ 			 ((destDir includesKey: packageFile) or: [destDir includesKey: spurPackageFile])
+ 				ifTrue:
+ 					[Transcript
+ 						cr; nextPutAll: destDir fullName; nextPutAll: ' contains either ';
+ 						nextPutAll: packageFile; nextPutAll: ' or '; nextPutAll: spurPackageFile;
+ 						nextPutAll: '; not saving'; flush]
+ 				ifFalse:
+ 					[self patchPackage: packageFile with: patches for: package]]]
+ 
+ 	"| patcher |
+ 	 patcher := SpurBootstrapMonticelloPackagePatcher new
+ 					from: 'trunkpackages'
+ 					to: 'spurpackages'.
+ 	patcher trunk cacheAllFileNamesDuring:
+ 		[patcher patchAsNeeded]"!
- 			[:packageFile|
- 			 (destDir includesKey: packageFile) ifFalse:
- 				[self patchPackage: packageFile with: patches for: package]]]!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>patches:forSnapshot: (in category 'patching') -----
+ patches: basePatches forSnapshot: snapshot
- patches: patches forSnapshot: snapshot
  	"Add modified class defs for Character, SmallInteger, Float, BoxedFloat64, SmallFloat64 and COmpiledMethod.
  	 Remove ObjectHistory and ObjectHistoryMark (which Spur does not support)."
+ 	| patches defs |
+ 	patches  := basePatches copy.
- 	| defs |
  	defs := snapshot definitions.
  	(defs anySatisfy: [:d| d isClassDefinition and: [d className == #Character]]) ifTrue:
  		[patches
  			addAll: (self filteredDefinitionsAsPatches: (self modifiedCharacterDefinitionsIn: snapshot definitions)
  						patches: patches);
  			add: (self
  					classDefinitionFor: #Character
  					type: #immediate
  					from: snapshot definitions
  					comment: 'I represent a character by storing its associated Unicode as an unsigned 30-bit value.  Characters are created uniquely, so that all instances of a particular Unicode are identical.  My instances are encoded in tagged pointers in the VM, so called immediates, and therefore are pure immutable values.
  
  	The code point is based on Unicode.  Since Unicode is 21-bit wide character set, we have several bits available for other information.  As the Unicode Standard  states, a Unicode code point doesn''t carry the language information.  This is going to be a problem with the languages so called CJK (Chinese, Japanese, Korean.  Or often CJKV including Vietnamese).  Since the characters of those languages are unified and given the same code point, it is impossible to display a bare Unicode code point in an inspector or such tools.  To utilize the extra available bits, we use them for identifying the languages.  Since the old implementation uses the bits to identify the character encoding, the bits are sometimes called "encoding tag" or neutrally "leading char", but the bits rigidly denotes the concept of languages.
  
  	The other languages can have the language tag if you like.  This will help to break the large default font (font set) into separately loadable chunk of fonts.  However, it is open to the each native speakers and writers to decide how to define the character equality, since the same Unicode code point may have different language tag thus simple #= comparison may return false.'
  					stamp: 'eem 8/12/2014 14:53')].
  	(defs anySatisfy: [:def| def isClassDefinition and: [def className == #SmallInteger]]) ifTrue:
  		[patches
  			add: (self
  					classDefinitionFor: #SmallInteger
  					type: #immediate
  					from: snapshot definitions
  					comment: 'My instances are at least 31-bit numbers, stored in twos complement form. The allowable range in 32-bits is approximately +- 10^9 (+- 1billion).  In 64-bits my instances are 61-bit numbers, stored in twos complement form. The allowable range is approximately +- 10^18 (+- 1 quintillion).   The actual values are computed at start-up.  See SmallInteger class startUp:, minVal, maxVal.'
  					stamp: 'eem 11/20/2014 08:41')].
  	(defs anySatisfy: [:def| def isClassDefinition and: [def className == #Float]]) ifTrue:
  		[patches
  			add: (self
  					classDefinitionFor: #Float
  					type: #normal
  					from: snapshot definitions
  					comment: nil
  					stamp: nil);
  			add: (self
  					classDefinitionFor: #BoxedFloat64
  					type: #words
  					from: snapshot definitions
  					comment: 'My instances hold 64-bit Floats in heap objects.  This is the only representation on 32-bit systems.  But on 64-bit systems SmallFloat64 holds a subset of the full 64-bit double-precision range in immediate objects.'
  					stamp: 'eem 11/25/2014 07:54');
  			add: (self
  					classDefinitionFor: #SmallFloat64
  					type: #immediate
  					from: snapshot definitions
  					comment: 'My instances represent 64-bit Floats whose exponent fits in 8 bits as immediate objects.  This representation is only available on 64-bit systems, not 32-bit systems.'
  					stamp: 'eem 11/25/2014 07:54');
  			addAll: (self filteredDefinitionsAsPatches: (self modifiedFloatDefinitionsIn: snapshot definitions)
  						patches: patches)].
  	(defs anySatisfy: [:def| def isClassDefinition and: [def className == #CompiledMethod]]) ifTrue:
  		[patches
  			add: self compiledMethodClassDefinition].
  	(defs anySatisfy: [:def| def isClassDefinition and: [def className == #ObjectHistory]]) ifTrue:
  		[patches addAll:
  			(defs
  				select: [:def| #(ObjectHistory ObjectHistoryMark) includes: def className]
  				thenCollect: [:def| MCRemoval of: def])].
  	^MCPatch operations: patches!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>spurBranchNameForInfo:package: (in category 'patching') -----
+ spurBranchNameForInfo: versionInfoOrString package: package
+ 	^(versionInfoOrString isString
+ 		ifTrue: [versionInfoOrString]
+ 		ifFalse: [versionInfoOrString name]) copyReplaceAll: package name with: package name, '.spur'!
- spurBranchNameForInfo: versionInfo package: package
- 	^versionInfo name copyReplaceAll: package name with: package name, '.spur'!

Item was added:
+ ----- Method: SpurBootstrapPrototypes>>CharacterPROTOTYPEcomeFullyUpOnReload: (in category 'method prototypes') -----
+ CharacterPROTOTYPEcomeFullyUpOnReload: smartRefStream
+ 	"Now Characters are immediates, this can be deleted."
+ 	<remove>!



More information about the Vm-dev mailing list