[Vm-dev] VM Maker: VMMaker.oscog-eem.1824.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 20 00:11:23 UTC 2016


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1824.mcz

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

Name: VMMaker.oscog-eem.1824
Author: eem
Time: 19 April 2016, 5:09:37.848233 pm
UUID: 3e604324-d371-4ad6-ac2d-8acf325accfe
Ancestors: VMMaker.oscog-eem.1823

Make sure the map data introspection primitive includes the stackCheck entry for frameful methods, and includes the entry offsets for frameless methods.

=============== Diff against VMMaker.oscog-eem.1823 ===============

Item was changed:
  ----- Method: SimpleStackBasedCogit>>mapPCDataFor:into: (in category 'method introspection') -----
  mapPCDataFor: cogMethod into: arrayObj
  	"Collect the branch and send data for cogMethod, storing it into arrayObj."
  	<api>
  	<var: #cogMethod type: #'CogMethod *'>
  	| errCode |
  	introspectionDataIndex := 0.
  	introspectionData := arrayObj.
  	cogMethod stackCheckOffset = 0 ifTrue:
+ 		[self assert: introspectionDataIndex = 0.
+ 		 cogMethod cmIsFullBlock
+ 			ifTrue:
+ 				[objectMemory
+ 					storePointerUnchecked: 0 ofObject: introspectionData withValue: objectMemory nilObject;
+ 					storePointerUnchecked: 1 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cbNoSwitchEntryOffset);
+ 					storePointerUnchecked: 2 ofObject: introspectionData withValue: objectMemory nilObject;
+ 					storePointerUnchecked: 3 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cbEntryOffset)]
+ 			ifFalse:
+ 				[objectMemory
+ 					storePointerUnchecked: 0 ofObject: introspectionData withValue: objectMemory nilObject;
+ 					storePointerUnchecked: 1 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cmEntryOffset);
+ 					storePointerUnchecked: 2 ofObject: introspectionData withValue: objectMemory nilObject;
+ 					storePointerUnchecked: 3 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cmNoCheckEntryOffset)].
+ 		 ^4].
- 		[^0].
  	errCode := self
  					mapFor: (self cCoerceSimple: cogMethod to: #'CogBlockMethod *')
  					bcpc: (coInterpreter startPCOfMethod: cogMethod methodObject)
  					performUntil: #pcDataFor:Annotation:Mcpc:Bcpc:Method:
  					arg: cogMethod asVoidPointer.
  	errCode ~= 0 ifTrue:
  		[self assert: errCode = PrimErrNoMemory.
  		 ^-1].
  	cogMethod blockEntryOffset ~= 0 ifTrue:
  		[errCode := self blockDispatchTargetsFor: cogMethod
  						perform: #pcDataForBlockEntry:Method:
  						arg: cogMethod asInteger.
  		 errCode ~= 0 ifTrue:
  			[self assert: errCode = PrimErrNoMemory.
  			 ^-1]].
  	^introspectionDataIndex!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>pcDataFor:Annotation:Mcpc:Bcpc:Method: (in category 'method introspection') -----
  pcDataFor: descriptor Annotation: isBackwardBranchAndAnnotation Mcpc: mcpc Bcpc: bcpc Method: cogMethodArg
  	<var: #descriptor type: #'BytecodeDescriptor *'>
  	<var: #mcpc type: #'char *'>
  	<var: #cogMethodArg type: #'void *'>
  
  	descriptor ifNil: "this is the stackCheck offset"
  		[self assert: introspectionDataIndex = 0.
  		 (self cCoerceSimple: cogMethodArg to: #'CogMethod *') cmIsFullBlock
  			ifTrue:
  				[objectMemory
  					storePointerUnchecked: introspectionDataIndex + 0 ofObject: introspectionData withValue: objectMemory nilObject;
  					storePointerUnchecked: introspectionDataIndex + 1 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cbNoSwitchEntryOffset);
  					storePointerUnchecked: introspectionDataIndex + 2 ofObject: introspectionData withValue: objectMemory nilObject;
  					storePointerUnchecked: introspectionDataIndex + 3 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cbEntryOffset)]
  			ifFalse:
  				[objectMemory
  					storePointerUnchecked: introspectionDataIndex + 0 ofObject: introspectionData withValue: objectMemory nilObject;
  					storePointerUnchecked: introspectionDataIndex + 1 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cmEntryOffset);
  					storePointerUnchecked: introspectionDataIndex + 2 ofObject: introspectionData withValue: objectMemory nilObject;
  					storePointerUnchecked: introspectionDataIndex + 3 ofObject: introspectionData withValue: (objectMemory integerObjectOf: cmNoCheckEntryOffset)].
+ 		 objectMemory
+ 			storePointerUnchecked: introspectionDataIndex + 4 ofObject: introspectionData withValue: (objectMemory integerObjectOf: bcpc + 1);
+ 			storePointerUnchecked: introspectionDataIndex + 5 ofObject: introspectionData withValue: (objectMemory integerObjectOf: (self cCoerceSimple: cogMethodArg to: #'CogMethod *') stackCheckOffset).
+ 		 introspectionDataIndex := introspectionDataIndex + 6.
- 		 introspectionDataIndex := introspectionDataIndex + 4.
  		 ^0].
  
  	(self isPCMappedAnnotation: isBackwardBranchAndAnnotation >> 1) ifTrue:
  		[| actualBcpc actualMcpc |
  		 actualBcpc := (isBackwardBranchAndAnnotation anyMask: 1)
  							ifTrue: [bcpc + 1]
  							ifFalse: [bcpc + descriptor numBytes + 1].
  		 actualMcpc := mcpc asUnsignedInteger - cogMethodArg asUnsignedInteger.
  		 objectMemory
  			storePointerUnchecked: introspectionDataIndex + 0 ofObject: introspectionData withValue: (objectMemory integerObjectOf: actualBcpc);
  			storePointerUnchecked: introspectionDataIndex + 1 ofObject: introspectionData withValue: (objectMemory integerObjectOf: actualMcpc).
  		 introspectionDataIndex := introspectionDataIndex + 2].
  
  	^0!



More information about the Vm-dev mailing list