[Vm-dev] VM Maker: Cog-eem.390.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 18 20:08:43 UTC 2020


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

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

Name: Cog-eem.390
Author: eem
Time: 18 January 2020, 12:08:41.68129 pm
UUID: f7c8c732-a644-4bc1-8de4-76cfc3f06fc9
Ancestors: Cog-eem.389

Use the new integer class plugin API functions to answer the integer register state vector directly, without needing a class parameter to the primitive.

=============== Diff against Cog-eem.389 ===============

Item was added:
+ ----- Method: BochsIA32Plugin>>is64BitISA (in category 'private') -----
+ is64BitISA
+ 	^false!

Item was added:
+ ----- Method: BochsX64Plugin>>is64BitISA (in category 'private') -----
+ is64BitISA
+ 	^true!

Item was added:
+ ----- Method: GdbARMv6Plugin>>is64BitISA (in category 'private') -----
+ is64BitISA
+ 	^false!

Item was added:
+ ----- Method: GdbARMv8Plugin>>is64BitISA (in category 'private') -----
+ is64BitISA
+ 	^true!

Item was added:
+ ----- Method: ProcessorSimulatorPlugin>>is64BitISA (in category 'private') -----
+ is64BitISA
+ 	^self subclassResponsibility!

Item was added:
+ ----- Method: ProcessorSimulatorPlugin>>primitiveIntegerRegisterState (in category 'primitives') -----
+ primitiveIntegerRegisterState
+ 	"Answer an IntegerArray of the processor's integer register state, ending with, if these are not otherwise
+ 	 included in the register state, the pc and the flags (if the processor has flags).
+ 	 This primitive is unnecessary; it exists only to speed up single stepping."
+ 	| cpuAlien cpu registerStateVector |
+ 	<var: #cpu type: #'void *'>
+ 	cpuAlien := self primitive: #primitiveIntegerRegisterState parameters: #() receiver: #Oop.
+ 
+ 	(cpu := self cCoerceSimple: (self startOfData: cpuAlien) to: #'void *') = 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrBadReceiver].
+ 	
+ 	"The plugin specific include file must define NumIntegerRegisterStateFields"
+ 	registerStateVector := interpreterProxy
+ 								instantiateClass: (self is64BitISA
+ 													ifTrue: [interpreterProxy classDoubleByteArray]
+ 													ifFalse: [interpreterProxy classWordArray])
+ 								indexableSize: NumIntegerRegisterStateFields.
+ 	registerStateVector = 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrNoMemory].
+ 	(interpreterProxy byteSizeOf: registerStateVector) ~= (NumIntegerRegisterStateFields * (self sizeof: self integerRegisterElementType)) ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
+ 	self storeIntegerRegisterStateOf: cpu into: (interpreterProxy firstIndexableField: registerStateVector).
+ 
+ 	^registerStateVector!

Item was removed:
- ----- Method: ProcessorSimulatorPlugin>>primitiveIntegerRegisterState: (in category 'primitives') -----
- primitiveIntegerRegisterState: integerArrayClass
- 	"Answer an IntegerArray of the processor's integer register state, ending with, if these are not otherwise
- 	 included in the register state, the pc and the flags (if the processor has flags). The integer array will be an
- 	 instance of the class argument, which must be large enough for the natural word size of the processor.
- 	 This primitive is unnecessary; it exists only to speed up single stepping."
- 	| cpuAlien cpu registerStateVector |
- 	<var: #cpu type: #'void *'>
- 	cpuAlien := self primitive: #primitiveIntegerRegisterState parameters: #(Oop) receiver: #Oop.
- 
- 	(cpu := self cCoerceSimple: (self startOfData: cpuAlien) to: #'void *') = 0 ifTrue:
- 		[^interpreterProxy primitiveFailFor: PrimErrBadReceiver].
- 	
- 	"The plugin specific include file must define NumIntegerRegisterStateFields"
- 	registerStateVector := interpreterProxy instantiateClass: integerArrayClass indexableSize: NumIntegerRegisterStateFields.
- 	registerStateVector = 0 ifTrue:
- 		[^interpreterProxy primitiveFailFor: PrimErrNoMemory].
- 	(interpreterProxy byteSizeOf: registerStateVector) ~= (NumIntegerRegisterStateFields * (self sizeof: self integerRegisterElementType)) ifTrue:
- 		[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
- 	self storeIntegerRegisterStateOf: cpu into: (interpreterProxy firstIndexableField: registerStateVector).
- 
- 	^registerStateVector!



More information about the Vm-dev mailing list