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

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

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

Name: VMMaker.oscog-eem.2815
Author: eem
Time: 24 September 2020, 2:52:43.72068 pm
UUID: abed0d85-3454-4d93-97a1-37cce8acc9be
Ancestors: VMMaker.oscog-eem.2814

Spur: Bridging new and old space.

Little point inlining enableObjectEnumerationFrom:.  This saves 42 copies of the code.
No need to have a conditional check when establisging the pastSpace->eden bridge in allNewSpaceEntitiesDo:.
Better comment initSegmentBridgeWithBytes:at:
The assert in isEnumerableObject: needs tweaking.

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

Item was changed:
  ----- Method: Spur32BitMemoryManager>>initSegmentBridgeWithBytes:at: (in category 'segments') -----
  initSegmentBridgeWithBytes: numBytes at: address
  <var: #numBytes type: #usqLong>
  | numSlots |
+ "Must have room for a double header or a short object with the forwarding slot (16 bytes either way)."
- "must have room for a double header"
  self assert: (numBytes \\ self allocationUnit = 0
  and: [numBytes >= (self baseHeaderSize + self baseHeaderSize)]).
  numSlots := numBytes - self baseHeaderSize - self baseHeaderSize >> self shiftForWord.
  self flag: #endianness.
  numSlots = 0
  ifTrue: "short bridge for adjacent segments"
  [self longAt: address put: (1 << self pinnedBitShift)
  + (self wordIndexableFormat << self formatShift)
  + self segmentBridgePun;
  longAt: address + 4 put: (1 << self markedBitHalfShift)]
  ifFalse: "long bridge"
  [self longAt: address put: numSlots;
  longAt: address + 4 put: self numSlotsMask << self numSlotsHalfShift;
  longAt: address + 8 put: (1 << self pinnedBitShift)
  + (self wordIndexableFormat << self formatShift)
  + self segmentBridgePun;
  longAt: address + 12 put: self numSlotsMask << self numSlotsHalfShift
  + (1 << self markedBitHalfShift)]!

Item was changed:
  ----- Method: Spur64BitMemoryManager>>initSegmentBridgeWithBytes:at: (in category 'segments') -----
  initSegmentBridgeWithBytes: numBytes at: address
  <var: #numBytes type: #usqLong>
  | numSlots |
+ "Must have room for a double header or a short object with the forwarding slot (16 bytes either way)."
- "must have room for a double header"
  self assert: (numBytes \\ self allocationUnit = 0
  and: [numBytes >= (self baseHeaderSize + self baseHeaderSize)]).
  numSlots := numBytes - self baseHeaderSize - self baseHeaderSize >> self shiftForWord.
  numSlots = 0
  ifTrue: "short bridge for adjacent segments"
  [self longAt: address
  put:    (1 << self pinnedBitShift)
  + (1 << self markedBitFullShift)
  + (self wordIndexableFormat << self formatShift)
  + self segmentBridgePun]
  ifFalse: "long bridge"
  [self longAt: address
  put: self numSlotsMask << self numSlotsFullShift + numSlots;
  longAt: address + self baseHeaderSize
  put: (self numSlotsMask << self numSlotsFullShift)
  + (1 << self pinnedBitShift)
  + (1 << self markedBitFullShift)
  + (self wordIndexableFormat << self formatShift)
  + self segmentBridgePun]!

Item was changed:
  ----- Method: SpurMemoryManager>>allNewSpaceEntitiesDo: (in category 'object enumeration-private') -----
  allNewSpaceEntitiesDo: aBlock
  "Enumerate all new space objects, including free objects."
  <inline: true>
  | prevObj prevPrevObj objOop |
  prevPrevObj := prevObj := nil.
  "After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden."
  self assert: (scavenger pastSpace start < scavenger eden start).
+ self initSegmentBridgeWithBytes: scavenger eden start - pastSpaceStart at: pastSpaceStart.
  objOop := self objectStartingAt: scavenger pastSpace start.
- self enableNewSpaceObjectEnumerationFrom: objOop.
  [self oop: objOop isLessThan: freeStart] whileTrue:
  [aBlock value: objOop.
  prevPrevObj := prevObj.
  prevObj := objOop.
  objOop := self objectAfter: objOop limit: freeStart].
  self touch: prevPrevObj.
  self touch: prevObj!

Item was changed:
  ----- Method: SpurMemoryManager>>enableObjectEnumerationFrom: (in category 'object enumeration-private') -----
  enableObjectEnumerationFrom: initialObject
  "We use bridges to stitch segments together to make it appear that the heap is one contiguous space.
  Bridges at the end of oldSpace segments are maintained.  Bridges at the end of pastSpace and eden
  are temporary, and are established here, depending on the current sizes of pastSpace end eden."
+ <inline: false>
- <inline: #always>
  (self oop: initialObject isLessThan: oldSpaceStart) ifTrue:
  [self initSegmentBridgeWithBytes: oldSpaceStart - freeStart at: freeStart.
  self enableNewSpaceObjectEnumerationFrom: initialObject]!

Item was changed:
  ----- Method: SpurMemoryManager>>initSegmentBridgeWithBytes:at: (in category 'segments') -----
  initSegmentBridgeWithBytes: numBytes at: address
  <var: #numBytes type: #usqLong>
+ "Must have room for a double header or a short object with the forwarding slot (16 bytes either way)."
+ self assert: (numBytes \\ self allocationUnit = 0
+ and: [numBytes >= (self baseHeaderSize + self baseHeaderSize)]).
+
  ^self subclassResponsibility!

Item was changed:
  ----- Method: SpurMemoryManager>>isEnumerableObject: (in category 'object enumeration') -----
  isEnumerableObject: objOop
  "Answer if objOop should be included in an allObjects...Do: enumeration.
  Non-objects should be excluded; these are bridges and free chunks."
  | classIndex |
  <inline: true>
  classIndex := self classIndexOf: objOop.
+ self assert: (classIndex = self segmentBridgePun
+ or: [classIndex = self isForwardedObjectClassIndexPun
+ or: [(self long64At: objOop) ~= 0
+ and: [classIndex < (numClassTablePages * self classTablePageSize)]]]).
- self assert: ((self long64At: objOop) ~= 0
-  and: [classIndex < (numClassTablePages * self classTablePageSize)]).
  ^classIndex >= self isForwardedObjectClassIndexPun!