[Vm-dev] VM Maker: Cog-eem.303.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Dec 4 02:31:47 UTC 2015
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.303.mcz
==================== Summary ====================
Name: Cog-eem.303
Author: eem
Time: 3 December 2015, 6:31:36.683 pm
UUID: 5537c320-9606-4fd8-bc85-d65e39c43650
Ancestors: Cog-eem.302
Execution failure handlers for x64 MovEbGb & MovEvGv.
=============== Diff against Cog-eem.302 ===============
Item was changed:
----- Method: BochsX64Alien>>handleMovEbGbFailureAt:in:rex: (in category 'error handling') -----
handleMovEbGbFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil "<Integer|nil>"
"Convert an execution primitive failure for a byte register write into a ProcessorSimulationTrap signal."
+ | modrmByte offset size |
+ modrmByte := memoryArray byteAt: pc + 3.
+ (modrmByte bitAnd: 16rC0) caseOf: {
+ [16r80 "ModRegRegDisp32"] -> [offset := memoryArray unsignedLongAt: pc + 4 bigEndian: false.
+ size := 7].
+ [16r40 "ModRegRegDisp8"] -> [offset := memoryArray byteAt: pc + 4.
+ offset > 127 ifTrue: [offset := offset - 256].
+ size := 4] }
+ otherwise: [self reportPrimitiveFailure].
+ ^(ProcessorSimulationTrap
+ pc: pc
+ nextpc: pc + size
+ address: (((self perform: (self registerStateGetters at: (modrmByte bitAnd: 7) + ((rexByteOrNil bitAnd: 1) bitShift: 3) + 1))
+ + offset)
+ bitAnd: 16rFFFFFFFFFFFFFFFF)
+ type: #write
+ accessor: (#(al cl dl bl spl bpl sil dil r8l r9l r10l r11l r12l r13l r14l r15l) at: ((modrmByte >> 3 bitAnd: 7) + ((rexByteOrNil bitAnd: 4) bitShift: 1) + 1)))
+ signal!
- | modrmByte |
- self shouldBeImplemented.
- ^(((modrmByte := memoryArray byteAt: pc + 2) bitAnd: 16rC0) = 16r80) "ModRegRegDisp32"
- ifTrue:
- [(ProcessorSimulationTrap
- pc: pc
- nextpc: pc + 6
- address: ((self perform: (#(eax ecx edx ebx esp ebp esi edi) at: (modrmByte bitAnd: 7) + 1))
- + (memoryArray unsignedLongAt: pc + 3 bigEndian: false)
- bitAnd: 16rFFFFFFFF)
- type: #write
- accessor: (#(al cl dl bl ah ch dh bh) at: ((modrmByte >> 3 bitAnd: 7) + 1)))
- signal]
- ifFalse:
- [self reportPrimitiveFailure]!
Item was changed:
----- Method: BochsX64Alien>>handleMovEvGvFailureAt:in:rex: (in category 'error handling') -----
handleMovEvGvFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>" rex: rexByteOrNil "<Integer|nil>"
"Convert an execution primitive failure for a register write into a ProcessorSimulationTrap signal."
| modrmByte getter base offset |
self assert: rexByteOrNil notNil.
modrmByte := memoryArray byteAt: pc + 3.
getter := self registerStateGetters at: ((modrmByte >> 3 bitAnd: 7) + ((rexByteOrNil bitAnd: 4) << 1) + 1).
(modrmByte bitAnd: 16rC7) = 16r5 ifTrue: "ModRegInd & disp32"
[^(ProcessorSimulationTrap
pc: pc
nextpc: pc + 7
address: (memoryArray unsignedLongAt: pc + 4 bigEndian: false)
type: #write
accessor: getter)
signal].
+ (modrmByte bitAnd: 16rC0) = 16r80 ifTrue: "ModRegRegDisp32"
- (modrmByte bitAnd: 16rC0) = 16r80 ifTrue: "ModRegRegDisp8"
[offset := memoryArray longAt: pc + 4 bigEndian: false.
base := self registerStateGetters at: ((modrmByte bitAnd: 7) + ((rexByteOrNil bitAnd: 1) << 3) + 1).
^(ProcessorSimulationTrap
pc: pc
nextpc: pc + 7
address: (self perform: base) + offset
type: #write
accessor: getter)
signal].
+ (modrmByte bitAnd: 16rC0) = 16r40 ifTrue: "ModRegRegDisp8"
+ [offset := memoryArray unsignedByteAt: pc + 4.
+ offset > 127 ifTrue: [offset := offset - 256].
+ base := self registerStateGetters at: ((modrmByte bitAnd: 7) + ((rexByteOrNil bitAnd: 1) << 3) + 1).
+ ^(ProcessorSimulationTrap
+ pc: pc
+ nextpc: pc + 4
+ address: (self perform: base) + offset
+ type: #write
+ accessor: getter)
+ signal].
^self reportPrimitiveFailure!
More information about the Vm-dev
mailing list