[Vm-dev] VM Maker: VMMaker.oscog-eem.1607.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Dec 17 08:21:36 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1607.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1607
Author: eem
Time: 17 December 2015, 12:19:52.584 am
UUID: 5f0a0a13-5e92-417b-8351-729d7cf5aead
Ancestors: VMMaker.oscog-eem.1606
Cogit: generateCaptureCStackPointers: must establish the VarBaseReg before accessing any of the stack pointer variables.
=============== Diff against VMMaker.oscog-eem.1606 ===============
Item was changed:
----- Method: Cogit>>generateCaptureCStackPointers: (in category 'initialization') -----
generateCaptureCStackPointers: captureFramePointer
"Generate the routine that writes the current values of the C frame and stack pointers into
variables. These are used to establish the C stack in trampolines back into the C run-time.
This is a presumptuous quick hack for x86. It is presumptuous for two reasons. Firstly
the system's frame and stack pointers may differ from those we use in generated code,
e.g. on register-rich RISCs. Secondly the ABI may not support a simple frameless call
as written here (for example 128-bit stack alignment on Mac OS X)."
| startAddress |
<inline: false>
self allocateOpcodes: 32 bytecodes: 0.
startAddress := methodZoneBase.
+ backEnd maybeEstablishVarBase. "Must happen first; value may be used in accessing any of the following addresses"
captureFramePointer ifTrue:
[self MoveR: FPReg Aw: self cFramePointerAddress].
"Capture the stack pointer prior to the call."
backEnd leafCallStackPointerDelta = 0
ifTrue: [self MoveR: SPReg Aw: self cStackPointerAddress]
ifFalse: [self MoveR: SPReg R: TempReg.
self AddCq: backEnd leafCallStackPointerDelta R: TempReg.
self MoveR: TempReg Aw: self cStackPointerAddress].
self RetN: 0.
self outputInstructionsForGeneratedRuntimeAt: startAddress.
processor flushICacheFrom: startAddress asUnsignedInteger to: methodZoneBase asUnsignedInteger.
self recordGeneratedRunTime: 'ceCaptureCStackPointers' address: startAddress.
ceCaptureCStackPointers := self cCoerceSimple: startAddress to: #'void (*)(void)'!
More information about the Vm-dev
mailing list