[Vm-dev] VM Maker: Cog-eem.64.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Sep 2 20:27:11 UTC 2013
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.64.mcz
==================== Summary ====================
Name: Cog-eem.64
Author: eem
Time: 2 September 2013, 1:26:51.013 pm
UUID: 05a74b07-3da5-409c-845a-11f24a2ea00e
Ancestors: Cog-eem.63
Add a launch to launch the StackImnterpreter post bootstrap.
Needs VMMaker.oscog-eem.341.
=============== Diff against Cog-eem.63 ===============
Item was changed:
Object subclass: #SpurBootstrap
instanceVariableNames: 'oldHeap newHeap map reverseMap classToIndex oldInterpreter pastClassTable'
classVariableNames: ''
poolDictionaries: 'VMObjectIndices'
category: 'Cog-Bootstrapping'!
+ !SpurBootstrap commentStamp: 'eem 9/2/2013 13:26' prior: 0!
- !SpurBootstrap commentStamp: 'eem 8/31/2013 12:20' prior: 0!
SpurBootstrap bootstraps an image in CogMemoryManager format from a Squeak V3 + closures format.
e.g.
+ (SpurBootstrap32 new on: '/Users/eliot/Cog/startreader.image')
+ transform;
+ launch
+
- (SpurBootstrap32 new on: '/Users/eliot/Cog/startreader.image') transform
Instance Variables
classToIndex: <Dictionary>
map: <Dictionary>
newHeap: <CogMemoryManager>
oldHeap: <NewObjectMemory>
oldInterpreter: <StackInterpreterSimulator>
classToIndex
- oldClass to new classIndex map
map
- oldObject to newObject map
newHeap
- the output, bootstrapped image
oldHeap
- the input, image
oldInterpreter
- the interpreter associated with oldHeap, needed for a hack to grab WeakArray
!
Item was changed:
----- Method: SpurBootstrap>>allocateClassTable (in category 'bootstrap') -----
allocateClassTable
"Allocate the root of the classTable plus enough pages to accomodate all classes in
the classToIndex map. Don;t fill in the entries yet; the classes have yet to be cloned."
| tableRootSize tableRoot page maxSize numPages |
tableRootSize := self classTableSize / newHeap classTablePageSize.
tableRoot := newHeap
allocateSlots: tableRootSize
format: newHeap arrayFormat
classIndex: newHeap arrayClassIndexPun.
+ self assert: (newHeap baseSlotSizeOf: tableRoot) = tableRootSize.
- self assert: (newHeap rawSlotSizeOf: tableRoot) = tableRootSize.
self assert: (newHeap formatOf: tableRoot) = newHeap arrayFormat.
self assert: (newHeap classIndexOf: tableRoot) = newHeap arrayClassIndexPun.
newHeap classTableRootObj: tableRoot.
newHeap nilFieldsOf: tableRoot.
"first page is strong"
page := newHeap
allocateSlots: newHeap classTablePageSize
format: newHeap arrayFormat
classIndex: newHeap arrayClassIndexPun.
+ self assert: (newHeap baseSlotSizeOf: page) = newHeap classTablePageSize.
- self assert: (newHeap rawSlotSizeOf: page) = newHeap classTablePageSize.
self assert: (newHeap formatOf: tableRoot) = newHeap arrayFormat.
self assert: (newHeap classIndexOf: tableRoot) = newHeap arrayClassIndexPun.
self assert: (newHeap objectAfter: tableRoot) = page.
newHeap nilFieldsOf: page.
newHeap storePointer: 0 ofObject: tableRoot withValue: page.
maxSize := classToIndex inject: 0 into: [:a :b| a max: b].
numPages := (maxSize + newHeap classTableMinorIndexMask / newHeap classTablePageSize) truncated.
2 to: numPages do:
[:i|
page := newHeap
allocateSlots: newHeap classTablePageSize
format: newHeap weakArrayFormat
classIndex: newHeap weakArrayClassIndexPun.
+ self assert: (newHeap baseSlotSizeOf: page) = newHeap classTablePageSize.
- self assert: (newHeap rawSlotSizeOf: page) = newHeap classTablePageSize.
self assert: (newHeap formatOf: page) = newHeap weakArrayFormat.
self assert: (newHeap classIndexOf: page) = newHeap weakArrayClassIndexPun.
newHeap nilFieldsOf: page.
newHeap storePointer: i - 1 ofObject: tableRoot withValue: page.
self assert: (newHeap objectAfter: (newHeap fetchPointer: i - 2 ofObject: tableRoot)) = page].
pastClassTable := newHeap freeStart.!
Item was added:
+ ----- Method: SpurBootstrap>>launch (in category 'testing') -----
+ launch
+ | sim |
+ sim := StackInterpreterSimulator new.
+ sim instVarNamed: #objectMemory put: newHeap.
+ newHeap coInterpreter: sim.
+ newHeap initializePostBootstrap.
+ sim initializeInterpreter: 0.
+ sim run!
More information about the Vm-dev
mailing list