[Vm-dev] VM Maker: VMMaker.oscog-djm.678.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Apr 17 18:37:38 UTC 2014
Douglas McPherson uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-djm.678.mcz
==================== Summary ====================
Name: VMMaker.oscog-djm.678
Author: djm
Time: 17 April 2014, 11:34:53.354 am
UUID: 33f4c73e-5761-456b-a655-85ed057debfd
Ancestors: VMMaker.oscog-djm.677
ThreadedARMFFIPlugin
- fix compile problem caused by ffiPushPointer:in:
- fix problem mediating between registers and stack after marshalling first 8 byte integer to stack
- support backfilling of float registers when marshalling a double leaves an empty register due to alignmnet
=============== Diff against VMMaker.oscog-djm.677 ===============
Item was changed:
----- Method: ThreadedARMFFIPlugin>>ffiPushDoubleFloat:in: (in category 'marshalling') -----
ffiPushDoubleFloat: value in: calloutState
<var: #value type: #double>
<var: #calloutState type: #'CalloutState *'>
<inline: true>
+
calloutState floatRegisterIndex < (NumFloatRegArgs - 1)
ifTrue:
+ [(calloutState floatRegisterIndex bitAnd: 1) = 1
+ ifTrue:
+ [calloutState backfillFloatRegisterIndex: calloutState floatRegisterIndex.
+ calloutState floatRegisterIndex: (calloutState floatRegisterIndex + 1)].
- [calloutState floatRegisterIndex: (calloutState floatRegisterIndex + 1 bitClear: 1).
(self cCoerceSimple: (self addressOf: (calloutState floatRegisters at: calloutState floatRegisterIndex))
to: 'double*')
at: 0
put: value.
calloutState floatRegisterIndex: calloutState floatRegisterIndex + 2]
ifFalse:
[calloutState currentArg + 8 > calloutState limit ifTrue:
[^FFIErrorCallFrameTooBig].
+ calloutState floatRegisterIndex: NumFloatRegArgs.
interpreterProxy storeFloatAtPointer: calloutState currentArg from: value.
calloutState currentArg: calloutState currentArg + 8].
^0!
Item was changed:
----- Method: ThreadedARMFFIPlugin>>ffiPushPointer:in: (in category 'marshalling') -----
+ ffiPushPointer: pointer in: calloutState
+ <var: #pointer type: #'void *'>
- ffiPushPointer: value in: calloutState
<var: #calloutState type: #'CalloutState *'>
<inline: true>
calloutState integerRegisterIndex < NumIntRegArgs
ifTrue:
+ [calloutState integerRegisters at: calloutState integerRegisterIndex put: pointer.
- [calloutState integerRegisters at: calloutState integerRegisterIndex put: value.
calloutState integerRegisterIndex: calloutState integerRegisterIndex + 1]
ifFalse:
[calloutState currentArg + 4 > calloutState limit ifTrue:
[^FFIErrorCallFrameTooBig].
+ interpreterProxy longAt: calloutState currentArg put: pointer.
- interpreterProxy longAt: calloutState currentArg put: value.
calloutState currentArg: calloutState currentArg + 4].
^0!
Item was changed:
----- Method: ThreadedARMFFIPlugin>>ffiPushSignedLongLong:in: (in category 'marshalling') -----
ffiPushSignedLongLong: value in: calloutState
<var: #value type: #sqLong>
<var: #calloutState type: #'CalloutState *'>
<inline: true>
calloutState integerRegisterIndex < (NumIntRegArgs - 1)
ifTrue:
[calloutState integerRegisterIndex: (calloutState integerRegisterIndex + 1 bitClear: 1).
calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
calloutState integerRegisters at: calloutState integerRegisterIndex + 1 put: (self cCoerceSimple: value >> 32 to: #usqInt).
calloutState integerRegisterIndex: calloutState integerRegisterIndex + 2]
ifFalse:
[calloutState currentArg + 8 > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
+ calloutState integerRegisterIndex: NumIntRegArgs.
interpreterProxy
longAt: calloutState currentArg put: (self cCoerceSimple: value to: #usqInt);
longAt: calloutState currentArg + 4 put: (self cCoerceSimple: value >> 32 to: #usqInt).
calloutState currentArg: calloutState currentArg + 8].
^0!
Item was changed:
----- Method: ThreadedARMFFIPlugin>>ffiPushSingleFloat:in: (in category 'marshalling') -----
ffiPushSingleFloat: value in: calloutState
+ <var: #value type: #float>
<var: #calloutState type: #'CalloutState *'>
<inline: true>
calloutState floatRegisterIndex < NumFloatRegArgs
ifTrue:
+ [calloutState backfillFloatRegisterIndex > 0
+ ifTrue:
+ [calloutState floatRegisters at: calloutState backfillFloatRegisterIndex put: value.
+ calloutState backfillFloatRegisterIndex: 0]
+ ifFalse:
+ [calloutState floatRegisters at: calloutState floatRegisterIndex put: value.
+ calloutState floatRegisterIndex: calloutState floatRegisterIndex + 1]]
- [calloutState floatRegisters at: calloutState floatRegisterIndex put: (self cCoerceSimple: value to: #'float').
- calloutState floatRegisterIndex: calloutState floatRegisterIndex + 1]
ifFalse:
[calloutState currentArg + 4 > calloutState limit ifTrue:
[^FFIErrorCallFrameTooBig].
interpreterProxy storeSingleFloatAtPointer: calloutState currentArg from: value.
calloutState currentArg: calloutState currentArg + 4].
^0!
Item was changed:
----- Method: ThreadedARMFFIPlugin>>ffiPushUnsignedLongLong:in: (in category 'marshalling') -----
ffiPushUnsignedLongLong: value in: calloutState
<var: #value type: #usqLong>
<var: #calloutState type: #'CalloutState *'>
<inline: true>
calloutState integerRegisterIndex < (NumIntRegArgs - 1)
ifTrue:
[calloutState integerRegisterIndex: (calloutState integerRegisterIndex + 1 bitClear: 1).
calloutState integerRegisters at: calloutState integerRegisterIndex put: (self cCoerceSimple: value to: #usqInt).
calloutState integerRegisters at: calloutState integerRegisterIndex + 1 put: (self cCoerceSimple: value >> 32 to: #usqInt).
calloutState integerRegisterIndex: calloutState integerRegisterIndex + 2]
ifFalse:
[calloutState currentArg + 8 > calloutState limit ifTrue: [^FFIErrorCallFrameTooBig].
+ calloutState integerRegisterIndex: NumIntRegArgs.
interpreterProxy
longAt: calloutState currentArg put: (self cCoerceSimple: value to: #usqInt);
longAt: calloutState currentArg + 4 put: (self cCoerceSimple: value >> 32 to: #usqInt).
calloutState currentArg: calloutState currentArg + 8].
^0
!
Item was changed:
ThreadedFFICalloutState subclass: #ThreadedFFICalloutStateForARM
+ instanceVariableNames: 'integerRegisterIndex integerRegisters floatRegisterIndex backfillFloatRegisterIndex floatRegisters'
- instanceVariableNames: 'integerRegisterIndex integerRegisters floatRegisterIndex floatRegisters'
classVariableNames: ''
poolDictionaries: ''
category: 'VMMaker-Plugins'!
Item was added:
+ ----- Method: ThreadedFFICalloutStateForARM>>backfillFloatRegisterIndex (in category 'accessing') -----
+ backfillFloatRegisterIndex
+
+ ^ backfillFloatRegisterIndex!
Item was added:
+ ----- Method: ThreadedFFICalloutStateForARM>>backfillFloatRegisterIndex: (in category 'accessing') -----
+ backfillFloatRegisterIndex: anObject
+
+ ^backfillFloatRegisterIndex := anObject!
Item was changed:
----- Method: ThreadedFFICalloutStateForARM>>initialize (in category 'initialize-release') -----
initialize
super initialize.
integerRegisterIndex := 0.
floatRegisterIndex := 0.
+ backfillFloatRegisterIndex := 0.
integerRegisters := CArrayAccessor on: (Array new: ThreadedARMFFIPlugin numIntRegArgs).
floatRegisters := CArrayAccessor on: (Array new: ThreadedARMFFIPlugin numFloatRegArgs)!
More information about the Vm-dev
mailing list