[Vm-dev] VM Maker: VMMaker.oscog-djm.684.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Apr 21 00:49:42 UTC 2014
Douglas McPherson uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-djm.684.mcz
==================== Summary ====================
Name: VMMaker.oscog-djm.684
Author: djm
Time: 20 April 2014, 5:47:02.791 pm
UUID: 136d682f-3611-4807-8db0-003ffe98f06a
Ancestors: VMMaker.oscog-eem.683
Fix bug in pushing structures. All existing FFI tests now pass for ARM (at least on Raspberry Pi)!!
=============== Diff against VMMaker.oscog-eem.683 ===============
Item was changed:
----- Method: ThreadedARMFFIPlugin>>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.
calloutState integerRegisterIndex: calloutState integerRegisterIndex + 1]
ifFalse:
[calloutState currentArg + 4 > calloutState limit ifTrue:
[^FFIErrorCallFrameTooBig].
interpreterProxy longAt: calloutState currentArg put: pointer.
calloutState currentArg: calloutState currentArg + 4].
^0!
Item was changed:
----- Method: ThreadedARMFFIPlugin>>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>
| availableRegisterSpace stackPartSize roundedSize |
availableRegisterSpace := (NumIntRegArgs - calloutState integerRegisterIndex) * 4.
stackPartSize := structSize.
availableRegisterSpace > 0
ifTrue:
[structSize <= availableRegisterSpace
ifTrue:
["all in registers"
+ stackPartSize := 0.
- stackPartSize = 0.
self
mem: (self cCoerceSimple: (self addressOf: (calloutState integerRegisters at: calloutState integerRegisterIndex)) to: 'void *')
cp: pointer
y: structSize.
calloutState integerRegisterIndex: calloutState integerRegisterIndex + (structSize + 3 bitShift: -2) ]
ifFalse:
["some in registers rest on stack"
stackPartSize := structSize - availableRegisterSpace.
self
mem: (self cCoerceSimple: (self addressOf: (calloutState integerRegisters at: calloutState integerRegisterIndex)) to: 'void *')
cp: pointer
y: availableRegisterSpace.
calloutState integerRegisterIndex: NumIntRegArgs]].
stackPartSize > 0
ifTrue:
[roundedSize := stackPartSize + 3 bitClear: 3.
calloutState currentArg + roundedSize > calloutState limit ifTrue:
[^FFIErrorCallFrameTooBig].
self mem: calloutState currentArg cp: (self addressOf: ((self cCoerceSimple: pointer to: 'char *') at: availableRegisterSpace)) y: stackPartSize.
calloutState currentArg: calloutState currentArg + roundedSize].
-
^0!
More information about the Vm-dev
mailing list