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

commits at source.squeak.org commits at source.squeak.org
Wed Sep 23 00:21:56 UTC 2015


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

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

Name: Cog-eem.282
Author: eem
Time: 22 September 2015, 5:21:18.501 pm
UUID: 05f4a99d-27aa-4d14-96bb-87af8b48047c
Ancestors: Cog-eem.281

Implement some of the failure handling in the BochsX64Alien.

=============== Diff against Cog-eem.281 ===============

Item was added:
+ ----- Method: BochsX64Alien class>>initialize (in category 'class initialization') -----
+ initialize
+ 	"BochsX64Alien initialize"
+ 	| it |
+ 	it := self basicNew.
+ 	PostBuildStackDelta := 0.
+ 	OpcodeExceptionMap := Array new: 256 withAll: #handleExecutionPrimitiveFailureAt:in:.
+ 	OpcodeExceptionMap
+ 		at: 1 + it callOpcode			put: #handleCallFailureAt:in:;
+ 		at: 1 + it jmpOpcode			put: #handleJmpFailureAt:in:;
+ 		at: 1 + it retOpcode			put: #handleRetFailureAt:in:;
+ 		at: 1 + it movALObOpcode	put: #handleMovALObFailureAt:in:;
+ 		at: 1 + it movObALOpcode	put: #handleMovObALFailureAt:in:;
+ 		at: 1 + it movGvEvOpcode	put: #handleMovGvEvFailureAt:in:;
+ 		at: 1 + it movEvGvOpcode	put: #handleMovEvGvFailureAt:in:;
+ 		at: 1 + it movGbEbOpcode	put: #handleMovGbEbFailureAt:in:;
+ 		at: 1 + it movEbGbOpcode	put: #handleMovEbGbFailureAt:in:.
+ 	ExtendedOpcodeExceptionMap := Array new: 256 withAll: #handleExecutionPrimitiveFailureAt:in:.
+ 	ExtendedOpcodeExceptionMap
+ 		at: 1 + it movGvEbOpcode put: #handleMovGvEbFailureAt:in:!

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

Item was added:
+ ----- Method: BochsX64Alien>>handleExecutionPrimitiveFailureAt:in: (in category 'error handling') -----
+ handleExecutionPrimitiveFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>"
+ 	"Handle an execution primitive failure for an unhandled opcode."
+ 	^self reportPrimitiveFailure!

Item was added:
+ ----- Method: BochsX64Alien>>handleExecutionPrimitiveFailureIn:minimumAddress: (in category 'error handling') -----
+ handleExecutionPrimitiveFailureIn: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress
+ 	"Handle an execution primitive failure.  Convert out-of-range call and absolute
+ 	 memory read into register instructions into ProcessorSimulationTrap signals."
+ 	"self printIntegerRegistersOn: Transcript"
+ 	"self printRegistersOn: Transcript"
+ 	| pc opcode offset |
+ 	((pc := self rip) between: minimumAddress and: memoryArray byteSize - 1) ifTrue:
+ 		[opcode := memoryArray byteAt: pc + (offset := 1).
+ 		 (opcode bitAnd: 16rF8) = self rexPrefix ifTrue: "skip rex prefix if present"
+ 			[opcode := memoryArray byteAt: pc + (offset := 2)].
+ 		 opcode ~= 16r0f ifTrue:
+ 			[^self
+ 				perform: (OpcodeExceptionMap at: opcode + 1)
+ 				with: pc
+ 				with: memoryArray].
+ 		 opcode := memoryArray byteAt: pc + offset + 1.
+ 		 ^self
+ 				perform: (ExtendedOpcodeExceptionMap at: opcode + 1)
+ 				with: pc
+ 				with: memoryArray].
+ 	^self reportPrimitiveFailure!

Item was added:
+ ----- Method: BochsX64Alien>>integerRegisterState (in category 'accessing-abstract') -----
+ integerRegisterState
+ 	^{	self rax. self rbx. self rcx. self rdx. self rsp. self rbp. self rsi. self rdi.
+ 		self r8. self r9. self r10. self r11. self r12. self r13. self r14. self r15.
+ 		self rip. self rflags }!

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

Item was added:
+ ----- Method: BochsX64Alien>>lockPrefix (in category 'opcodes') -----
+ lockPrefix
+ 	^16rF0!

Item was added:
+ ----- 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"
+ 	^16rA1!

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

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

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

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

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

Item was added:
+ ----- 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"
+ 	^16rA3!

Item was added:
+ ----- Method: BochsX64Alien>>nopOpcode (in category 'opcodes') -----
+ nopOpcode
+ 	^16r90!

Item was added:
+ ----- Method: BochsX64Alien>>printIntegerRegistersOn: (in category 'printing') -----
+ printIntegerRegistersOn: aStream
+ 	self printRegisterState: self integerRegisterState on: aStream.
+ 	aStream flush!

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

Item was added:
+ ----- Method: BochsX64Alien>>rexPrefix (in category 'opcodes') -----
+ rexPrefix
+ 	^16r48!



More information about the Vm-dev mailing list