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

commits at source.squeak.org commits at source.squeak.org
Fri Jan 15 21:41:46 UTC 2016


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

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

Name: Cog-eem.315
Author: eem
Time: 15 January 2016, 1:41:32.026381 pm
UUID: 6a9943b5-20b0-4592-a97b-95c5795e20ec
Ancestors: Cog-eem.314

Get rid of the explicit check for the 0fh prefix in the x64 processor alien.

=============== Diff against Cog-eem.314 ===============

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 twoByteEscape				put: #handleTwoByteEscapeFailureAt:in:rex:;
+ 		at: 1 + it operandSizeOverridePrefix	put: #handleOperandSizeOverridePrefixFailureAt: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 + 16rFE				put: #handleGroup4FailureAt:in:rex:; "Table A6 One-Byte and Two-Byte Opcode ModRM Extensions"
  		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>>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 rexByteOrNil offset |
- 	| pc opcode rexByte 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"
+ 			[rexByteOrNil := opcode.
- 			[rexByte := opcode.
  			 opcode := memoryArray byteAt: pc + (offset := 2)].
- 		 opcode ~= 16r0f ifTrue:
- 			[^self
- 				perform: (OpcodeExceptionMap at: opcode + 1)
- 				with: pc
- 				with: memoryArray
- 				with: rexByte].
- 		 opcode := memoryArray byteAt: pc + offset + 1.
  		 ^self
+ 			perform: (OpcodeExceptionMap at: opcode + 1)
+ 			with: pc
+ 			with: memoryArray
+ 			with: rexByteOrNil].
- 				perform: (ExtendedOpcodeExceptionMap at: opcode + 1)
- 				with: pc
- 				with: memoryArray
- 				with: rexByte].
  	^self reportPrimitiveFailure!

Item was added:
+ ----- Method: BochsX64Alien>>handleTwoByteEscapeFailureAt:in:rex: (in category 'error handling') -----
+ handleTwoByteEscapeFailureAt: pc in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil
+ 	"Handle an execution primitive failure for the 0f prefix.  Convert failures into ProcessorSimulationTrap signals."
+ 	"self printIntegerRegistersOn: Transcript"
+ 	"self printRegistersOn: Transcript"
+ 	| opcode offset |
+ 	"assume 0fh opcode or 0fh rex opcode"
+ 	offset := rexByteOrNil ifNil: [1] ifNotNil: [2].
+ 	opcode := memoryArray byteAt: pc + offset + 1.
+ 	 ^self
+ 			perform: (ExtendedOpcodeExceptionMap at: opcode + 1)
+ 			with: pc
+ 			with: memoryArray
+ 			with: rexByteOrNil!

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

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



More information about the Vm-dev mailing list