[Vm-dev] VM Maker: Cog-eem.93.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Sep 19 23:44:34 UTC 2013
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.93.mcz
==================== Summary ====================
Name: Cog-eem.93
Author: eem
Time: 19 September 2013, 4:44:22.202 pm
UUID: d40f263c-8701-47f1-9fd8-1f95802ab49a
Ancestors: Cog-eem.92
SpurBootstrap:
Change save & launch to save & set imageHeaderFlags & imageName.
Quick hack to avoid having to write image save/load logic now.
Needs VMMaker.oscog-eem.394
=============== Diff against Cog-eem.92 ===============
Item was changed:
Object subclass: #SpurBootstrap
instanceVariableNames: 'oldHeap newHeap map reverseMap classToIndex oldInterpreter lastClassTablePage literalMap methodClasses installedPrototypes sizeSym rehashSym'
+ classVariableNames: 'ImageHeaderFlags ImageName TransformedImage'
- classVariableNames: 'NewInterpreter TransformedImage'
poolDictionaries: 'VMObjectIndices'
category: 'Cog-Bootstrapping'!
!SpurBootstrap commentStamp: 'eem 9/11/2013 05:45' prior: 0!
SpurBootstrap bootstraps an image in SpurMemoryManager format from a Squeak V3 + closures format.
e.g.
(SpurBootstrap32 new on: '/Users/eliot/Cog/startreader.image')
transform;
launch
Bootstrap issues:
- should it implement a deterministic Symbol identityHash? This means set a Symbol's identityHash at instance creation time
based on its string hash so that e.g. MethodDIctionary instances have a deterministic order and don't need to be rehashed on load.
- should it collapse ContextPart and MethodContext down onto Context (and perhaps eliminate BlockContext)?
Instance Variables
classToIndex: <Dictionary>
lastClassTablePage: <Integer>
map: <Dictionary>
methodClasses: <Set>
newHeap: <SpurMemoryManager>
oldHeap: <NewObjectMemory>
oldInterpreter: <StackInterpreterSimulator>
reverseMap: <Dictionary>
symbolMap: <Dictionary>
classToIndex
- oldClass to new classIndex map
lastClassTablePage
- oop in newHeap of last classTable page. U<sed in validation to filter-out class table.
methodClasses
- cache of methodClassAssociations for classes in which modified methods are installed
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
reverseMap
- newObject to oldObject map
symbolMap
- symbol toi symbol oop in oldHeap, used to map prototype methdos to methods in oldHeap!
Item was changed:
----- Method: SpurBootstrap>>launch (in category 'testing') -----
launch
+ self launch: newHeap headerFlags: oldInterpreter getImageHeaderFlags!
- self launch: newHeap!
Item was removed:
- ----- Method: SpurBootstrap>>launch: (in category 'testing') -----
- launch: heap
- | sim |
- sim := StackInterpreterSimulator onObjectMemory: heap.
- heap coInterpreter: sim.
- sim
- initializeInterpreter: 0;
- transcript: Transcript. "deep copy copies this"
- sim
- instVarNamed: 'printSends' put: true;
- instVarNamed: 'printReturns' put: true;
- instVarNamed: 'methodDictLinearSearchLimit' put: SmallInteger maxVal. "for now"
- sim run!
Item was added:
+ ----- Method: SpurBootstrap>>launch:headerFlags: (in category 'testing') -----
+ launch: heap headerFlags: headerFlags
+ | sim |
+ sim := StackInterpreterSimulator onObjectMemory: heap.
+ heap coInterpreter: sim.
+ sim
+ initializeInterpreter: 0;
+ setImageHeaderFlagsFrom: headerFlags;
+ imageName: ImageName;
+ openAsMorph;
+ transcript: Transcript. "deep copy copies this"
+ "sim
+ instVarNamed: 'printSends' put: true;
+ instVarNamed: 'printReturns' put: true;
+ instVarNamed: 'methodDictLinearSearchLimit' put: SmallInteger maxVal." "for now"
+ sim run!
Item was changed:
----- Method: SpurBootstrap>>launchSaved (in category 'testing') -----
launchSaved
+ self launch: TransformedImage veryDeepCopy headerFlags: ImageHeaderFlags!
- self launch: TransformedImage veryDeepCopy!
Item was changed:
----- Method: SpurBootstrap>>saveTransformedImage (in category 'development support') -----
saveTransformedImage
+ ImageHeaderFlags := oldInterpreter getImageHeaderFlags.
+ ImageName := oldInterpreter imageName.
newHeap coInterpreter: nil.
TransformedImage := newHeap veryDeepCopy!
More information about the Vm-dev
mailing list