[Vm-dev] VM Maker: Cog-eem.68.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 3 22:07:42 UTC 2013
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.68.mcz
==================== Summary ====================
Name: Cog-eem.68
Author: eem
Time: 3 September 2013, 3:07:33.011 pm
UUID: dbc8c75b-6e15-48ce-b17d-e37d1b1a8a96
Ancestors: Cog-eem.67
Fix class indices for LargePosi/NegativeInteger.
Fix shift in fillInPointerObject:from:.
=============== Diff against Cog-eem.67 ===============
Item was changed:
----- Method: SpurBootstrap>>defineKnownClassIndices (in category 'class indices') -----
defineKnownClassIndices
"The classTable is laid out
- to make it easy to map immediates to classes; the tag pattern of an immediate is its class index.
hence there are two entries for SmallInteger
- to assign small indices to well-known classes such as Array, Message et al
- to leave plenty of room for new known classes; hence the first page contains only well-known classes
- to enable overlaps and avoid conflicts with indices in the specialObjectsArray (?really? eem)
- to provide a WeakArray pun for the pages of the table itself so that these do not show up as instances of WeakArray"
| classMethodContext classBlockClosure classMessage "no api method for these" |
classMessage := oldHeap splObj: (VMObjectIndices bindingOf: #ClassMessage) value.
classMethodContext := oldHeap splObj: (VMObjectIndices bindingOf: #ClassMethodContext) value.
classBlockClosure := oldHeap splObj: (VMObjectIndices bindingOf: #ClassBlockClosure) value.
"c.f. CogMemoryManager class>>intializeCompactClassIndices"
classToIndex
at: oldHeap classSmallInteger put: 1; "N.B. must fill-in index 3 manually"
at: oldHeap classCharacter put: 2;
"at: oldHeap classSmallInteger put: 3" "N.B. must fill-in index 3 manually"
"leave room for up to 15 tagged classes"
"leave room for up to 16 puns"
+ at: oldHeap classLargeNegativeInteger put: 32;
+ at: oldHeap classLargePositiveInteger put: 33;
- at: oldHeap classLargePositiveInteger put: 32;
- at: oldHeap classLargeNegativeInteger put: 33;
at: oldHeap classFloat put: 34;
at: "oldHeap" classMessage put: 35;
at: "oldHeap" classMethodContext put: 36;
at: "oldHeap" classBlockClosure put: 37;
at: oldHeap classSemaphore put: 48;
at: oldHeap classMutex put: 49;
at: oldHeap classByteArray put: 50;
at: oldHeap classArray put: 51;
at: oldHeap classString put: 52;
at: oldHeap classBitmap put: 53;
at: oldHeap classPoint put: 54;
at: oldHeap classExternalAddress put: 128;
at: oldHeap classExternalData put: 129;
at: oldHeap classExternalFunction put: 130;
at: oldHeap classExternalLibrary put: 131;
at: oldHeap classExternalStructure put: 132;
at: oldHeap classAlien put: 133;
at: oldHeap classUnsafeAlien put: 133!
Item was changed:
----- Method: SpurBootstrap>>fillInPointerObject:from: (in category 'bootstrap') -----
fillInPointerObject: newObj from: oldObj
+ 0 to: (oldHeap lastPointerOf: oldObj) / oldHeap bytesPerWord - 1 do:
- 0 to: (oldHeap lastPointerOf: oldObj) >> 4 - 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
+ ifTrue: [newHeap nilObject]
+ ifFalse:
+ [self assert: (oldHeap fetchClassOfNonInt: oldValue) = oldHeap classCharacter.
+ newHeap characterObjectOf:
+ (oldHeap integerValueOf:
+ (oldHeap fetchPointer: CharacterValueIndex ofObject: oldValue))]]].
- [self assert: (oldHeap fetchClassOfNonInt: oldValue) = oldHeap classCharacter.
- newHeap characterObjectOf:
- (oldHeap integerValueOf:
- (oldHeap fetchPointer: CharacterValueIndex ofObject: oldValue))]].
newHeap
storePointerUnchecked: i
ofObject: newObj
withValue: newValue]!
More information about the Vm-dev
mailing list