VM Maker: VMMaker.oscog-cb.2595.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-cb.2595.mcz

commits-2
 
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2595.mcz

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

Name: VMMaker.oscog-cb.2595
Author: cb
Time: 28 November 2019, 8:54:30.534147 pm
UUID: 5bd3af22-bdf4-425c-b63c-6eb29fbfc606
Ancestors: VMMaker.oscog-eem.2594

Fixed a fascinating bug in Planning compactor.

Sometimes Planning decides to go for a multi-pass compaction, but in one compaction it compacts it all, so that firstFreeObject is the last object on heap, on the object after firstFreeObject is outside of the heap. Planning gets confused in this case, while everything is compacted. So I changed to abort compaction in that case, since everything is already compacted.

=============== Diff against VMMaker.oscog-eem.2594 ===============

Item was changed:
  ----- Method: SpurPlanningCompactor>>compact (in category 'compaction - api') -----
  compact
  "Sweep all of old space, sliding unpinned marked objects down over free and unmarked objects.
  Let the segmentManager mark which segments contain pinned objects via notePinned:."
  | finalPass firstPass |
  <inline: #never> "for profiling"
  self initializeScanCheckingForFullyCompactedHeap ifTrue:
  [^self unmarkObjectsInFullyCompactedHeap].
  self initializeCompaction.
  firstPass := true.
  [finalPass := self planCompactSavingForwarders.
  self assert: (self validRelocationPlanInPass: finalPass) = 0.
  self updatePointers.
  self copyAndUnmark: firstPass.
  "Would like to check here, but can't if multi-pass."
  false ifTrue: [manager checkFreeSpace: GCModeFull].
  "Currently we do only a single pass if a normal GC, assuming that a pass will
   always compact plenty of space. But we should perhaps check this assumption
   by looking at the large free tree and seeing that the ratio of the largest free
   chunk to the total ammount of free space is high."
  finalPass or: [biasForGC]] whileFalse:
  [firstPass := false.
+ self reinitializeScanFrom: firstFreeObject.
+ firstMobileObject > firstFreeObject ifFalse:
+ ["We get here when firstFreeObject is the last object in memory.
+   firstMobileObject may be random value from previous compaction
+   in this case, and heap is fully compacted. Abort compaction."
+   "We set firstFreeObject to firstMobileObject for unmarking."
+ firstFreeObject := firstMobileObject.
+ self unmarkObjectsFromFirstFreeObject.
+   manager checkFreeSpace: GCModeFull.
+ ^self endCompaction].
+ self updateSavedFirstFieldsSpaceIfNecessary].
- self reinitializeScanFrom: firstFreeObject;
- updateSavedFirstFieldsSpaceIfNecessary].
  manager checkFreeSpace: GCModeFull.
  self endCompaction!