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

commits at source.squeak.org commits at source.squeak.org
Tue Feb 11 01:05:19 UTC 2014


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

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

Name: Cog-eem.135
Author: eem
Time: 10 February 2014, 5:05:02.459 pm
UUID: 0b3fc2ea-1649-4372-a0a8-4d23ebc8a2d7
Ancestors: Cog-eem.134

Remember to remove Character's value inst var from the class in
both the bootstrapped image and the patched Collections package.

=============== Diff against Cog-eem.134 ===============

Item was changed:
  ----- Method: SpurBootstrap>>fillInPointerObject:from: (in category 'bootstrap image') -----
  fillInPointerObject: newObj from: oldObj
  	"Fill-in a newObj with appropriately mapped contents from oldObj.
  	 Filter-out the character table and the compact classes array.
  	 Map character objects to immediate characters."
  	0 to: (oldHeap lastPointerOf: oldObj) / oldHeap wordSize - 1 do:
  		[:i| | oldValue newValue |
  		oldValue := oldHeap fetchPointer: i ofObject: oldObj.
  		newValue := (oldHeap isIntegerObject: oldValue)
  						ifTrue: [oldValue]
  						ifFalse:
  							[map at: oldValue ifAbsent:
  								[(oldValue = oldHeap characterTable
  								  or: [oldValue = (oldHeap splObj: CompactClasses)])
  									ifTrue: [newHeap nilObject]
  									ifFalse:
  										[self assert: (oldHeap fetchClassOfNonImm: oldValue) = oldHeap classCharacter.
  										 newHeap characterObjectOf:
  											(oldHeap integerValueOf:
  												(oldHeap fetchPointer: CharacterValueIndex ofObject: oldValue))]]].
  		newHeap
  			storePointerUnchecked: i
  			ofObject: newObj
  			withValue: newValue].
  	(self isOldObjABehavior: oldObj) ifTrue:
+ 		[self mapOldBehavior: oldObj toNewBehavior: newObj]!
- 		[newHeap
- 			storePointerUnchecked: InstanceSpecificationIndex
- 			ofObject: newObj
- 			withValue: (self newClassFormatFor: oldObj)]!

Item was added:
+ ----- Method: SpurBootstrap>>mapOldBehavior:toNewBehavior: (in category 'bootstrap image') -----
+ mapOldBehavior: oldObj toNewBehavior: newObj
+ 	"Map the old format inst var's value to the new value.
+ 	 In addition, for Character, make it immediate and remove its instance variable."
+ 	newHeap
+ 		storePointerUnchecked: InstanceSpecificationIndex
+ 		ofObject: newObj
+ 		withValue: (self newClassFormatFor: oldObj).
+ 	oldObj = oldHeap classCharacter ifTrue:
+ 		[InstanceSpecificationIndex + 1 to: (oldHeap numSlotsOf: oldObj) do:
+ 			[:i| | var field |
+ 			var := oldHeap fetchPointer: i ofObject: oldObj.
+ 			((oldHeap fetchClassOf: var) = oldHeap classArray
+ 			 and: [(oldHeap numSlotsOf: var) = 1
+ 			 and: [field := oldHeap fetchPointer: 0 ofObject: var.
+ 				(oldHeap fetchClassOf: field) = oldHeap classString
+ 			 and: [(oldHeap lengthOf: field) = 5
+ 			 and: [(oldHeap str: (oldHeap firstIndexableField: field) n: 'value' cmp: 5) = 0]]]]) ifTrue:
+ 				[newHeap
+ 					storePointerUnchecked: i
+ 					ofObject: newObj
+ 					withValue: newHeap nilObject.
+ 				 ^self]]]!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>modifiedCharacterDefinitionsIn: (in category 'private-accessing') -----
  modifiedCharacterDefinitionsIn: definitions
  	| rewriter |
  	rewriter := RBParseTreeRewriter new.
  	rewriter
  		replace: 'value' with: 'self asInteger';
  		replace: 'value := ``@args' with: 'DELETEME'.
+ 	^(((definitions select: [:d| d isMethodDefinition and: [d fullClassName = #Character]])
- 	^((definitions select: [:d| d isMethodDefinition and: [d fullClassName = #Character]])
  		collect: [:d| { d. self patchDefinition: d withRewriter: rewriter} ]
  		thenSelect: [:pair| pair first source ~= pair second source])
+ 			collect: [:pair| pair second]),
+ 	 (definitions
+ 		select: [:d| d isClassDefinition and: [d className = #Character]]
+ 		thenCollect:
+ 			[:d|
+ 			 d variables removeAllSuchThat:
+ 				[:varDef|
+ 				 varDef isInstanceVariable and: [varDef name = 'value']].
+ 			 d])!
- 			collect: [:pair| pair second]!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>patchForPackage:withPatches:snapshot: (in category 'patching') -----
  patchForPackage: package withPatches: patches snapshot: snapshot
  	(package includesClass: Character) ifTrue:
  		[patches addAll: ((self modifiedCharacterDefinitionsIn: snapshot definitions) 
  							select:
  								[:def|
  								 patches noneSatisfy:
  									[:addition|
+ 									def isMethodDefinition
+ 									and: [addition definition selector = def selector
- 									addition definition selector = def selector
  									and: [addition definition className = def className
+ 									and: [addition definition classIsMeta = def classIsMeta]]]]]
- 									and: [addition definition classIsMeta = def classIsMeta]]]]
  							thenCollect:
  								[:def|
  								 ((def source includesSubString: 'DELETEME')
  									ifTrue: [MCRemoval]
  									ifFalse: [MCAddition]) of: def])].
  	^MCPatch operations: patches!



More information about the Vm-dev mailing list