[Vm-dev] VM Maker: VMMaker.oscog-eem.2739.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 10 22:39:34 UTC 2020

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.2739
Author: eem
Time: 10 April 2020, 3:39:19.999113 pm
UUID: b15f5d3d-0493-4edc-a9d3-4775bb9a21e5
Ancestors: VMMaker.oscog-eem.2738

Add somecommentary about an important but substle issue with switching to the C stack.
Get the prototype of setInterruptCheckChain: correct.

=============== Diff against VMMaker.oscog-eem.2738 ===============

Item was changed:
  ----- Method: CogAbstractInstruction>>genLoadCStackPointers (in category 'smalltalk calling convention') -----
  	"Load the frame and stack pointer registers with those of the C stack,
  	 effecting a switch to the C stack.  Used when machine code calls into
+ 	 the CoInterpreter run-time (e.g. to invoke interpreter primitives).
+ 	 N.B. CoInterpreter stack layout dictates that the stack pointer should be loaded first.
+ 	 The stack zone is allocated on the C stack before the interpreter runs and hence
+ 	 before CStackPointer and CFramePointer are captured.  So when running in machine
+ 	 code the native stack pointer and frame pointer appear to be on a colder part of the
+ 	 stack to CStackPointer and CFramePointer.  When CStackPointerhas been set and
+ 	 the frame pointer is still in machine code the current frame looks like it has lots of
+ 	 stack.  If the frame pointer was set to CFramePointer before hand then it would
+ 	 be beyond the stack pointer for that one instruction."
- 	 the CoInterpreter run-time (e.g. to invoke interpreter primitives)."
  	cogit MoveAw: cogit cStackPointerAddress R: NativeSPReg.
  	cogit MoveAw: cogit cFramePointerAddress R: FPReg.

Item was changed:
  ----- Method: InterpreterProxy>>setInterruptCheckChain: (in category 'other') -----
  setInterruptCheckChain: aFunction
+ 	<returnTypeC: #'void *'>
- 	<returnTypeC: 'void (*setInterruptCheckChain(void (*aFunction)(void)))()'>
  	<var: #aFunction declareC: 'void (*aFunction)()'>
  	^self notYetImplementedError!

Item was changed:
  ----- Method: StackInterpreter>>setInterruptCheckChain: (in category 'primitive support') -----
  setInterruptCheckChain: aFunction
+ 	<returnTypeC: #'void *'>
  	<var: #aFunction declareC: 'void (*aFunction)()'>
  	<var: #prevFunction declareC: 'void (*prevFunction)()'>
- 	<returnTypeC: 'void (*setInterruptCheckChain(void (*aFunction)(void)))()'>
  	<export: true>
  	| prevFunction |
  	prevFunction := interruptCheckChain.
  	interruptCheckChain := aFunction.

More information about the Vm-dev mailing list