[Vm-dev] VM Maker: Cog-eem.80.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Sep 9 23:57:56 UTC 2013
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.80.mcz
==================== Summary ====================
Name: Cog-eem.80
Author: eem
Time: 9 September 2013, 4:57:42.949 pm
UUID: 7c00004c-7cef-46e2-ac92-e850b2714632
Ancestors: Cog-eem.79
Fix bug in newClassFormatFor: that failed to transform class Bitmap.
Add a class variable in which to save the transformed image,
and a way to launch it. No waiting for the bootstrap any longer.
=============== Diff against Cog-eem.79 ===============
Item was changed:
Object subclass: #SpurBootstrap
instanceVariableNames: 'oldHeap newHeap map reverseMap classToIndex oldInterpreter lastClassTablePage symbolMap methodClasses installedPrototypes'
+ classVariableNames: 'TransformedImage'
- classVariableNames: ''
poolDictionaries: 'VMObjectIndices'
category: 'Cog-Bootstrapping'!
!SpurBootstrap commentStamp: 'eem 9/7/2013 13:23' 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
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!
- | sim |
- sim := StackInterpreterSimulator onObjectMemory: newHeap.
- newHeap coInterpreter: sim.
- sim initializeInterpreter: 0.
- sim
- ensureDebugAtEachStepBlock;
- instVarNamed: 'printBytecodeAtEachStep' put: true;
- instVarNamed: 'methodDictLinearSearchLimit' put: SmallInteger maxVal. "for now"
- sim run!
Item was added:
+ ----- Method: SpurBootstrap>>launch: (in category 'testing') -----
+ launch: heap
+ | sim |
+ sim := StackInterpreterSimulator onObjectMemory: heap.
+ heap coInterpreter: sim.
+ sim initializeInterpreter: 0.
+ sim
+ instVarNamed: 'printSends' put: true;
+ instVarNamed: 'printReturns' put: true;
+ instVarNamed: 'methodDictLinearSearchLimit' put: SmallInteger maxVal. "for now"
+ sim run!
Item was added:
+ ----- Method: SpurBootstrap>>launchSaved (in category 'testing') -----
+ launchSaved
+ self launch: TransformedImage veryDeepCopy!
Item was changed:
----- Method: SpurBootstrap>>newClassFormatFor: (in category 'bootstrap image') -----
newClassFormatFor: oldClassObj
"OLD: <2 bits=instSize//64><5 bits=cClass><4 bits=instSpec><6 bits=instSize\\64><1 bit=0>
NEW: <5 bits inst spec><16 bits inst size>"
| oldFormat instSize newInstSpec |
oldFormat := oldHeap formatOfClass: oldClassObj. "N.B. SmallInteger with tag bit cleared"
oldFormat := oldFormat >> 1.
instSize := ((oldFormat bitShift: -10) bitAnd: 16rC0) + ((oldFormat bitShift: -1) bitAnd: 16r3F) - 1.
+ newInstSpec := #(0 1 2 3 4 nil 10 9 16 16 16 16 24 24 24 24) at: ((oldFormat bitShift: -7) bitAnd: 16rF) + 1.
- newInstSpec := #(0 1 2 3 4 5 6 7 16 16 16 16 24 24 24 24) at: ((oldFormat bitShift: -7) bitAnd: 16rF) + 1.
^newHeap integerObjectOf: newInstSpec << 16 + instSize!
Item was added:
+ ----- Method: SpurBootstrap>>saveTransformedImage (in category 'development support') -----
+ saveTransformedImage
+ TransformedImage := newHeap veryDeepCopy!
More information about the Vm-dev
mailing list