VM Maker: VMMaker.oscog-eem.2228.mcz

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

VM Maker: VMMaker.oscog-eem.2228.mcz

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

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

Name: VMMaker.oscog-eem.2228
Author: eem
Time: 30 May 2017, 10:36:59.18841 am
UUID: 80a3d07d-f055-4eaf-992c-3e532eb50fb8
Ancestors: VMMaker.oscog-eem.2227

Implement shadow parameter space in the Win64 FFI plugin by always incrememting currentArg, even if passed in a register.  Consequently eliminate the abstract superclasses for the X64 ABI; they no longer share more than a method or two.

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

Item was removed:
- ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForX64
- instanceVariableNames: 'integerRegisterIndex floatRegisterIndex integerRegisters floatRegisters'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'VMMaker-Plugins-FFI'!
-
- !ThreadedFFICalloutStateForX64 commentStamp: 'eem 2/16/2016 19:13' prior: 0!
- A ThreadedFFICalloutStateForX64 is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system.!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64 class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') -----
- instVarNamesAndTypesForTranslationDo: aBinaryBlock
- "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a ThreadedFFICalloutState struct."
-
- ThreadedFFICalloutState instVarNamesAndTypesForTranslationDo: aBinaryBlock.
- ThreadedFFICalloutStateForX64 instVarNames do:
- [:ivn|
- aBinaryBlock
- value: ivn
- value: (ivn caseOf: {
- ['integerRegisters'] -> [{#sqInt. '[NumIntRegArgs]'}].
- ['floatRegisters'] -> [{#double. '[NumFloatRegArgs]'}] }
- otherwise:
- [#sqInt])]!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64 class>>pluginClass (in category 'translation') -----
- pluginClass
- ^self subclassResponsibility!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>floatRegisterIndex (in category 'accessing') -----
- floatRegisterIndex
-
- ^ floatRegisterIndex!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>floatRegisters (in category 'accessing') -----
- floatRegisters
- "Answer the value of floatRegisters"
-
- ^ floatRegisters!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>incrementFloatRegisterIndex (in category 'accessing') -----
- incrementFloatRegisterIndex
- ^floatRegisterIndex := floatRegisterIndex + 1!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>incrementIntegerRegisterIndex (in category 'accessing') -----
- incrementIntegerRegisterIndex
- ^integerRegisterIndex := integerRegisterIndex + 1!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>initialize (in category 'initialize-release') -----
- initialize
- super initialize.
- integerRegisterIndex := floatRegisterIndex := 0.
- integerRegisters := CArrayAccessor on: (Array new: self class pluginClass numRegArgs).
- floatRegisters := CArrayAccessor on: (Array new: self class pluginClass numFloatRegArgs)!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>integerRegisterIndex (in category 'accessing') -----
- integerRegisterIndex
-
- ^ integerRegisterIndex!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>integerRegisters (in category 'accessing') -----
- integerRegisters
- "Answer the value of integerRegisters"
-
- ^ integerRegisters!

Item was changed:
+ ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForX64SysV
+ instanceVariableNames: 'integerRegisterIndex floatRegisterIndex integerRegisters floatRegisters'
- ThreadedFFICalloutStateForX64 subclass: #ThreadedFFICalloutStateForX64SysV
- instanceVariableNames: ''
  classVariableNames: ''
  poolDictionaries: ''
  category: 'VMMaker-Plugins-FFI'!
+
+ !ThreadedFFICalloutStateForX64SysV commentStamp: 'eem 5/30/2017 10:22' prior: 0!
+ A ThreadedFFICalloutStateForX64SysV is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system using the System V ABI.!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') -----
+ instVarNamesAndTypesForTranslationDo: aBinaryBlock
+ "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a ThreadedFFICalloutState struct."
+
+ ThreadedFFICalloutState instVarNamesAndTypesForTranslationDo: aBinaryBlock.
+ self instVarNames do:
+ [:ivn|
+ aBinaryBlock
+ value: ivn
+ value: (ivn caseOf: {
+ ['integerRegisters'] -> [{#sqInt. '[NumIntRegArgs]'}].
+ ['floatRegisters'] -> [{#double. '[NumFloatRegArgs]'}] }
+ otherwise:
+ [#char])]!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>floatRegisterIndex (in category 'accessing') -----
+ floatRegisterIndex
+
+ ^ floatRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>floatRegisters (in category 'accessing') -----
+ floatRegisters
+ "Answer the value of floatRegisters"
+
+ ^ floatRegisters!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>incrementFloatRegisterIndex (in category 'accessing') -----
+ incrementFloatRegisterIndex
+ ^floatRegisterIndex := floatRegisterIndex + 1!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>incrementIntegerRegisterIndex (in category 'accessing') -----
+ incrementIntegerRegisterIndex
+ ^integerRegisterIndex := integerRegisterIndex + 1!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>initialize (in category 'initialize-release') -----
+ initialize
+ super initialize.
+ integerRegisterIndex := floatRegisterIndex := 0.
+ integerRegisters := CArrayAccessor on: (Array new: ThreadedX64SysVFFIPlugin numRegArgs).
+ floatRegisters := CArrayAccessor on: (Array new: ThreadedX64SysVFFIPlugin numFloatRegArgs)!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>integerRegisterIndex (in category 'accessing') -----
+ integerRegisterIndex
+
+ ^ integerRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>integerRegisters (in category 'accessing') -----
+ integerRegisters
+ "Answer the value of integerRegisters"
+
+ ^ integerRegisters!

Item was changed:
+ ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForX64Win64
+ instanceVariableNames: 'integerRegisterIndex floatRegisterIndex floatRegisterSignature integerRegisters floatRegisters'
- ThreadedFFICalloutStateForX64 subclass: #ThreadedFFICalloutStateForX64Win64
- instanceVariableNames: 'floatRegisterSignature'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'VMMaker-Plugins-FFI'!
+
+ !ThreadedFFICalloutStateForX64Win64 commentStamp: 'eem 5/30/2017 10:22' prior: 0!
+ A ThreadedFFICalloutStateForX64Win64 is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system using the _WIN64 ABI.!

Item was changed:
  ----- Method: ThreadedFFICalloutStateForX64Win64 class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') -----
  instVarNamesAndTypesForTranslationDo: aBinaryBlock
  "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a ThreadedFFICalloutState struct."
 
+ ThreadedFFICalloutState instVarNamesAndTypesForTranslationDo: aBinaryBlock.
+ self instVarNames do:
- ThreadedFFICalloutStateForX64 instVarNamesAndTypesForTranslationDo: aBinaryBlock.
- ThreadedFFICalloutStateForX64Win64 instVarNames do:
  [:ivn|
  aBinaryBlock
  value: ivn
  value: (ivn caseOf: {
+ ['integerRegisters'] -> [{#sqInt. '[NumIntRegArgs]'}].
+ ['floatRegisters'] -> [{#double. '[NumFloatRegArgs]'}] }
- ['floatRegisterSignature'] -> [#int] }
  otherwise:
+ [#char])]!
- [#sqInt])]!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>floatRegisterIndex (in category 'accessing') -----
+ floatRegisterIndex
+
+ ^ floatRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>floatRegisters (in category 'accessing') -----
+ floatRegisters
+ "Answer the value of floatRegisters"
+
+ ^ floatRegisters!

Item was changed:
  ----- Method: ThreadedFFICalloutStateForX64Win64>>initialize (in category 'initialize-release') -----
  initialize
  super initialize.
+ integerRegisterIndex := floatRegisterIndex := floatRegisterSignature := 0.
+ integerRegisters := CArrayAccessor on: (Array new: ThreadedX64Win64FFIPlugin numRegArgs).
+ floatRegisters := CArrayAccessor on: (Array new: ThreadedX64Win64FFIPlugin numFloatRegArgs)!
- floatRegisterSignature := 0.!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>integerRegisterIndex (in category 'accessing') -----
+ integerRegisterIndex
+
+ ^ integerRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>integerRegisters (in category 'accessing') -----
+ integerRegisters
+ "Answer the value of integerRegisters"
+
+ ^ integerRegisters!

Item was removed:
- ThreadedFFIPlugin subclass: #ThreadedX64FFIPlugin
- instanceVariableNames: ''
- classVariableNames: 'NumFloatRegArgs NumIntRegArgs WordSize'
- poolDictionaries: ''
- category: 'VMMaker-Plugins-FFI'!
-
- !ThreadedX64FFIPlugin commentStamp: 'eem 2/19/2016 15:03' prior: 0!
- This is an abstract superclass for the System V and WIN64 x86-64 ABIs that share a lot of code other than for structure passing.!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>calloutStateClass (in category 'translation') -----
- calloutStateClass
- ^ThreadedFFICalloutStateForX64!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
- identifyingPredefinedMacros
- "Answer the predefined macros that identify the platforms a subclass handles, if any.
- If the subclass isn't yet ready for production (a work in progress) simply answer nil.
- Override to filter-out this abstract class."
- ^nil!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>initialize (in category 'class initialization') -----
- initialize
- WordSize := 8.
- NumIntRegArgs := 6.
- NumFloatRegArgs := 8!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>moduleName (in category 'translation') -----
- moduleName
- ^'X64SysVFFIPlugin'!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>numFloatRegArgs (in category 'accessing') -----
- numFloatRegArgs
- ^NumFloatRegArgs!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>numRegArgs (in category 'accessing') -----
- numRegArgs
- ^NumIntRegArgs!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
- ffiPushDoubleFloat: value in: calloutState
- <var: #value type: #double>
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
-
- calloutState floatRegisterIndex < NumFloatRegArgs
- ifTrue:
- [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
- calloutState incrementFloatRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
- ffiPushPointer: pointer in: calloutState
- <var: #pointer type: #'void *'>
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer asInteger.
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: pointer.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedByte:in: (in category 'marshalling') -----
- ffiPushSignedByte: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedChar:in: (in category 'marshalling') -----
- ffiPushSignedChar: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedInt:in: (in category 'marshalling') -----
- ffiPushSignedInt: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: value.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0
- !

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
- ffiPushSignedLongLong: value in: calloutState
- <var: #value type: #sqLong>
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: value.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedShort:in: (in category 'marshalling') -----
- ffiPushSignedShort: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed short').
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed short').
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
- ffiPushSingleFloat: value in: calloutState
- <var: #value type: #float>
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
-
- calloutState floatRegisterIndex < NumFloatRegArgs
- ifTrue:
- [(self cCoerce: calloutState floatRegisters + calloutState floatRegisterIndex to: #'float *') at: 0 put: value.
- calloutState incrementFloatRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushStructure:ofSize:typeSpec:ofLength:in: (in category 'marshalling') -----
- ffiPushStructure: pointer ofSize: structSize typeSpec: argSpec ofLength: argSpecSize in: calloutState
- <var: #pointer type: #'void *'>
- <var: #argSpec type: #'sqInt *'>
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- self subclassResponsibility!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedByte:in: (in category 'marshalling') -----
- ffiPushUnsignedByte: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0
- !

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedChar:in: (in category 'marshalling') -----
- ffiPushUnsignedChar: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedInt:in: (in category 'marshalling') -----
- ffiPushUnsignedInt: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: value.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0
-
- !

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
- ffiPushUnsignedLongLong: value in: calloutState
- <var: #value type: #usqLong>
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: value.
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedShort:in: (in category 'marshalling') -----
- ffiPushUnsignedShort: value in: calloutState
- <var: #calloutState type: #'CalloutState *'>
- <inline: true>
- calloutState integerRegisterIndex < NumIntRegArgs
- ifTrue:
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned short').
- calloutState incrementIntegerRegisterIndex]
- ifFalse:
- [calloutState currentArg + WordSize > calloutState limit ifTrue:
- [^FFIErrorCallFrameTooBig].
- interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned short').
- calloutState currentArg: calloutState currentArg + WordSize].
- ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>returnStructInRegisters: (in category 'marshalling') -----
- returnStructInRegisters: returnStructSize
- "Answer if a struct result of a given size is returned in memory or not."
- self subclassResponsibility!

Item was changed:
+ ThreadedFFIPlugin subclass: #ThreadedX64SysVFFIPlugin
- ThreadedX64FFIPlugin subclass: #ThreadedX64SysVFFIPlugin
  instanceVariableNames: ''
+ classVariableNames: 'NumFloatRegArgs NumIntRegArgs WordSize'
- classVariableNames: ''
  poolDictionaries: ''
  category: 'VMMaker-Plugins-FFI'!
 
  !ThreadedX64SysVFFIPlugin commentStamp: 'eem 2/17/2016 20:03' prior: 0!
  This subclass is for the System V x86-64 ABI.  The System V ABI uses 6 integer registers and 8 double-precision floating-point registers.  See http://www.x86-64.org/documentation/abi.pdf.  It seems that Mac OS X and linux use draft version 0.90, http://people.freebsd.org/~obrien/amd64-elf-abi.pdf.
 
  Note that the System V x86-64 ABI decomposes structs of 2 eightbytes or smaller passed by value across available parameter registers.  double fields will be passed in an xmm register.!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin class>>calloutStateClass (in category 'translation') -----
+ calloutStateClass
+ ^ThreadedFFICalloutStateForX64SysV!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
+ ffiPushDoubleFloat: value in: calloutState
+ <var: #value type: #double>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+
+ calloutState floatRegisterIndex < NumFloatRegArgs
+ ifTrue:
+ [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
+ calloutState incrementFloatRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
+ ffiPushPointer: pointer in: calloutState
+ <var: #pointer type: #'void *'>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer asInteger.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: pointer.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedByte:in: (in category 'marshalling') -----
+ ffiPushSignedByte: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedChar:in: (in category 'marshalling') -----
+ ffiPushSignedChar: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedInt:in: (in category 'marshalling') -----
+ ffiPushSignedInt: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0
+ !

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
+ ffiPushSignedLongLong: value in: calloutState
+ <var: #value type: #sqLong>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedShort:in: (in category 'marshalling') -----
+ ffiPushSignedShort: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed short').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed short').
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
+ ffiPushSingleFloat: value in: calloutState
+ <var: #value type: #float>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+
+ calloutState floatRegisterIndex < NumFloatRegArgs
+ ifTrue:
+ [(self cCoerce: calloutState floatRegisters + calloutState floatRegisterIndex to: #'float *') at: 0 put: value.
+ calloutState incrementFloatRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedByte:in: (in category 'marshalling') -----
+ ffiPushUnsignedByte: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0
+ !

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedChar:in: (in category 'marshalling') -----
+ ffiPushUnsignedChar: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedInt:in: (in category 'marshalling') -----
+ ffiPushUnsignedInt: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0
+
+ !

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
+ ffiPushUnsignedLongLong: value in: calloutState
+ <var: #value type: #usqLong>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedShort:in: (in category 'marshalling') -----
+ ffiPushUnsignedShort: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned short').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned short').
+ calloutState currentArg: calloutState currentArg + WordSize].
+ ^0!

Item was changed:
+ ThreadedFFIPlugin subclass: #ThreadedX64Win64FFIPlugin
- ThreadedX64FFIPlugin subclass: #ThreadedX64Win64FFIPlugin
  instanceVariableNames: ''
+ classVariableNames: 'NumFloatRegArgs NumIntRegArgs WordSize'
- classVariableNames: ''
  poolDictionaries: ''
  category: 'VMMaker-Plugins-FFI'!
 
  !ThreadedX64Win64FFIPlugin commentStamp: 'nice 8/10/2016 19:23' prior: 0!
  This subclass is for the Win64 x86-64 ABI.  The Win64 ABI uses 4 integer registers or 4 double-precision floating-point registers or a mix of the two.  See w.g. https://msdn.microsoft.com/en-us/library/ms235286.aspx, or google for "Overview of x64 Calling Conventions - MSDN - Microsoft".
 
  Note that unlike the System V x86-64 ABI, the Win64 ABI does /not/ decompose structs passed by value across available parameter registers.!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
+ ffiPushDoubleFloat: value in: calloutState
+ <var: #value type: #double>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+
+ calloutState floatRegisterIndex < NumFloatRegArgs
+ ifTrue:
+ [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
+ calloutState incrementFloatRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
+ ffiPushPointer: pointer in: calloutState
+ <var: #pointer type: #'void *'>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer asInteger.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: pointer.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedByte:in: (in category 'marshalling') -----
+ ffiPushSignedByte: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedChar:in: (in category 'marshalling') -----
+ ffiPushSignedChar: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedInt:in: (in category 'marshalling') -----
+ ffiPushSignedInt: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0
+ !

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
+ ffiPushSignedLongLong: value in: calloutState
+ <var: #value type: #sqLong>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedShort:in: (in category 'marshalling') -----
+ ffiPushSignedShort: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed short').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed short').
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
+ ffiPushSingleFloat: value in: calloutState
+ <var: #value type: #float>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+
+ calloutState floatRegisterIndex < NumFloatRegArgs
+ ifTrue:
+ [(self cCoerce: calloutState floatRegisters + calloutState floatRegisterIndex to: #'float *') at: 0 put: value.
+ calloutState incrementFloatRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedByte:in: (in category 'marshalling') -----
+ ffiPushUnsignedByte: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0
+ !

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedChar:in: (in category 'marshalling') -----
+ ffiPushUnsignedChar: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedInt:in: (in category 'marshalling') -----
+ ffiPushUnsignedInt: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0
+
+ !

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
+ ffiPushUnsignedLongLong: value in: calloutState
+ <var: #value type: #usqLong>
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: value.
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedShort:in: (in category 'marshalling') -----
+ ffiPushUnsignedShort: value in: calloutState
+ <var: #calloutState type: #'CalloutState *'>
+ <inline: true>
+ calloutState integerRegisterIndex < NumIntRegArgs
+ ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned short').
+ calloutState incrementIntegerRegisterIndex]
+ ifFalse:
+ [calloutState currentArg + WordSize > calloutState limit ifTrue:
+ [^FFIErrorCallFrameTooBig]].
+ interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned short').
+ calloutState currentArg: calloutState currentArg + WordSize.
+ ^0!


Reply | Threaded
Open this post in threaded view
|

Re: VM Maker: VMMaker.oscog-eem.2228.mcz

Eliot Miranda-2
 
Hi Nicolas,

    ignore this commit.  I realize now I didn't understand how to implement handling the shadow space, and that in fact we don't need to do anything special because the basic call that passes the four register arguments does it for us.  Apologies.  I'll delete the package as soon as I've checked that all the FFI tests pass.

On Tue, May 30, 2017 at 10:37 AM, <[hidden email]> wrote:

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2228.mcz

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

Name: VMMaker.oscog-eem.2228
Author: eem
Time: 30 May 2017, 10:36:59.18841 am
UUID: 80a3d07d-f055-4eaf-992c-3e532eb50fb8
Ancestors: VMMaker.oscog-eem.2227

Implement shadow parameter space in the Win64 FFI plugin by always incrememting currentArg, even if passed in a register.  Consequently eliminate the abstract superclasses for the X64 ABI; they no longer share more than a method or two.

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

Item was removed:
- ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForX64
-       instanceVariableNames: 'integerRegisterIndex floatRegisterIndex integerRegisters floatRegisters'
-       classVariableNames: ''
-       poolDictionaries: ''
-       category: 'VMMaker-Plugins-FFI'!
-
- !ThreadedFFICalloutStateForX64 commentStamp: 'eem 2/16/2016 19:13' prior: 0!
- A ThreadedFFICalloutStateForX64 is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system.!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64 class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') -----
- instVarNamesAndTypesForTranslationDo: aBinaryBlock
-       "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a ThreadedFFICalloutState struct."
-
-       ThreadedFFICalloutState instVarNamesAndTypesForTranslationDo: aBinaryBlock.
-       ThreadedFFICalloutStateForX64 instVarNames do:
-               [:ivn|
-               aBinaryBlock
-                       value: ivn
-                       value: (ivn caseOf: {
-                                               ['integerRegisters']    -> [{#sqInt. '[NumIntRegArgs]'}].
-                                               ['floatRegisters']      -> [{#double. '[NumFloatRegArgs]'}] }
-                                       otherwise:
-                                               [#sqInt])]!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64 class>>pluginClass (in category 'translation') -----
- pluginClass
-       ^self subclassResponsibility!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>floatRegisterIndex (in category 'accessing') -----
- floatRegisterIndex
-
-       ^ floatRegisterIndex!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>floatRegisters (in category 'accessing') -----
- floatRegisters
-       "Answer the value of floatRegisters"
-
-       ^ floatRegisters!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>incrementFloatRegisterIndex (in category 'accessing') -----
- incrementFloatRegisterIndex
-       ^floatRegisterIndex := floatRegisterIndex + 1!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>incrementIntegerRegisterIndex (in category 'accessing') -----
- incrementIntegerRegisterIndex
-       ^integerRegisterIndex := integerRegisterIndex + 1!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>initialize (in category 'initialize-release') -----
- initialize
-       super initialize.
-       integerRegisterIndex := floatRegisterIndex := 0.
-       integerRegisters := CArrayAccessor on: (Array new: self class pluginClass numRegArgs).
-       floatRegisters := CArrayAccessor on: (Array new: self class pluginClass numFloatRegArgs)!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>integerRegisterIndex (in category 'accessing') -----
- integerRegisterIndex
-
-       ^ integerRegisterIndex!

Item was removed:
- ----- Method: ThreadedFFICalloutStateForX64>>integerRegisters (in category 'accessing') -----
- integerRegisters
-       "Answer the value of integerRegisters"
-
-       ^ integerRegisters!

Item was changed:
+ ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForX64SysV
+       instanceVariableNames: 'integerRegisterIndex floatRegisterIndex integerRegisters floatRegisters'
- ThreadedFFICalloutStateForX64 subclass: #ThreadedFFICalloutStateForX64SysV
-       instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'VMMaker-Plugins-FFI'!
+
+ !ThreadedFFICalloutStateForX64SysV commentStamp: 'eem 5/30/2017 10:22' prior: 0!
+ A ThreadedFFICalloutStateForX64SysV is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system using the System V ABI.!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') -----
+ instVarNamesAndTypesForTranslationDo: aBinaryBlock
+       "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a ThreadedFFICalloutState struct."
+
+       ThreadedFFICalloutState instVarNamesAndTypesForTranslationDo: aBinaryBlock.
+       self instVarNames do:
+               [:ivn|
+               aBinaryBlock
+                       value: ivn
+                       value: (ivn caseOf: {
+                                               ['integerRegisters']    -> [{#sqInt. '[NumIntRegArgs]'}].
+                                               ['floatRegisters']      -> [{#double. '[NumFloatRegArgs]'}] }
+                                       otherwise:
+                                               [#char])]!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>floatRegisterIndex (in category 'accessing') -----
+ floatRegisterIndex
+
+       ^ floatRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>floatRegisters (in category 'accessing') -----
+ floatRegisters
+       "Answer the value of floatRegisters"
+
+       ^ floatRegisters!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>incrementFloatRegisterIndex (in category 'accessing') -----
+ incrementFloatRegisterIndex
+       ^floatRegisterIndex := floatRegisterIndex + 1!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>incrementIntegerRegisterIndex (in category 'accessing') -----
+ incrementIntegerRegisterIndex
+       ^integerRegisterIndex := integerRegisterIndex + 1!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>initialize (in category 'initialize-release') -----
+ initialize
+       super initialize.
+       integerRegisterIndex := floatRegisterIndex := 0.
+       integerRegisters := CArrayAccessor on: (Array new: ThreadedX64SysVFFIPlugin numRegArgs).
+       floatRegisters := CArrayAccessor on: (Array new: ThreadedX64SysVFFIPlugin numFloatRegArgs)!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>integerRegisterIndex (in category 'accessing') -----
+ integerRegisterIndex
+
+       ^ integerRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64SysV>>integerRegisters (in category 'accessing') -----
+ integerRegisters
+       "Answer the value of integerRegisters"
+
+       ^ integerRegisters!

Item was changed:
+ ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForX64Win64
+       instanceVariableNames: 'integerRegisterIndex floatRegisterIndex floatRegisterSignature integerRegisters floatRegisters'
- ThreadedFFICalloutStateForX64 subclass: #ThreadedFFICalloutStateForX64Win64
-       instanceVariableNames: 'floatRegisterSignature'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'VMMaker-Plugins-FFI'!
+
+ !ThreadedFFICalloutStateForX64Win64 commentStamp: 'eem 5/30/2017 10:22' prior: 0!
+ A ThreadedFFICalloutStateForX64Win64 is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system using the _WIN64 ABI.!

Item was changed:
  ----- Method: ThreadedFFICalloutStateForX64Win64 class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') -----
  instVarNamesAndTypesForTranslationDo: aBinaryBlock
        "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a ThreadedFFICalloutState struct."

+       ThreadedFFICalloutState instVarNamesAndTypesForTranslationDo: aBinaryBlock.
+       self instVarNames do:
-       ThreadedFFICalloutStateForX64 instVarNamesAndTypesForTranslationDo: aBinaryBlock.
-       ThreadedFFICalloutStateForX64Win64 instVarNames do:
                [:ivn|
                aBinaryBlock
                        value: ivn
                        value: (ivn caseOf: {
+                                               ['integerRegisters']    -> [{#sqInt. '[NumIntRegArgs]'}].
+                                               ['floatRegisters']      -> [{#double. '[NumFloatRegArgs]'}] }
-                                               ['floatRegisterSignature']      -> [#int] }
                                        otherwise:
+                                               [#char])]!
-                                               [#sqInt])]!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>floatRegisterIndex (in category 'accessing') -----
+ floatRegisterIndex
+
+       ^ floatRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>floatRegisters (in category 'accessing') -----
+ floatRegisters
+       "Answer the value of floatRegisters"
+
+       ^ floatRegisters!

Item was changed:
  ----- Method: ThreadedFFICalloutStateForX64Win64>>initialize (in category 'initialize-release') -----
  initialize
        super initialize.
+       integerRegisterIndex := floatRegisterIndex := floatRegisterSignature := 0.
+       integerRegisters := CArrayAccessor on: (Array new: ThreadedX64Win64FFIPlugin numRegArgs).
+       floatRegisters := CArrayAccessor on: (Array new: ThreadedX64Win64FFIPlugin numFloatRegArgs)!
-       floatRegisterSignature := 0.!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>integerRegisterIndex (in category 'accessing') -----
+ integerRegisterIndex
+
+       ^ integerRegisterIndex!

Item was added:
+ ----- Method: ThreadedFFICalloutStateForX64Win64>>integerRegisters (in category 'accessing') -----
+ integerRegisters
+       "Answer the value of integerRegisters"
+
+       ^ integerRegisters!

Item was removed:
- ThreadedFFIPlugin subclass: #ThreadedX64FFIPlugin
-       instanceVariableNames: ''
-       classVariableNames: 'NumFloatRegArgs NumIntRegArgs WordSize'
-       poolDictionaries: ''
-       category: 'VMMaker-Plugins-FFI'!
-
- !ThreadedX64FFIPlugin commentStamp: 'eem 2/19/2016 15:03' prior: 0!
- This is an abstract superclass for the System V and WIN64 x86-64 ABIs that share a lot of code other than for structure passing.!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>calloutStateClass (in category 'translation') -----
- calloutStateClass
-       ^ThreadedFFICalloutStateForX64!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
- identifyingPredefinedMacros
-       "Answer the predefined macros that identify the platforms a subclass handles, if any.
-        If the subclass isn't yet ready for production (a work in progress) simply answer nil.
-        Override to filter-out this abstract class."
-       ^nil!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>initialize (in category 'class initialization') -----
- initialize
-       WordSize := 8.
-       NumIntRegArgs := 6.
-       NumFloatRegArgs := 8!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>moduleName (in category 'translation') -----
- moduleName
-       ^'X64SysVFFIPlugin'!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>numFloatRegArgs (in category 'accessing') -----
- numFloatRegArgs
-       ^NumFloatRegArgs!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>numRegArgs (in category 'accessing') -----
- numRegArgs
-       ^NumIntRegArgs!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
- ffiPushDoubleFloat: value in: calloutState
-       <var: #value type: #double>
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-
-       calloutState floatRegisterIndex < NumFloatRegArgs
-               ifTrue:
-                       [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
-                        calloutState incrementFloatRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
- ffiPushPointer: pointer in: calloutState
-       <var: #pointer type: #'void *'>
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer asInteger.
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: pointer.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedByte:in: (in category 'marshalling') -----
- ffiPushSignedByte: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedChar:in: (in category 'marshalling') -----
- ffiPushSignedChar: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedInt:in: (in category 'marshalling') -----
- ffiPushSignedInt: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: value.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0
- !

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
- ffiPushSignedLongLong: value in: calloutState
-       <var: #value type: #sqLong>
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: value.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSignedShort:in: (in category 'marshalling') -----
- ffiPushSignedShort: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed short').
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed short').
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
- ffiPushSingleFloat: value in: calloutState
-       <var: #value type: #float>
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-
-       calloutState floatRegisterIndex < NumFloatRegArgs
-               ifTrue:
-                       [(self cCoerce: calloutState floatRegisters + calloutState floatRegisterIndex to: #'float *') at: 0 put: value.
-                        calloutState incrementFloatRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushStructure:ofSize:typeSpec:ofLength:in: (in category 'marshalling') -----
- ffiPushStructure: pointer ofSize: structSize typeSpec: argSpec ofLength: argSpecSize in: calloutState
-       <var: #pointer type: #'void *'>
-       <var: #argSpec type: #'sqInt *'>
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       self subclassResponsibility!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedByte:in: (in category 'marshalling') -----
- ffiPushUnsignedByte: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0
- !

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedChar:in: (in category 'marshalling') -----
- ffiPushUnsignedChar: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedInt:in: (in category 'marshalling') -----
- ffiPushUnsignedInt: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: value.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0
-
- !

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
- ffiPushUnsignedLongLong: value in: calloutState
-       <var: #value type: #usqLong>
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: value.
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>ffiPushUnsignedShort:in: (in category 'marshalling') -----
- ffiPushUnsignedShort: value in: calloutState
-       <var: #calloutState type: #'CalloutState *'>
-       <inline: true>
-       calloutState integerRegisterIndex < NumIntRegArgs
-               ifTrue:
-                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned short').
-                        calloutState incrementIntegerRegisterIndex]
-               ifFalse:
-                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
-                               [^FFIErrorCallFrameTooBig].
-                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned short').
-                        calloutState currentArg: calloutState currentArg + WordSize].
-       ^0!

Item was removed:
- ----- Method: ThreadedX64FFIPlugin>>returnStructInRegisters: (in category 'marshalling') -----
- returnStructInRegisters: returnStructSize
-       "Answer if a struct result of a given size is returned in memory or not."
-       self subclassResponsibility!

Item was changed:
+ ThreadedFFIPlugin subclass: #ThreadedX64SysVFFIPlugin
- ThreadedX64FFIPlugin subclass: #ThreadedX64SysVFFIPlugin
        instanceVariableNames: ''
+       classVariableNames: 'NumFloatRegArgs NumIntRegArgs WordSize'
-       classVariableNames: ''
        poolDictionaries: ''
        category: 'VMMaker-Plugins-FFI'!

  !ThreadedX64SysVFFIPlugin commentStamp: 'eem 2/17/2016 20:03' prior: 0!
  This subclass is for the System V x86-64 ABI.  The System V ABI uses 6 integer registers and 8 double-precision floating-point registers.  See http://www.x86-64.org/documentation/abi.pdf.  It seems that Mac OS X and linux use draft version 0.90, http://people.freebsd.org/~obrien/amd64-elf-abi.pdf.

  Note that the System V x86-64 ABI decomposes structs of 2 eightbytes or smaller passed by value across available parameter registers.  double fields will be passed in an xmm register.!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin class>>calloutStateClass (in category 'translation') -----
+ calloutStateClass
+       ^ThreadedFFICalloutStateForX64SysV!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
+ ffiPushDoubleFloat: value in: calloutState
+       <var: #value type: #double>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+
+       calloutState floatRegisterIndex < NumFloatRegArgs
+               ifTrue:
+                       [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
+                        calloutState incrementFloatRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
+ ffiPushPointer: pointer in: calloutState
+       <var: #pointer type: #'void *'>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer asInteger.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: pointer.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedByte:in: (in category 'marshalling') -----
+ ffiPushSignedByte: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedChar:in: (in category 'marshalling') -----
+ ffiPushSignedChar: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedInt:in: (in category 'marshalling') -----
+ ffiPushSignedInt: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: value.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0
+ !

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
+ ffiPushSignedLongLong: value in: calloutState
+       <var: #value type: #sqLong>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: value.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSignedShort:in: (in category 'marshalling') -----
+ ffiPushSignedShort: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed short').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed short').
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
+ ffiPushSingleFloat: value in: calloutState
+       <var: #value type: #float>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+
+       calloutState floatRegisterIndex < NumFloatRegArgs
+               ifTrue:
+                       [(self cCoerce: calloutState floatRegisters + calloutState floatRegisterIndex to: #'float *') at: 0 put: value.
+                        calloutState incrementFloatRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedByte:in: (in category 'marshalling') -----
+ ffiPushUnsignedByte: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0
+ !

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedChar:in: (in category 'marshalling') -----
+ ffiPushUnsignedChar: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedInt:in: (in category 'marshalling') -----
+ ffiPushUnsignedInt: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: value.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0
+
+ !

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
+ ffiPushUnsignedLongLong: value in: calloutState
+       <var: #value type: #usqLong>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: value.
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was added:
+ ----- Method: ThreadedX64SysVFFIPlugin>>ffiPushUnsignedShort:in: (in category 'marshalling') -----
+ ffiPushUnsignedShort: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned short').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig].
+                        interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned short').
+                        calloutState currentArg: calloutState currentArg + WordSize].
+       ^0!

Item was changed:
+ ThreadedFFIPlugin subclass: #ThreadedX64Win64FFIPlugin
- ThreadedX64FFIPlugin subclass: #ThreadedX64Win64FFIPlugin
        instanceVariableNames: ''
+       classVariableNames: 'NumFloatRegArgs NumIntRegArgs WordSize'
-       classVariableNames: ''
        poolDictionaries: ''
        category: 'VMMaker-Plugins-FFI'!

  !ThreadedX64Win64FFIPlugin commentStamp: 'nice 8/10/2016 19:23' prior: 0!
  This subclass is for the Win64 x86-64 ABI.  The Win64 ABI uses 4 integer registers or 4 double-precision floating-point registers or a mix of the two.  See w.g. https://msdn.microsoft.com/en-us/library/ms235286.aspx, or google for "Overview of x64 Calling Conventions - MSDN - Microsoft".

  Note that unlike the System V x86-64 ABI, the Win64 ABI does /not/ decompose structs passed by value across available parameter registers.!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
+ ffiPushDoubleFloat: value in: calloutState
+       <var: #value type: #double>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+
+       calloutState floatRegisterIndex < NumFloatRegArgs
+               ifTrue:
+                       [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
+                        calloutState incrementFloatRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
+ ffiPushPointer: pointer in: calloutState
+       <var: #pointer type: #'void *'>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer asInteger.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: pointer.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedByte:in: (in category 'marshalling') -----
+ ffiPushSignedByte: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedChar:in: (in category 'marshalling') -----
+ ffiPushSignedChar: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed char').
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedInt:in: (in category 'marshalling') -----
+ ffiPushSignedInt: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: value.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0
+ !

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
+ ffiPushSignedLongLong: value in: calloutState
+       <var: #value type: #sqLong>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: value.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSignedShort:in: (in category 'marshalling') -----
+ ffiPushSignedShort: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'signed short').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'signed short').
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
+ ffiPushSingleFloat: value in: calloutState
+       <var: #value type: #float>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+
+       calloutState floatRegisterIndex < NumFloatRegArgs
+               ifTrue:
+                       [(self cCoerce: calloutState floatRegisters + calloutState floatRegisterIndex to: #'float *') at: 0 put: value.
+                        calloutState incrementFloatRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedByte:in: (in category 'marshalling') -----
+ ffiPushUnsignedByte: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0
+ !

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedChar:in: (in category 'marshalling') -----
+ ffiPushUnsignedChar: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned char').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned char').
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedInt:in: (in category 'marshalling') -----
+ ffiPushUnsignedInt: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: value.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0
+
+ !

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
+ ffiPushUnsignedLongLong: value in: calloutState
+       <var: #value type: #usqLong>
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: value.
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!

Item was added:
+ ----- Method: ThreadedX64Win64FFIPlugin>>ffiPushUnsignedShort:in: (in category 'marshalling') -----
+ ffiPushUnsignedShort: value in: calloutState
+       <var: #calloutState type: #'CalloutState *'>
+       <inline: true>
+       calloutState integerRegisterIndex < NumIntRegArgs
+               ifTrue:
+                       [calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #'unsigned short').
+                        calloutState incrementIntegerRegisterIndex]
+               ifFalse:
+                       [calloutState currentArg + WordSize > calloutState limit ifTrue:
+                               [^FFIErrorCallFrameTooBig]].
+       interpreterProxy longAt: calloutState currentArg put: (self cCoerceSimple: value to: #'unsigned short').
+       calloutState currentArg: calloutState currentArg + WordSize.
+       ^0!





--
_,,,^..^,,,_
best, Eliot