[Vm-dev] VM Maker: VMMaker.oscog-cb.1846.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 26 07:36:46 UTC 2016
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1846.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1846
Author: cb
Time: 26 April 2016, 9:34:11.962387 am
UUID: 1722de25-959a-41b4-ab92-b31c62fa8ec0
Ancestors: VMMaker.oscog-eem.1845
Added convenience methods to simulate new sista primitive allMachineCodeMethods (Maybe it shouldn't be a sista primitive ?).
Fixed the primitive so that it shorten the array answered instead of answering an array ending with many nil.
=============== Diff against VMMaker.oscog-eem.1845 ===============
Item was changed:
----- Method: CoInterpreterPrimitives>>primitiveAllMethodsCompiledToMachineCode (in category 'method introspection primitives') -----
primitiveAllMethodsCompiledToMachineCode
<export: true>
<option: #SistaCogit>
+ | arrayObj nEntries maxNumEntries |
- | arrayObj |
argumentCount ~= 0 ifTrue:
[^self primitiveFailFor: PrimErrBadNumArgs].
+ maxNumEntries := cogit numMethods + objectMemory minSlotsForShortening.
+ arrayObj := objectMemory
+ instantiateClass: (objectMemory splObj: ClassArray)
+ indexableSize: maxNumEntries.
- arrayObj := objectMemory instantiateClass: (objectMemory splObj: ClassArray) indexableSize: cogit numMethods.
arrayObj ifNil: [^-1].
+ nEntries := cogit methodsCompiledToMachineCodeInto: arrayObj.
+ (nEntries < maxNumEntries) ifTrue:
+ [objectMemory shorten: arrayObj toIndexableSize: nEntries].
- cogit methodsCompiledToMachineCodeInto: arrayObj.
self pop: 1 thenPush: arrayObj!
Item was changed:
----- Method: CogMethodZone>>methodsCompiledToMachineCodeInto: (in category 'method zone introspection') -----
methodsCompiledToMachineCodeInto: arrayObj
<api>
- <returnTypeC: #void>
<var: #cogMethod type: #'CogMethod *'>
| cogMethod methodIndex |
methodIndex := 0.
cogMethod := cogit cCoerceSimple: baseAddress to: #'CogMethod *'.
[cogMethod < self limitZony] whileTrue:
[cogMethod cmType = CMMethod ifTrue:
+ [objectMemory
+ storePointerUnchecked: methodIndex
+ ofObject: arrayObj
+ withValue: cogMethod methodObject.
- [objectMemory storePointerUnchecked: methodIndex ofObject: arrayObj withValue: cogMethod methodObject.
methodIndex := methodIndex + 1].
cogMethod := self methodAfter: cogMethod].
+ ^ methodIndex
!
Item was added:
+ ----- Method: SistaCogit>>methodsCompiledToMachineCodeInto: (in category 'simulation only') -----
+ methodsCompiledToMachineCodeInto: arrayObject
+ <doNotGenerate>
+ ^methodZone methodsCompiledToMachineCodeInto: arrayObject!
Item was added:
+ ----- Method: SistaCogit>>numMethods (in category 'simulation only') -----
+ numMethods
+ <doNotGenerate>
+ ^methodZone numMethods!
More information about the Vm-dev
mailing list