Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1626.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1626 Author: eem Time: 9 January 2016, 12:30:43.60787 pm UUID: 5153564f-5657-42ca-a4c9-84b55b308375 Ancestors: VMMaker.oscog-eem.1625
x64 Cogit: cecaptureCStackPointers cannot assume VarBaseReg is caller-saved and should save and restore it if used.
=============== Diff against VMMaker.oscog-eem.1625 ===============
Item was changed: ----- Method: CogARMCompiler>>maybeEstablishVarBase (in category 'abstract instructions') ----- maybeEstablishVarBase "The receiver has a VarBaseReg; generate the code to set it to its value." + <inline: true> cogit MoveCq: cogit varBaseAddress R: VarBaseReg!
Item was added: + ----- Method: CogARMCompiler>>maybeRestoreVarBase (in category 'abstract instructions') ----- + maybeRestoreVarBase + "The receiver has a VarBaseReg; generate the code to pop its value." + <inline: true> + cogit PopR: VarBaseReg!
Item was added: + ----- Method: CogARMCompiler>>maybeSaveVarBase (in category 'abstract instructions') ----- + maybeSaveVarBase + "The receiver has a VarBaseReg; generate the code to push its value." + <inline: true> + cogit PushR: VarBaseReg!
Item was changed: ----- Method: CogAbstractInstruction>>maybeEstablishVarBase (in category 'abstract instructions') ----- maybeEstablishVarBase + "If the receiver has a VarBaseReg, generate the code to set it to its value. + By default do nothing." + <inline: true>! - "If the receiver has a VarBaseReg, generate the code to set it to its value." - self subclassResponsibility!
Item was added: + ----- Method: CogAbstractInstruction>>maybeRestoreVarBase (in category 'abstract instructions') ----- + maybeRestoreVarBase + "If the receiver has a VarBaseReg, generate the code to pop its value. + By default do nothing." + <inline: true>!
Item was added: + ----- Method: CogAbstractInstruction>>maybeSaveVarBase (in category 'abstract instructions') ----- + maybeSaveVarBase + "If the receiver has a VarBaseReg, generate the code to push its value. + By default do nothing." + <inline: true>!
Item was removed: - ----- Method: CogIA32Compiler>>maybeEstablishVarBase (in category 'abstract instructions') ----- - maybeEstablishVarBase - "The receiver does not have a VarBaseReg; do nothing."!
Item was removed: - ----- Method: CogMIPSELCompiler>>maybeEstablishVarBase (in category 'abstract instructions') ----- - maybeEstablishVarBase - "The receiver has a VarBaseReg; generate the code to set it to its value." - cogit MoveCq: cogit varBaseAddress R: VarBaseReg!
Item was changed: ----- Method: CogX64Compiler>>maybeEstablishVarBase (in category 'abstract instructions') ----- maybeEstablishVarBase "The receiver has a VarBaseReg; generate the code to set it to its value." + <inline: true> cogit MoveCq: cogit varBaseAddress R: VarBaseReg!
Item was added: + ----- Method: CogX64Compiler>>maybeRestoreVarBase (in category 'abstract instructions') ----- + maybeRestoreVarBase + "The receiver has a VarBaseReg; generate the code to pop its value." + <inline: true> + cogit PopR: VarBaseReg!
Item was added: + ----- Method: CogX64Compiler>>maybeSaveVarBase (in category 'abstract instructions') ----- + maybeSaveVarBase + "The receiver has a VarBaseReg; generate the code to push its value." + <inline: true> + cogit PushR: VarBaseReg!
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 + maybeSaveVarBase; + maybeEstablishVarBase. "Must happen first; value may be used in accessing any of the following addresses" - 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]. + backEnd + maybeRestoreVarBase. 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)'!
vm-dev@lists.squeakfoundation.org