[Vm-dev] VM Maker: Cog-eem.244.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 18 19:57:44 UTC 2015
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.244.mcz
==================== Summary ====================
Name: Cog-eem.244
Author: eem
Time: 18 March 2015, 12:57:28.816 pm
UUID: afbfe360-c2dc-4317-a49d-f0dfc0fa1728
Ancestors: Cog-tpr.243
Fix eflags: slip.
Rewrite disassembly decoration on ARM to use direct
memory access instead of running tallies.
=============== Diff against Cog-tpr.243 ===============
Item was changed:
----- Method: CogProcessorAlien>>disassembleNextInstructionIn:for: (in category 'disassembly') -----
disassembleNextInstructionIn: memory for: aSymbolManager "<Cogit|nil>"
| string |
string := self pc < memory size
ifTrue: [(self primitiveDisassembleAt: self pc inMemory: memory) last.]
ifFalse: [^self pc hex, ' : Invalid address'].
^aSymbolManager
ifNil: [string]
+ ifNotNil: [self decorateDisassembly: string for: aSymbolManager fromAddress: self pc]!
- ifNotNil: [self decorateDisassembly: string for: aSymbolManager]!
Item was added:
+ ----- Method: GdbARMAlien>>decorateDisassembly:for:fromAddress: (in category 'disassembly') -----
+ decorateDisassembly: anInstructionString for: aSymbolManager fromAddress: address
+ | word opcode shift mode operand |
+ word := aSymbolManager objectMemory longAt: address.
+ (self instructionIsAnyB: word)
+ ifTrue:
+ [operand := word bitAnd: 16rFFFFFF.
+ (operand anyMask: 16r800000) ifTrue:
+ [operand := operand - 16r1000000].
+ operand := operand * 4 + address + 8]
+ ifFalse:
+ [shift := word >> 7 bitAnd: 16r1F.
+ mode := word >> 25 bitAnd: 7.
+ "CogARMCompiler always uses a 0 shift in the last operand."
+ (mode ~= 1 and: [shift ~= 0]) ifTrue:
+ [^anInstructionString].
+ opcode := word >> 21 bitAnd: 16rF.
+ opcode ~= CogARMCompiler orOpcode ifTrue:
+ [^anInstructionString].
+ operand := aSymbolManager backEnd literalBeforeFollowingAddress: address + 4].
+ "is there an intersting address with this?"
+ ^(aSymbolManager lookupAddress: operand)
+ ifNotNil: [:string| anInstructionString, ' = ', (operand printStringRadix: 16), ' = ', string]
+ ifNil: [anInstructionString, ' = ', (operand printStringRadix: 16)]!
Item was changed:
----- Method: GdbARMAlien>>eflags: (in category 'accessing') -----
eflags: anUnsignedInteger
"set the processor flags from the integer"
+ self nflag: (anUnsignedInteger >> 5 bitAnd: 1).
+ self zflag: (anUnsignedInteger >> 4 bitAnd: 1).
+ self cflag: (anUnsignedInteger >> 3 bitAnd: 1).
+ self vflag: (anUnsignedInteger >> 2 bitAnd: 1).
+ self ifflags: (anUnsignedInteger bitAnd: 3)!
- self nflag: (anUnsignedInteger >> 5 bitOr: 1).
- self zflag: (anUnsignedInteger >> 4 bitOr: 1).
- self cflag: (anUnsignedInteger >> 3 bitOr: 1).
- self vflag: (anUnsignedInteger >> 2 bitOr: 1).
- self ifflags: (anUnsignedInteger bitOr: 3)!
Item was added:
+ ----- Method: GdbARMAlien>>instructionIsAnyB: (in category 'testing') -----
+ instructionIsAnyB: instr
+ "is this any of the B BX BL or BLX <offset> instructions?"
+ ^(instr >> 25 bitAnd: 7) = 5!
More information about the Vm-dev
mailing list