[Vm-dev] VM Maker: Cog-tpr.245.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 18 16:33:11 UTC 2015
tim Rowledge uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-tpr.245.mcz
==================== Summary ====================
Name: Cog-tpr.245
Author: tpr
Time: 18 March 2015, 9:32:59.184 am
UUID: 7ecef6f2-5737-4d9a-8706-b6c86acd8900
Ancestors: Cog-tpr.244
Repeated save due to &%^$% nonsense.
Fix decoration when using the terribly long-winded mov/orr/orr/orr pattern to build a long constant
=============== Diff against Cog-tpr.243 ===============
Item was changed:
----- Method: GdbARMAlien>>decorateDisassembly:for: (in category 'disassembly') -----
decorateDisassembly: anInstructionString for: aSymbolManager
| parts strm hexNum string |
"break up the string"
parts:= anInstructionString subStrings: ' ,:'.
"part 1 is the address, part 2 is the instruction. Last part is sometimes a hex number"
"is this a mov of a literal number?"
((parts at: 2) includesSubString: 'mov')
ifTrue:[
"clear the flags & running total"
LongConstReg := nil.
LongConstValue := 0.
LongConstStep := 0.
(parts at:4) first = $#
ifTrue:["looks a good candidate"
LongConstReg :=(parts at: 3). "the target register"
(parts last beginsWith: '0x') ifTrue:[
LongConstValue :=(NumberParser on: (parts last allButFirst:2)) nextUnsignedIntegerBase: 16].
LongConstStep := 1].
"not a likely candidate, just return the string"
^anInstructionString].
"is this a build of a literal number?"
(((parts at: 2) includesSubString: 'orr') and:[LongConstStep >0])
ifTrue:["add to running total if the register matches"
LongConstReg = (parts at: 3)
ifTrue:[
(parts at:5) first = $#
+ ifTrue:["looks a good candidate with the # indicating a const"
+ LongConstValue := LongConstValue + ((NumberParser on: (parts at:5) allButFirst) nextUnsignedIntegerBase: 10) .
- ifTrue:["looks a good candidate"
- (parts last beginsWith: '0x') ifTrue:[
- LongConstValue := LongConstValue + ((NumberParser on: (parts last allButFirst:2)) nextUnsignedIntegerBase: 16) ].
LongConstStep:= LongConstStep +1].
LongConstStep = 4
ifTrue:["we've completed a pattern of mov/orr/orr/orr, so print the value it built"
^anInstructionString, ' (', LongConstReg , ' = ', LongConstValue hex8, ((aSymbolManager lookupAddress: LongConstValue) ifNil: [''] ifNotNil:[:val| ' = ', val]), ')']]
ifFalse:[ LongConstStep := 0.
LongConstReg := nil.
LongConstValue := 0].
"either not a likely candidate orpartway through the pattern, so just return the string"
^anInstructionString].
strm :=anInstructionString readStream.
strm skip: 9. "the instruction address"
strm upToAll: '0x'. "see if there is a hex number"
strm atEnd ifTrue:[^anInstructionString]. "if not, leave it be"
"extract the number"
hexNum := (NumberParser on: strm) nextUnsignedIntegerBase: 16.
"is there an intersting address with this?"
(string := aSymbolManager lookupAddress: hexNum) ifNil: [^anInstructionString].
^ anInstructionString, ' = ', string!
More information about the Vm-dev
mailing list