[Vm-dev] VM Maker: VMMaker.oscog-eem.2164.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Mar 17 22:27:01 UTC 2017
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2164.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2164
Author: eem
Time: 17 March 2017, 3:25:47.069439 pm
UUID: 9515d45f-e395-4990-a90e-487ef4657bf1
Ancestors: VMMaker.oscog-eem.2163
Fix the determination of how much to free for the SistaMethodZone.
=============== Diff against VMMaker.oscog-eem.2163 ===============
Item was added:
+ ----- Method: CogMethodZone>>effectiveLimit (in category 'allocating') -----
+ effectiveLimit
+ <inline: true>
+ ^limitAddress!
Item was changed:
----- Method: CogMethodZone>>freeOlderMethodsForCompaction (in category 'compaction') -----
freeOlderMethodsForCompaction
"Free methods, preferring older methods for compaction, up to some fraction, currently a quarter."
| zoneSize amountToFree initialFreeSpace freedSoFar freeableUsage cogMethod |
<var: #cogMethod type: #'CogMethod *'>
+ zoneSize := self effectiveLimit - baseAddress.
+ initialFreeSpace := self effectiveLimit - mzFreeStart + methodBytesFreedSinceLastCompaction.
- zoneSize := limitAddress - baseAddress.
- initialFreeSpace := limitAddress - mzFreeStart + methodBytesFreedSinceLastCompaction.
freedSoFar := initialFreeSpace.
amountToFree := zoneSize // 4. "4 needs to be e.g. a start-up parameter"
freeableUsage := 0.
[self cCode: ''
inSmalltalk: [coInterpreter transcript nextPutAll: 'freeing methods with usage '; print: freeableUsage; cr; flush].
cogMethod := cogit cCoerceSimple: baseAddress to: #'CogMethod *'.
[cogMethod asUnsignedInteger < mzFreeStart
and: [freedSoFar < amountToFree]] whileTrue:
[(self shouldFreeMethod: cogMethod given: freeableUsage) ifTrue:
[self freeMethod: cogMethod.
freedSoFar := freedSoFar + cogMethod blockSize].
cogMethod := self methodAfter: cogMethod].
freedSoFar < amountToFree
and: [(freeableUsage := freeableUsage + 1) < CMMaxUsageCount]] whileTrue.
self cCode: ''
inSmalltalk: [coInterpreter transcript
nextPutAll: 'Compaction freeing '; print: freedSoFar;
nextPutAll: ' of '; print: zoneSize;
nextPutAll: ' (target: '; print: amountToFree;
nextPutAll: ' (newly freed: '; print: freedSoFar - initialFreeSpace;
cr; flush]!
Item was added:
+ ----- Method: SistaMethodZone>>effectiveLimit (in category 'allocating') -----
+ effectiveLimit
+ <inline: true>
+ ^super effectiveLimit min: allocationThreshold!
More information about the Vm-dev
mailing list