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

commits at source.squeak.org commits at source.squeak.org
Wed Feb 23 01:01:25 UTC 2022


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

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

Name: Cog-eem.450
Author: eem
Time: 22 February 2022, 5:01:24.292926 pm
UUID: 5598d2df-ceec-431e-be4f-29b1458b907f
Ancestors: Cog-eem.449

Fix disassembleInstructionAt:In: to work for the simulation case (Spur uses a memory offset to implement a null pointer trap) and the development case (no memoryOffset when disassembling freshly generated machine code in a CogAbstractInstruction).

Update primitiveMemoryOffset to use the new metadata style.

=============== Diff against Cog-eem.449 ===============

Item was changed:
  ----- Method: CogProcessorAlien>>disassembleInstructionAt:In: (in category 'disassembly') -----
  disassembleInstructionAt: pc In: memory
+ 	"This is hacked to meet two different needs. With back end development (subclasses of
+ 	 CogAbstractInstruction) we want to disassemble individual instructions in these objects,
+ 	 and have to remove memoryOffset.
+ 	 With the broader simulation we want to disassemble instructions in the simulation memory
+ 	 (e.g. for a CogProcessorInspector), and so the memoryOffset is required (it is implicit)."
+ 	^(self primitiveDisassembleAt: (memory size < 524288
+ 										ifTrue: [pc + self memoryOffset]
+ 										ifFalse: [pc])
+ 			inMemory: memory) last!
- 	^(self primitiveDisassembleAt: pc inMemory: memory) last!

Item was changed:
  ----- Method: ProcessorSimulatorPlugin>>primitiveMemoryOffset (in category 'primitives') -----
  primitiveMemoryOffset
  	"Get or set the memory offset.  If non-zero the memry offset is one word (4 or 8 bytes), to marry with the
  	 SuprMemoryManager simulators discarding of the first word of memory as a null pointer trap."
+ 	<export: true>
+ 	<primitiveMetadata: #(FastCPrimitiveFlag)>
- 	<export: true flags: #(FastCPrimitiveFlag)>
  	| offset previousValue |
  	interpreterProxy methodArgumentCount = 0 ifTrue:
  		[^interpreterProxy methodReturnInteger: memoryOffset].
  	interpreterProxy methodArgumentCount ~= 1 ifTrue:
  		[^interpreterProxy primitiveFailFor: PrimErrBadNumArgs].
  	offset := interpreterProxy stackValue: 0.
  	(interpreterProxy isIntegerObject: offset) ifFalse:
  		[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  	previousValue := memoryOffset.
  	memoryOffset := interpreterProxy integerValueOf: offset.
  	^interpreterProxy methodReturnInteger: previousValue!



More information about the Vm-dev mailing list