ClementBera uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2375.mcz ==================== Summary ==================== Name: VMMaker.oscog-cb.2375 Author: cb Time: 26 April 2018, 1:30:32.640264 pm UUID: 41eb0797-6cdb-4654-aa71-263c8dd85f53 Ancestors: VMMaker.oscog-cb.2374 Made C compiler happy (addressOf:, macro & shadowing non-sense).. =============== Diff against VMMaker.oscog-cb.2374 =============== Item was changed: ----- Method: SpurSegmentManager>>segments (in category 'accessing') ----- segments + <cmacro: '() GIV(segments)'> ^segments! Item was changed: ----- Method: SpurSelectiveCompactor>>compactSegment:freeStart: (in category 'compaction') ----- compactSegment: segInfo freeStart: initialFreeStart <var: 'segInfo' type: #'SpurSegmentInfo *'> + | currentEntity fillStart bytesToCopy numSlots bridge | - | currentEntity fillStart bytesInObject numSlots bridge | fillStart := initialFreeStart. bridge := manager segmentManager bridgeFor: segInfo. currentEntity := manager objectStartingAt: segInfo segStart. [self oop: currentEntity isLessThan: bridge] whileTrue: [(manager isFreeObject: currentEntity) ifTrue: ["To avoid confusing too much Spur (especially the leak/free checks), we mark the free chunk as a word object." manager detachFreeObject: currentEntity. manager set: currentEntity classIndexTo: manager wordSizeClassIndexPun formatTo: manager wordIndexableFormat] ifFalse: ["Copy the object in segmentToFill and replace it by a forwarder." self assert: (manager isPinned: currentEntity) not. numSlots := manager numSlotsOfAny: currentEntity. + bytesToCopy := manager bytesInObject: currentEntity. - bytesInObject := manager bytesInObject: currentEntity. self assert: (manager objectBytesForSlots: numSlots) = (manager bytesInObject: currentEntity). + manager mem: fillStart asVoidPointer cp: (manager startOfObject: currentEntity) asVoidPointer y: bytesToCopy. - manager mem: fillStart asVoidPointer cp: (manager startOfObject: currentEntity) asVoidPointer y: bytesInObject. self assert: (manager baseHeader: (manager objectStartingAt: fillStart)) = (manager baseHeader: currentEntity). self assert: (manager fetchPointer: numSlots - 1 ofObject: (manager objectStartingAt: fillStart)) = (manager fetchPointer: numSlots - 1 ofObject: currentEntity). manager forward: currentEntity to: (manager objectStartingAt: fillStart). fillStart := fillStart + (manager objectBytesForSlots: numSlots). self assert: (manager isForwarded: currentEntity). self assert: fillStart < (segmentToFill segLimit - manager bridgeSize)]. currentEntity := manager objectAfter: currentEntity limit: manager endOfMemory]. self assert: currentEntity = bridge. ^ fillStart! Item was changed: ----- Method: SpurSelectiveCompactor>>internalGlobalSweepAndSegmentOccupationAnalysis (in category 'sweep phase') ----- internalGlobalSweepAndSegmentOccupationAnalysis "Iterate over old space, free unmarked objects, annotate each segment with each occupation" | currentEntity nextBridge start segmentIndex currentUsed currentUnused | currentEntity := manager firstObject. nextBridge := manager segmentManager bridgeAt: 0. segmentIndex := currentUnused := currentUsed := 0. [self oop: currentEntity isLessThan: manager endOfMemory] whileTrue: [currentEntity = nextBridge ifTrue: ["End of segment, set occupation" self + setOccupationAtIndex: segmentIndex - setOccupation: (manager segmentManager segments at: segmentIndex) used: currentUsed unused: currentUnused. currentUnused := currentUsed := 0. segmentIndex := segmentIndex + 1. self unmark: currentEntity. nextBridge := manager segmentManager bridgeAt: segmentIndex] ifFalse: ["In-segment, sweep and compute occupation" (self canUseAsFreeSpace: currentEntity) ifTrue: ["bulkFreeChunkFrom: may change a 1 word header object to a double word header object" start := manager startOfObject: currentEntity. self bulkFreeChunkFrom: currentEntity. currentEntity := manager objectStartingAt: start. currentUnused := currentUnused + (manager numSlotsOfAny: currentEntity)] ifFalse: [self unmark: currentEntity. currentUsed := currentUsed + (manager numSlotsOfAny: currentEntity)]]. currentEntity := manager objectAfter: currentEntity limit: manager endOfMemory]. "set last segment (last bridge = endOfMemory)" self + setOccupationAtIndex: segmentIndex - setOccupation: (manager segmentManager segments at: segmentIndex) used: currentUsed unused: currentUnused.! Item was added: + ----- Method: SpurSelectiveCompactor>>setOccupationAtIndex:used:unused: (in category 'segment access') ----- + setOccupationAtIndex: segmentIndex used: used unused: unused + "Swizzle is abused bit 8 isClaimed bits 0-7 occupation + Setting occupation resets the claim bit" + | occupation segInfo | + segInfo := self addressOf: (manager segmentManager segments at: segmentIndex). + occupation := used * 255 // (used + unused). + segInfo swizzle: occupation! |
Free forum by Nabble | Edit this page |