[Vm-dev] VM Maker: Cog-eem.120.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Nov 16 16:25:17 UTC 2013
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.120.mcz
==================== Summary ====================
Name: Cog-eem.120
Author: eem
Time: 16 November 2013, 8:24:50.422 am
UUID: 2830bc2a-d66c-486b-9f3e-783a1dc555b2
Ancestors: Cog-eem.119
Fix Spur bootstrap image validation and snapshot write now
endOfMemory includes last bridge.
Needs VMMaker.oscog-eem.512.
=============== Diff against Cog-eem.119 ===============
Item was changed:
----- Method: SpurBootstrap>>validate (in category 'bootstrap image') -----
validate
+ | p n duplicates maxClassIndex savedEndOfMemory |
- | p n duplicates maxClassIndex |
self assert: (reverseMap at: newHeap specialObjectsOop) = oldHeap specialObjectsOop.
self assert: (map at: oldHeap specialObjectsOop) = newHeap specialObjectsOop.
self assert: (reverseMap at: newHeap classTableRootObj ifAbsent: []) isNil.
duplicates := { 3. newHeap arrayClassIndexPun. newHeap weakArrayClassIndexPun }.
maxClassIndex := classToIndex inject: 0 into: [:a :b| a max: b].
self assert: ((newHeap arrayClassIndexPun to: maxClassIndex) select:
[:idx| | classObj |
(classObj := newHeap classAtIndex: idx) ~= newHeap nilObject
and: [(newHeap classIndexOf: classObj) = (newHeap rawHashBitsOf: classObj)]]) isEmpty.
0 to: maxClassIndex do:
[:index| | classObj |
(index <= newHeap tagMask
and: [index > newHeap isForwardedObjectClassIndexPun]) ifTrue:
[(classObj := newHeap classAtIndex: index) = newHeap nilObject
ifTrue:
[self assert: (classToIndex keyAtValue: index ifAbsent: []) isNil]
ifFalse:
[self assert: (newHeap classIndexOf: classObj) ~= (newHeap rawHashBitsOf: classObj).
(duplicates includes: index) ifFalse:
[self assert: (newHeap rawHashBitsOf: classObj) = index]]]].
classToIndex keysAndValuesDo:
[:oldClass :idx|
self assert: (newHeap rawHashBitsOf: (map at: oldClass)) = idx.
self assert: oldClass = (reverseMap at: (newHeap classAtIndex: idx))].
n := 0.
+ savedEndOfMemory := newHeap endOfMemory.
+ newHeap setEndOfMemory: newHeap freeOldSpaceStart.
newHeap allObjectsDo:
[:o|
(o <= newHeap trueObject
or: [o > lastClassTablePage]) ifTrue:
[self assert: (reverseMap includesKey: o).
self assert: (newHeap fetchClassOfNonImm: o) = (map at: (oldHeap fetchClassOfNonImm: (reverseMap at: o)))].
n := n + 1.
p := o].
+ newHeap setEndOfMemory: savedEndOfMemory.
+ self touch: p.
- p class.
self assert: (n between: map size and: map size + 6). "+ 6 is room for freelists & classTable"
"check some class properties to ensure the format changes are correct"
self assert: (newHeap fixedFieldsOfClassFormat: (newHeap formatOfClass: newHeap classArray)) = 0.
self assert: (newHeap instSpecOfClassFormat: (newHeap formatOfClass: newHeap classArray)) = newHeap arrayFormat!
Item was changed:
----- Method: SpurBootstrap>>writeSnapshotOfTransformedImage (in category 'testing') -----
writeSnapshotOfTransformedImage
"The bootstrapped image typically contains a few big free chunks and one huge free chunk.
Test snapshot writing and loading by turning the largest non-huge chunks into segment bridges
and saving."
+ | penultimate ultimate heap sizes counts barriers sim |
- | last heap sizes counts barriers sim |
heap := TransformedImage veryDeepCopy.
sim := StackInterpreterSimulator onObjectMemory: heap.
sim bootstrapping: true.
heap coInterpreter: sim.
sim initializeInterpreter: 0;
setImageHeaderFlagsFrom: ImageHeaderFlags;
setDisplayForm: (Form extent: ImageScreenSize >> 16 @ (ImageScreenSize bitAnd: 16rFFFF)).
+ heap allOldSpaceEntitiesDo: [:e| penultimate := ultimate. ultimate := e].
+ self assert: (heap isFreeObject: penultimate).
+ self assert: (heap isSegmentBridge: ultimate).
- heap allOldSpaceEntitiesDo: [:e| last := e].
- self assert: (heap isFreeObject: last).
sizes := Bag new.
heap allObjectsInFreeTree: (heap freeLists at: 0) do:
[:f|
sizes add: (heap bytesInObject: f)].
counts := sizes sortedCounts.
self assert: counts last key = 1. "1 huge chunk"
self assert: ((counts at: counts size - 1) key > 2
and: [(counts at: counts size - 1) value > 1024]).
barriers := (1 to: (counts at: counts size - 1) key) collect:
[:ign| heap allocateOldSpaceChunkOfExactlyBytes: (counts at: counts size - 1) value].
+ barriers := barriers, {heap allocateOldSpaceChunkOfExactlyBytes: (heap bytesInObject: penultimate)}.
- barriers := barriers, {heap allocateOldSpaceChunkOfExactlyBytes: (heap bytesInObject: last)}.
heap setEndOfMemory: barriers last.
+ heap allOldSpaceEntitiesDo: [:e| penultimate := ultimate. ultimate := e].
+ self assert: (heap addressAfter: ultimate) = barriers last.
- heap allOldSpaceEntitiesDo: [:e| last := e].
- self assert: (heap addressAfter: last) = barriers last.
heap checkFreeSpace.
heap runLeakCheckerForFullGC: true.
heap segmentManager initializeFromFreeChunks: (barriers sort collect: [:b| heap objectStartingAt: b]).
heap checkFreeSpace.
heap runLeakCheckerForFullGC: true.
sim bereaveAndNormalizeContextsAndFlushExternalPrimitives.
sim imageName: 'spur.image'.
sim writeImageFileIO!
More information about the Vm-dev
mailing list