VM Maker: VMMaker.oscog-eem.2414.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-eem.2414.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2414.mcz

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

Name: VMMaker.oscog-eem.2414
Author: eem
Time: 11 June 2018, 12:44:30.357346 pm
UUID: 6166323c-d4c3-4a45-b794-cccb2595acb7
Ancestors: VMMaker.oscog-cb.2413

Update some class comments.

=============== Diff against VMMaker.oscog-cb.2413 ===============

Item was changed:
  CogClass subclass: #SpurCompactor
+ instanceVariableNames: 'coInterpreter manager scavenger'
- instanceVariableNames: 'manager scavenger coInterpreter'
  classVariableNames: ''
  poolDictionaries: 'SpurMemoryManagementConstants VMBasicConstants VMSpurObjectRepresentationConstants'
  category: 'VMMaker-SpurMemoryManager'!
 
  !SpurCompactor commentStamp: 'cb 4/27/2018 09:38' prior: 0!
  Abstract common superclass of all compactors to define apis and simulation variables.
 
  The full GC in Spur is split in two, the marking phase and the compactor phase. The subclasses of SpurCompactor are implementations of the second phase, so they are called once the marking phase is finished. SpurCompactor is reponsible for:
  - freeing unmarked objects
  - compacting the live old space objects (though each subclass define what it does, some spurCompactor may not compact)
  - unmarking all objects remaining live
  - updating oops directly referred by the VM when they are moved (remapObj:/shouldRemapObj: thingy)
 
  The main apis are the following:
  - biasForGC/biasForSnapshot: tells the compactor if the GC is performed for snapshots or not, in general we want to compact more aggressively for snapshots to avoid saving large files with many unused space.
  - compact: main API, should free the unmarked object, unmark the objects remaining live and potentially compact the heap
  - remapObj:/shouldRemapObj: => Not really sure what this does, it seems it has to do with updating oops directly referred by the VM when they are moved.
  - postSwizzleAction: if you want to do something at start-up after swizzle phase (typically useful if your compaction algo uses segInfos)
 
  Instance Variables
  coInterpreter: <StackInterpreter>
  scavenger: <SpurGenerationScavenger>
  manager: <SpurMemoryManager>!

Item was changed:
  CogClass subclass: #SpurMemoryManager
(excessive size, no diff calculated)

Item was changed:
  SpurCompactor subclass: #SpurPlanningCompactor
+ instanceVariableNames: 'anomaly biasForGC firstFieldOfRememberedSet firstFreeObject firstMobileObject lastMobileObject mobileStart objectAfterLastMobileObject savedFirstFieldsSpace savedFirstFieldsSpaceNotInOldSpace'
- instanceVariableNames: 'biasForGC firstFreeObject mobileStart firstMobileObject lastMobileObject savedFirstFieldsSpace savedFirstFieldsSpaceNotInOldSpace firstFieldOfRememberedSet anomaly objectAfterLastMobileObject'
  classVariableNames: ''
  poolDictionaries: 'VMBytecodeConstants'
  category: 'VMMaker-SpurMemoryManager'!
 
+ !SpurPlanningCompactor commentStamp: 'eem 6/11/2018 12:43' prior: 0!
+ SpurPlanningCompactor implements the classic planning compaction algorithm for Spur.  It uses the fact that there is room for a forwarding pointer in all objects to store the eventual position of an object in the first field.  It therefore first locates a large free chunk, or eden or a memory segment, to use as the savedFirstFieldsSpace, which it uses to store the first fields of objects that will be compacted.  It then makes at least three passes through the heap.
- !SpurPlanningCompactor commentStamp: 'eem 12/23/2016 17:50' prior: 0!
- SpurPlanningCompactor implements the classic planning compaction algorithm for Spur.  It makes at least three passes through the heap.  The first pass plans where live movable objects will go, copying their forwarding field to the next slot in savedFirstFieldsSpace, and setting their forwarding pointer to point to their eventual location.  The second pass updates all pointers in live pointer objects to point to objects' final destinations.  The third pass moves objects to their final positions, unmarking objects as it does so.  If the forwarding fields of live objects in the to-be-moved portion of the entire heap won't fit in savedFirstFieldsSpace, then additional passes are made until the entire heap has been compacted.
 
+ The first pass plans where live movable objects will go, copying their first field to the next slot in savedFirstFieldsSpace, and setting their forwarding pointer to point to their eventual location (see planCompactSavingForwarders).  The second pass updates all pointers in live pointer objects to point to objects' final destinations, including the fields in savedFirstFieldsSpace (see updatePointers and updatePointersInMobileObjects).  The third pass moves objects to their final positions, unmarking objects, and restoring saved first fields as it does so (see copyAndUnmark: and copyAndUnmarkMobileObjects).  If the forwarding fields of live objects in the to-be-moved portion of the entire heap won't fit in savedFirstFieldsSpace, then additional passes can be made until the entire heap has been compacted.  When snapshotting multiple passes are made, but when doing a normal GC only one pass is made.
+
+ Each pass uses a three finger algorithm, a simple extension of the classic two finger algorithm with an extra finger used to identify the lowest pinned object between the to and from fingers.  Objects are moved down, starting at the first free object or chunk, provided that they fit below the lowest pinned object above the to finger.  When an object won't fit the to finger is moved above the pinned object and the third finger is reset to the next pinned object below the from finger, if any.
+
  Instance Variables
+ anomaly <Oop>
+ biasForGC <Boolean>
+ firstFieldOfRememberedSet <Oop>
+ firstFreeObject <Oop>
+ firstMobileObject <Oop>
+ lastMobileObject <Oop>
+ mobileStart <Integer address>
+ objectAfterLastMobileObject <Oop|nil>
- biasForGC <Boolean>
- coInterpreter: <StackInterpreter>
- firstFieldOfRememberedSet <Oop>
- firstFreeObject <Oop>
- firstMobileObject <Oop>
- lastMobileObject <Oop>
- manager: <SpurMemoryManager>
  savedFirstFieldsSpace <SpurContiguousObjStack>
  savedFirstFieldsSpaceWasAllocated <Boolean>
- scavenger: <SpurGenerationScavenger>
 
+ anomaly
+ - if any bogus object is detected by asserts, etc, it is stored in anomaly
+
  biasForGC
  - true if compacting for GC, in which case do only one pass, or false if compacting for snapshot, in which case do as many passes as necessary to compact the entire heap.
 
  firstFieldOfRememberedSet
  - the saved first field of the rememberedSet.  The rememberedSet must be relocated specially because it is not a pointer object.  And hence the first field needs to be extracted for proper relocation.
 
  firstFreeObject
  - the first free object in a compaction pass.
 
  firstMobileObject
  - the first mobile object in a compaction.  Unpinned objects from the firstMobileObject through to the lastMobileObject are implicitly forwarded.
 
  lastMobileObject
  - the last mobile object in a compaction.  Unpinned objects from the firstMobileObject through to the lastMobileObject are implicitly forwarded.
 
+ mobileStart
+ - the address of the first byte in firstFreeObject
+
+ objectAfterLastMobileObject
+ - the object following the last object that can be moved, used when more than one pass is needed.
+
  savedFirstFieldsSpace
  - the space holding the saved first fields, each overwritten by a forwarding pointer, for the objects from firstMobileObject through to lastMobileObject.
 
  savedFirstFieldsSpaceWasAllocated
  - if true, the memory for savedFirstFieldsSpace was obtained via a call of sqAllocateMemorySegmentOfSize:Above:AllocatedSizeInto:!