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

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

==================== 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') -----
  ensureSmallFloatInClassTable
  "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"
  ^map
  at: sourceObj
  ifAbsent:
  [| value box |
  self assert: (sourceHeap isImmediate: sourceObj).
  (sourceHeap isImmediateCharacter: sourceObj)
  ifTrue: [targetHeap characterObjectOf: (sourceHeap characterValueOf: sourceObj)]
  ifFalse:
  [(sourceHeap isIntegerObject: sourceObj)
  ifTrue:
  [(targetHeap isIntegerValue: (value := sourceHeap integerValueOf: sourceObj))
  ifTrue: [targetHeap integerObjectOf: value]
  ifFalse:
  [box := targetHeap
  allocateSlots: 2
  format: (targetHeap byteFormatForNumBytes: value digitLength)
  classIndex: (value < 0
  ifTrue: [ClassLargeNegativeIntegerCompactIndex]
  ifFalse: [ClassLargePositiveIntegerCompactIndex]).
  targetHeap storeLong64: 0 ofObject: box withValue: value abs.
  box]]
  ifFalse:
  [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).
  box]]]!

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:
  [:i|
  targetHeap
+ 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') -----
  fillInObjects
  "sourceInterpreter printOop: sourceObj"
+ | i freeListsObject |
- | i |
  {sourceHeap markStack. sourceHeap weaklingStack. sourceHeap mournQueue} do:
  [:obj|
  obj ~= sourceHeap nilObject ifTrue:
  [map at: obj put: (map at: sourceHeap nilObject)]].
  i := 0.
+ freeListsObject := sourceHeap freeListsObject.
  sourceHeap allObjectsDo:
  [:sourceObj|
  (i := i + 1) >= 10000 ifTrue:
  [Transcript nextPut: $.; flush. i := 0].
  (map at: sourceObj ifAbsent: nil)
  ifNotNil:
  [:targetObj| | format classIndex |
  (targetHeap numSlotsOf: targetObj) > 0 ifTrue: "filter-out filtered objStack pages"
  [format := sourceHeap formatOf: sourceObj.
  (targetHeap isPointersFormat: format)
  ifTrue:
  [((targetHeap isIndexableFormat: format)
  and: [(classIndex := targetHeap classIndexOf: targetObj) <= ClassBlockClosureCompactIndex
  and: [classIndex >= ClassMethodContextCompactIndex]])
  ifTrue: [self fillInPointerObjectWithPC: targetObj from: sourceObj]
  ifFalse: [self fillInPointerObject: targetObj from: sourceObj]]
  ifFalse:
  [(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') -----
  smallFloatClass
+ ^targetHeap fetchPointer: sourceHeap smallFloatTag ofObject: targetHeap classTableFirstPage!
- self subclassResponsibility!