VM Maker: Cog-eem.397.mcz

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

VM Maker: Cog-eem.397.mcz

Eliot Miranda uploaded a new version of Cog to project VM Maker:

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

Name: Cog-eem.397
Author: eem
Time: 9 February 2020, 5:38:36.722575 pm
UUID: b1ce51e7-354e-4614-b5ab-0f910c320450
Ancestors: Cog-eem.396

Finish the mechanics of the 64-to-32-bit converter.  The resulting image doesn't yet run.  So more work to do.

=============== Diff against Cog-eem.396 ===============

Item was added:
+ ----- Method: Spur32to64BitImageConverter>>sixtyFourBitHeap (in category 'private-accessing') -----
+ sixtyFourBitHeap
+ ^targetHeap!

Item was changed:
  ----- Method: Spur64to32BitImageConverter>>ensureSmallFloatInClassTable (in category 'bootstrap image') -----
  "it should already be there..."
+ self assert: (targetHeap hashBitsOf: self smallFloatClass) = self sixtyFourBitHeap smallFloatTag!
- self assert: (targetHeap hashBitsOf: self smallFloatClass) = targetHeap smallFloatTag!

Item was changed:
  ----- Method: Spur64to32BitImageConverter>>mapSourceOop: (in category 'bootstrap image') -----
  mapSourceOop: sourceObj
  "sourceInterpreter printOop: sourceObj"
  "Map in-range Floats to SmallFloat64's, and in-range LargePointiveIntegers and LargeNegativeIntegers to SmallInteger"
  at: sourceObj
  [| value box |
  self assert: (sourceHeap isImmediate: sourceObj).
  (sourceHeap isImmediateCharacter: sourceObj)
  ifTrue: [targetHeap characterObjectOf: (sourceHeap characterValueOf: sourceObj)]
  [(sourceHeap isIntegerObject: sourceObj)
  [(targetHeap isIntegerValue: (value := sourceHeap integerValueOf: sourceObj))
  ifTrue: [targetHeap integerObjectOf: value]
  [box := targetHeap
  allocateSlots: 2
  format: (targetHeap byteFormatForNumBytes: value digitLength)
  classIndex: (value < 0
  ifTrue: [ClassLargeNegativeIntegerCompactIndex]
  ifFalse: [ClassLargePositiveIntegerCompactIndex]).
  targetHeap storeLong64: 0 ofObject: box withValue: value abs.
  [self assert: (sourceHeap isImmediateFloat: sourceObj).
  box := targetHeap
  allocateSlots: 2
+ format: targetHeap firstLongFormat
+ classIndex: ClassFloatCompactIndex.
- format: (targetHeap byteFormatForNumBytes: value digitLength)
- classIndex: (value < 0
- ifTrue: [ClassLargeNegativeIntegerCompactIndex]
- ifFalse: [ClassLargePositiveIntegerCompactIndex]).
  targetHeap storeLong64: 0 ofObject: box withValue: (sourceHeap smallFloatBitsOf: sourceObj).

Item was added:
+ ----- Method: Spur64to32BitImageConverter>>sixtyFourBitHeap (in category 'private-accessing') -----
+ sixtyFourBitHeap
+ ^sourceHeap!

Item was changed:
  ----- Method: SpurMtoNBitImageConverter>>fillInBitsObject:from: (in category 'bootstrap image') -----
  fillInBitsObject: targetObj from: sourceObj
+ 0 to: (sourceHeap num32BitUnitsOf: sourceObj) - 1 do:
- 0 to: (sourceHeap numBytesOf: sourceObj) - 1 do:
+ storeLong32: i
- storeByte: i
  ofObject: targetObj
+ withValue: (sourceHeap fetchLong32: i ofObject: sourceObj)]!
- withValue: (sourceHeap fetchByte: i ofObject: sourceObj)]!

Item was changed:
  ----- Method: SpurMtoNBitImageConverter>>fillInObjects (in category 'bootstrap image') -----
  "sourceInterpreter printOop: sourceObj"
+ | i freeListsObject |
- | i |
  {sourceHeap markStack. sourceHeap weaklingStack. sourceHeap mournQueue} do:
  obj ~= sourceHeap nilObject ifTrue:
  [map at: obj put: (map at: sourceHeap nilObject)]].
  i := 0.
+ freeListsObject := sourceHeap freeListsObject.
  sourceHeap allObjectsDo:
  (i := i + 1) >= 10000 ifTrue:
  [Transcript nextPut: $.; flush. i := 0].
  (map at: sourceObj ifAbsent: nil)
  [:targetObj| | format classIndex |
  (targetHeap numSlotsOf: targetObj) > 0 ifTrue: "filter-out filtered objStack pages"
  [format := sourceHeap formatOf: sourceObj.
  (targetHeap isPointersFormat: format)
  [((targetHeap isIndexableFormat: format)
  and: [(classIndex := targetHeap classIndexOf: targetObj) <= ClassBlockClosureCompactIndex
  and: [classIndex >= ClassMethodContextCompactIndex]])
  ifTrue: [self fillInPointerObjectWithPC: targetObj from: sourceObj]
  ifFalse: [self fillInPointerObject: targetObj from: sourceObj]]
  [(targetHeap isCompiledMethodFormat: format)
  ifTrue: [self fillInCompiledMethod: targetObj from: sourceObj]
+ ifFalse:
+ [sourceObj ~= freeListsObject ifTrue:
+ [self fillInBitsObject: targetObj from: sourceObj]]]]]
- ifFalse: [self fillInBitsObject: targetObj from: sourceObj]]]]
  ifNil: [self assert: (self isUnmappedObject: sourceObj)]]!

Item was added:
+ ----- Method: SpurMtoNBitImageConverter>>sixtyFourBitHeap (in category 'private-accessing') -----
+ sixtyFourBitHeap
+ self subclassResponsibility!

Item was changed:
  ----- Method: SpurMtoNBitImageConverter>>smallFloatClass (in category 'bootstrap image') -----
+ ^targetHeap fetchPointer: sourceHeap smallFloatTag ofObject: targetHeap classTableFirstPage!
- self subclassResponsibility!