[Vm-dev] VM Maker: VMMaker.oscog-cb.1842.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 25 15:45:15 UTC 2016


ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1842.mcz

==================== Summary ====================

Name: VMMaker.oscog-cb.1842
Author: cb
Time: 25 April 2016, 5:43:54.079924 pm
UUID: 2ce5e12d-6660-475e-ae31-cf98d07390dd
Ancestors: VMMaker.oscog-nice.1841

Added a primitive to answer all the methods present in the machine code zone.

allMachineCodeMethods
	<primitive: 'primitiveAllMethodsCompiledToMachineCode' module:''>
	^#()
	
This way inferencing types from runtime information in the image is easier as one can ask the VM which method have type information, then ask for the type information of the method which have some.

=============== Diff against VMMaker.oscog-nice.1841 ===============

Item was added:
+ ----- Method: CoInterpreterPrimitives>>primitiveAllMethodsCompiledToMachineCode (in category 'method introspection primitives') -----
+ primitiveAllMethodsCompiledToMachineCode
+ 	<export: true>
+ 	<option: #SistaCogit>
+ 	| arrayObj |
+ 	argumentCount ~= 0 ifTrue:
+ 		[^self primitiveFailFor: PrimErrBadNumArgs].
+ 	arrayObj := objectMemory instantiateClass: (objectMemory splObj: ClassArray) indexableSize: cogit numMethods.
+ 	arrayObj ifNil: [^-1].
+ 	cogit methodsCompiledToMachineCodeInto: arrayObj.
+ 	self pop: 1 thenPush: arrayObj!

Item was added:
+ ----- 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.
+ 			 methodIndex := methodIndex + 1].
+ 		 cogMethod := self methodAfter: cogMethod].
+ 	!

Item was changed:
  ----- Method: CogMethodZone>>numMethods (in category 'accessing') -----
  numMethods
+ 	<api>
  	^methodCount!



More information about the Vm-dev mailing list