[Vm-dev] VM Maker: Cog-eem.100.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 24 20:25:08 UTC 2013
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.100.mcz
==================== Summary ====================
Name: Cog-eem.100
Author: eem
Time: 24 September 2013, 1:24:54.567 pm
UUID: 95a46b20-6f47-408d-8ff0-9b1903ef860c
Ancestors: Cog-eem.99
Fix a typo in a prootype method.
Report on heap growth during bootstrap.
=============== Diff against Cog-eem.99 ===============
Item was changed:
Object subclass: #SpurBootstrap
+ instanceVariableNames: 'oldHeap newHeap oldHeapSize newHeapSize map reverseMap classToIndex oldInterpreter lastClassTablePage literalMap methodClasses installedPrototypes sizeSym rehashSym classMetaclass'
- instanceVariableNames: 'oldHeap newHeap map reverseMap classToIndex oldInterpreter lastClassTablePage literalMap methodClasses installedPrototypes sizeSym rehashSym classMetaclass'
classVariableNames: 'ImageHeaderFlags ImageName 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 class>>BehaviorPROTOTYPEinstSpec (in category 'method prototypes') -----
BehaviorPROTOTYPEinstSpec
"Answer the instance specification part of the format that defines what kind of object
+ an instance of the receiver is. The formats are
+ 0 = 0 sized objects (UndefinedObject True False et al)
- an instance of the receiver is. The formats are0 = 0 sized objects (UndefinedObject True False et al)
1 = non-indexable objects with inst vars (Point et al)
2 = indexable objects with no inst vars (Array et al)
3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al)
4 = weak indexable objects with inst vars (WeakArray et al)
5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron)
6 unused, reserved for exotic pointer objects?
7 reserved by the VM
8 unused, reserved for exotic non-pointer objects?
9 (?) 64-bit indexable
10 - 11 32-bit indexable
12 - 15 16-bit indexable
16 - 23 byte indexable
24 - 31 compiled method"
^(format bitShift: -16) bitAnd: 16r1F!
Item was changed:
----- Method: SpurBootstrap>>bootstrapImage (in category 'bootstrap image') -----
bootstrapImage
+ oldHeap fullGC.
+ oldHeapSize := oldHeap freeStart.
Transcript cr; nextPutAll: 'transforming image...'; flush.
self cloneNilTrueAndFalse.
self buildClassMap.
self allocateClassTable.
self cloneObjects.
self fillInObjects.
self fillInClassTable.
+ newHeapSize := newHeap freeStart.
newHeap initializePostBootstrap!
Item was changed:
----- Method: SpurBootstrap>>transform (in category 'bootstrap image') -----
transform
+ | change |
self rememberRehashSymbol.
self findRequiredGlobals.
self installModifiedMethods.
self bootstrapImage.
self validate.
self rehashImage.
self followForwardingPointers.
self scavengeImage.
self freeForwarders.
self compactImage.
+ change := newHeapSize - oldHeapSize / oldHeapSize.
+ Transcript
+ nextPutAll: 'done.'; cr;
+ nextPutAll: 'old heap size: '; print: oldHeapSize; cr;
+ nextPutAll: 'initial new heap size: '; print: newHeapSize; cr;
+ nextPutAll: 'change: '; print: (change * 100.0 roundTo: 0.01); nextPut: $%; cr;
+ flush.
+ newHeapSize := newHeap endOfMemory
+ - newHeap scavenger eden limit
+ - newHeap totalFreeListBytes.
+ change := newHeapSize - oldHeapSize / oldHeapSize.
+ Transcript
+ nextPutAll: 'final new heap size: '; print: newHeapSize; cr;
+ nextPutAll: 'change: '; print: (change * 100.0 roundTo: 0.01); nextPut: $%; cr;
+ flush.!
- Transcript nextPutAll: 'done.'; flush.!
More information about the Vm-dev
mailing list