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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 17 08:05:40 UTC 2015


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

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

Name: Cog-eem.310
Author: eem
Time: 17 December 2015, 12:05:25.428 am
UUID: 1b369b07-853b-4937-8a11-b48bef3e5cae
Ancestors: Cog-eem.309

Fix or implement Move ALOb/ObAL/AXOv/OvAX error handling for x64.  I had copied the opcodes wrongly from x64.

=============== Diff against Cog-eem.309 ===============

Item was changed:
  ----- Method: BochsX64Alien class>>initialize (in category 'class initialization') -----
  initialize
  	"BochsX64Alien initialize"
  	| it |
  	it := self basicNew.
  	OpcodeExceptionMap := Array new: 256 withAll: #handleExecutionPrimitiveFailureAt:in:rex:.
  	OpcodeExceptionMap
+ 		at: 1 + it callOpcode		put: #handleCallFailureAt:in:rex:;
+ 		at: 1 + it jmpOpcode		put: #handleJmpFailureAt:in:rex:;
+ 		at: 1 + it retOpcode		put: #handleRetFailureAt:in:rex:;
- 		at: 1 + it callOpcode			put: #handleCallFailureAt:in:rex:;
- 		at: 1 + it jmpOpcode			put: #handleJmpFailureAt:in:rex:;
- 		at: 1 + it retOpcode			put: #handleRetFailureAt:in:rex:;
  		at: 1 + it movALObOpcode	put: #handleMovALObFailureAt:in:rex:;
+ 		at: 1 + it movAXOvOpcode	put: #handleMovAXOvFailureAt:in:rex:;
  		at: 1 + it movObALOpcode	put: #handleMovObALFailureAt:in:rex:;
+ 		at: 1 + it movOvAXOpcode	put: #handleMovOvAXFailureAt:in:rex:;
  		at: 1 + it movGvEvOpcode	put: #handleMovGvEvFailureAt:in:rex:;
  		at: 1 + it movEvGvOpcode	put: #handleMovEvGvFailureAt:in:rex:;
  		at: 1 + it movGbEbOpcode	put: #handleMovGbEbFailureAt:in:rex:;
  		at: 1 + it movEbGbOpcode	put: #handleMovEbGbFailureAt:in:rex:;
  		at: 1 + 16rFF				put: #handleGroup5FailureAt:in:rex:. "Table A6 One-Byte and Two-Byte Opcode ModRM Extensions"
  	ExtendedOpcodeExceptionMap := Array new: 256 withAll: #handleExecutionPrimitiveFailureAt:in:rex:.
  	ExtendedOpcodeExceptionMap
  		at: 1 + it movGvEbOpcode put: #handleMovGvEbFailureAt:in:rex:!

Item was changed:
  ----- Method: BochsX64Alien>>handleMovALObFailureAt:in:rex: (in category 'error handling') -----
  handleMovALObFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil "<Integer|nil>"
+ 	"Convert an execution primitive failure for a read into al into a ProcessorSimulationTrap signal."
- 	"Convert an execution primitive failure for a read into rax/eax into a ProcessorSimulationTrap signal."
  	rexByteOrNil ifNotNil:
+ 		[self assert: rexByteOrNil = 16r48.
+ 		 ^(ProcessorSimulationTrap
- 		[^(ProcessorSimulationTrap
  				pc: pc
  				nextpc: pc + 10
  				address: (memoryArray unsignedLong64At: pc + 3)
  				type: #read
+ 				accessor: #al:)
- 				accessor: #rax:)
  			signal].
  	^(ProcessorSimulationTrap
  			pc: pc
  			nextpc: pc + 5
  			address: (memoryArray unsignedLongAt: pc + 2)
  			type: #read
+ 			accessor: #al:)
- 			accessor: #eax:)
  		signal!

Item was added:
+ ----- Method: BochsX64Alien>>handleMovAXOvFailureAt:in:rex: (in category 'error handling') -----
+ handleMovAXOvFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil "<Integer|nil>"
+ 	"Convert an execution primitive failure for a read into rax/eax into a ProcessorSimulationTrap signal."
+ 	rexByteOrNil ifNotNil:
+ 		[self assert: rexByteOrNil = 16r48.
+ 		 ^(ProcessorSimulationTrap
+ 				pc: pc
+ 				nextpc: pc + 10
+ 				address: (memoryArray unsignedLong64At: pc + 3)
+ 				type: #read
+ 				accessor: #rax:)
+ 			signal].
+ 	^(ProcessorSimulationTrap
+ 			pc: pc
+ 			nextpc: pc + 5
+ 			address: (memoryArray unsignedLongAt: pc + 2)
+ 			type: #read
+ 			accessor: #eax:)
+ 		signal!

Item was changed:
  ----- Method: BochsX64Alien>>handleMovObALFailureAt:in:rex: (in category 'error handling') -----
  handleMovObALFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil "<Integer|nil>"
+ 	"Convert an execution primitive failure for a write of al into a ProcessorSimulationTrap signal."
+ 	self assert: rexByteOrNil = 16r48.
- 	"Convert an execution primitive failure for a write of eax into a ProcessorSimulationTrap signal."
- 	self shouldBeImplemented.
  	^(ProcessorSimulationTrap
  			pc: pc
+ 			nextpc: pc + 10
+ 			address: (memoryArray unsignedLong64At: pc + 3)
- 			nextpc: pc + 5
- 			address: (memoryArray unsignedLongAt: pc + 2 bigEndian: false)
  			type: #write
+ 			accessor: #al)
- 			accessor: #eax)
  		signal!

Item was added:
+ ----- Method: BochsX64Alien>>handleMovOvAXFailureAt:in:rex: (in category 'error handling') -----
+ handleMovOvAXFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil "<Integer|nil>"
+ 	"Convert an execution primitive failure for a write of rax into a ProcessorSimulationTrap signal."
+ 	self assert: rexByteOrNil = 16r48.
+ 	^(ProcessorSimulationTrap
+ 			pc: pc
+ 			nextpc: pc + 10
+ 			address: (memoryArray unsignedLong64At: pc + 3)
+ 			type: #write
+ 			accessor: #rax)
+ 		signal!

Item was changed:
  ----- Method: BochsX64Alien>>movALObOpcode (in category 'opcodes') -----
  movALObOpcode
  	"[1] IA-32 Intel® Architecture Software Developer's Manual Volume 2B: Instruction Set Reference, N-Z.
  		table A2, pA7"
+ 	^16rA0!
- 	^16rA1!

Item was added:
+ ----- Method: BochsX64Alien>>movAXOvOpcode (in category 'opcodes') -----
+ movAXOvOpcode
+ 	"[1] IA-32 Intel® Architecture Software Developer's Manual Volume 2B: Instruction Set Reference, N-Z.
+ 		table A2, pA7"
+ 	^16rA1!

Item was changed:
  ----- Method: BochsX64Alien>>movObALOpcode (in category 'opcodes') -----
  movObALOpcode
  	"[1] IA-32 Intel® Architecture Software Developer's Manual Volume 2B: Instruction Set Reference, N-Z.
  		table A2, pA7"
+ 	^16rA2!
- 	^16rA3!

Item was added:
+ ----- Method: BochsX64Alien>>movOvAXOpcode (in category 'opcodes') -----
+ movOvAXOpcode
+ 	"[1] IA-32 Intel® Architecture Software Developer's Manual Volume 2B: Instruction Set Reference, N-Z.
+ 		table A2, pA7"
+ 	^16rA3!



More information about the Vm-dev mailing list