[Vm-dev] VM Maker: Cog-lw.60.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Feb 1 23:07:37 UTC 2013
Lars Wassermann uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-lw.60.mcz
==================== Summary ====================
Name: Cog-lw.60
Author: lw
Time: 2 February 2013, 12:07:28.211 am
UUID: 826fc17b-8f27-5b40-8103-3e2a690b49cb
Ancestors: Cog-eem.59
Implemented Simulation frame building as hinted in Eliots Email 'Changing CogSimulator abi'
=============== Diff against Cog-eem.59 ===============
Item was added:
+ ----- Method: GdbARMAlien>>pushWord:in: (in category 'execution') -----
+ pushWord: aValue in: aMemory
+ aMemory longAt: (self sp: self sp - 4) + 1 put: aValue bigEndian: false!
Item was changed:
----- Method: GdbARMAlien>>simulateCallOf:nextpc:memory: (in category 'execution simulation') -----
simulateCallOf: address nextpc: nextpc memory: aMemory
"Simulate a frame-building call of address. Build a frame since
+ a) this is used for calls into the run-time which are unlikely to be leaf-calls"
+ "This method builds a stack frame as expected by the simulator, not as defined by ARM aapcs-abi.
+ In ARM aapcs, every method can define for itself, wether it wants to push lr (nextpc), and wether it
+ uses a frame pointer. The standard never mentions a fp. It merely defines r4-r11 to be callee-saved."
+
+ self assert: self sp \\ 8 = 0. "This check ensures, that we conform with ARM abi. Before doing anything to the stack, we ensure 2-word alignment."
+ self pushWord: nextpc in: aMemory.
+ self pushWord: self r11 in: aMemory.
+ self r11: self sp.
+ PostBuildStackDelta ~= 0 ifTrue:
+ [self sp: self sp - PostBuildStackDelta]. "In order to satisfy the CStackAlignment check by cogit, which is only valid on IA32 platforms."
- a) this is used for calls into the run-time which are unlikely to be leaf-calls, and
- b) stack alignment needs to be realistic for assert checking for platforms such as Mac OS X"
- self lr: nextpc.
self pc: address!
Item was changed:
+ ----- Method: GdbARMAlien>>simulateLeafCallOf:nextpc:memory: (in category 'execution simulation') -----
- ----- Method: GdbARMAlien>>simulateLeafCallOf:nextpc:memory: (in category 'execution') -----
simulateLeafCallOf: address nextpc: nextpc memory: aMemory
self lr: nextpc.
self pc: address!
Item was added:
+ ----- Method: GdbARMAlien>>simulateLeafReturnIn: (in category 'execution simulation') -----
+ simulateLeafReturnIn: aMemory
+ self pc: self lr!
Item was added:
+ ----- Method: GdbARMAlien>>simulateReturnIn: (in category 'execution simulation') -----
+ simulateReturnIn: aMemory
+ PostBuildStackDelta ~= 0 ifTrue:
+ [self sp: self sp + PostBuildStackDelta].
+ self r11: (self popWordIn: aMemory).
+ self pc: (self popWordIn: aMemory)!
More information about the Vm-dev
mailing list