VM Maker: Cog-eem.341.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: Cog-eem.341.mcz

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

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

Name: Cog-eem.341
Author: eem
Time: 27 May 2017, 9:04:01.560953 am
UUID: 836fa317-d240-4e50-aa33-c8d7c87e4ba8
Ancestors: Cog-eem.340

Provide support for smashing the shadow parameter space by refactoring smashCallerSavedRegistersWithValuesFrom:by: to smashCallerSavedRegistersWithValuesFrom:by:in:.  For VMMaker.oscog-eem.2223 and subsequent.

Have BochsX64Alien save the argument registers to the shadow parameter space when smashing registers.  Breaks simulation in a similar place to the real system (earlier, probably because this always saves all four regsiters, whereas real code probably only saves as many registers as there are parameters, and doesn't always save them).

=============== Diff against Cog-eem.340 ===============

Item was removed:
- ----- Method: BochsIA32Alien>>smashCallerSavedRegistersWithValuesFrom:by: (in category 'accessing-abstract') -----
- smashCallerSavedRegistersWithValuesFrom: base by: step
- #(eax: ecx: edx:)
-   withIndexDo:
- [:accessor :index|
- self perform: accessor with: index - 1 * step + base]!

Item was added:
+ ----- Method: BochsIA32Alien>>smashCallerSavedRegistersWithValuesFrom:by:in: (in category 'accessing-abstract') -----
+ smashCallerSavedRegistersWithValuesFrom: base by: step in: aMemory
+ #(eax: ecx: edx:)
+   withIndexDo:
+ [:accessor :index|
+ self perform: accessor with: index - 1 * step + base]!

Item was removed:
- ----- Method: BochsX64Alien>>smashCallerSavedRegistersWithValuesFrom:by: (in category 'accessing-abstract') -----
- smashCallerSavedRegistersWithValuesFrom: base by: step
- (CogX64Compiler isSysV
- ifTrue: [#(rax: rcx: rdx: rsi: rdi: r8: r9: r10: r11:)]
- ifFalse: [#(rax: rcx: rdx: r8: r9: r10: r11:)])
-   withIndexDo:
- [:accessor :index|
- self perform: accessor with: index - 1 * step + base]!

Item was added:
+ ----- Method: BochsX64Alien>>smashCallerSavedRegistersWithValuesFrom:by:in: (in category 'accessing-abstract') -----
+ smashCallerSavedRegistersWithValuesFrom: base by: step in: aMemory
+ | volatileRegisters |
+ CogX64Compiler isSysV
+ ifTrue:
+ [volatileRegisters := #(rax: rcx: rdx: rsi: rdi: r8: r9: r10: r11:)]
+ ifFalse: "We should also save the registers to the shadow parameter space."
+ [volatileRegisters := #(rax: rcx: rdx: r8: r9: r10: r11:).
+ #(rcx rdx r8 r9) withIndexDo:
+ [:getter :index|
+ aMemory
+ unsignedLong64At: self rbp + 8 + (index * 8) "skip saved fp and retpc"
+ put: (self perform: getter)]].
+ volatileRegisters withIndexDo:
+ [:setter :index|
+ self perform: setter with: index - 1 * step + base]!

Item was removed:
- ----- Method: GdbARMAlien>>smashCallerSavedRegistersWithValuesFrom:by: (in category 'accessing-abstract') -----
- smashCallerSavedRegistersWithValuesFrom: base by: step
- #(r0: r1: r2: r3: r9: r12: lr:) withIndexDo:
- [:accessor :index|
- self perform: accessor with: index - 1 * step + base]!

Item was added:
+ ----- Method: GdbARMAlien>>smashCallerSavedRegistersWithValuesFrom:by:in: (in category 'accessing-abstract') -----
+ smashCallerSavedRegistersWithValuesFrom: base by: step in: aMemory
+ #(r0: r1: r2: r3: r9: r12: lr:) withIndexDo:
+ [:accessor :index|
+ self perform: accessor with: index - 1 * step + base]!

Item was removed:
- ----- Method: MIPSSimulator>>smashCallerSavedRegistersWithValuesFrom:by: (in category 'processor api') -----
- smashCallerSavedRegistersWithValuesFrom: base by: step
- "i.e., smashVolatileRegisters"
- self flag: #OABI.
- self unsignedRegister: AT put: 0 * step + base.
- self unsignedRegister: V0 put: 0 * step + base.
- self unsignedRegister: V1 put: 0 * step + base.
- self unsignedRegister: A0 put: 0 * step + base.
- self unsignedRegister: A1 put: 0 * step + base.
- self unsignedRegister: A2 put: 0 * step + base.
- self unsignedRegister: A3 put: 0 * step + base.
- self unsignedRegister: T0 put: 0 * step + base.
- self unsignedRegister: T1 put: 0 * step + base.
- self unsignedRegister: T2 put: 0 * step + base.
- self unsignedRegister: T3 put: 0 * step + base.
- self unsignedRegister: T4 put: 0 * step + base.
- self unsignedRegister: T5 put: 0 * step + base.
- self unsignedRegister: T6 put: 0 * step + base.
- self unsignedRegister: T7 put: 0 * step + base.
- self unsignedRegister: T8 put: 0 * step + base.
- self unsignedRegister: T9 put: 0 * step + base.
- self unsignedRegister: GP put: 0 * step + base.
- self unsignedRegister: RA put: 0 * step + base.!

Item was added:
+ ----- Method: MIPSSimulator>>smashCallerSavedRegistersWithValuesFrom:by:in: (in category 'processor api') -----
+ smashCallerSavedRegistersWithValuesFrom: base by: step in: aMemory
+ "i.e., smashVolatileRegisters"
+ self flag: #OABI.
+ self unsignedRegister: AT put: 0 * step + base.
+ self unsignedRegister: V0 put: 1 * step + base.
+ self unsignedRegister: V1 put: 2 * step + base.
+ self unsignedRegister: A0 put: 3 * step + base.
+ self unsignedRegister: A1 put: 4 * step + base.
+ self unsignedRegister: A2 put: 5 * step + base.
+ self unsignedRegister: A3 put: 6 * step + base.
+ self unsignedRegister: T0 put: 7 * step + base.
+ self unsignedRegister: T1 put: 8 * step + base.
+ self unsignedRegister: T2 put: 9 * step + base.
+ self unsignedRegister: T3 put: 10 * step + base.
+ self unsignedRegister: T4 put: 11 * step + base.
+ self unsignedRegister: T5 put: 12 * step + base.
+ self unsignedRegister: T6 put: 13 * step + base.
+ self unsignedRegister: T7 put: 14 * step + base.
+ self unsignedRegister: T8 put: 15 * step + base.
+ self unsignedRegister: T9 put: 16 * step + base.
+ self unsignedRegister: GP put: 17 * step + base.
+ self unsignedRegister: RA put: 18 * step + base!