[Vm-dev] VM Maker Inbox: VMMaker.oscog-KenD.2516.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jan 28 00:56:25 UTC 2019
A new version of VMMaker was added to project VM Maker Inbox:
http://source.squeak.org/VMMakerInbox/VMMaker.oscog-KenD.2516.mcz
==================== Summary ====================
Name: VMMaker.oscog-KenD.2516
Author: KenD
Time: 26 January 2019, 2:02:25.625799 am
UUID: 1401fcfb-5b98-43eb-ad9e-73a3ccf4e8dc
Ancestors: VMMaker.oscog-KenD.2514
Retry update to current (1 unit test fails)
=============== Diff against VMMaker.oscog-KenD.2513 ===============
Item was changed:
----- Method: ThreadedARM64FFIPlugin>>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) * self wordSize.
stackPartSize := structSize.
availableRegisterSpace > 0
ifTrue:
[structSize <= availableRegisterSpace
ifTrue:
["all in registers"
stackPartSize := 0.
self
memcpy: (self cCoerceSimple: (self addressOf: (calloutState integerRegisters at: calloutState integerRegisterIndex)) to: 'void *')
_: pointer
_: structSize.
+ "Round structSize up and divide by 8 ( NB: _not_ 4 !!)"
+ calloutState integerRegisterIndex: calloutState integerRegisterIndex + (structSize + 3 bitShift: -3) ]
- calloutState integerRegisterIndex: calloutState integerRegisterIndex + (structSize + 3 bitShift: -2) ]
ifFalse:
["If no previous co-processor candidate arg has already been pushed on the stack, then split the struct between registers and stack.
Otherwise push entire struct on stack."
calloutState currentArg = calloutState argVector
ifTrue:
[stackPartSize := structSize - availableRegisterSpace.
self
memcpy: (self cCoerceSimple: (self addressOf: (calloutState integerRegisters at: calloutState integerRegisterIndex)) to: 'void *')
_: pointer
_: availableRegisterSpace]
ifFalse:
[availableRegisterSpace := 0].
calloutState integerRegisterIndex: NumIntRegArgs]].
stackPartSize > 0
ifTrue:
[roundedSize := stackPartSize + 3 bitClear: 3.
calloutState currentArg + roundedSize > calloutState limit ifTrue:
[^FFIErrorCallFrameTooBig].
self memcpy: calloutState currentArg _: (self addressOf: ((self cCoerceSimple: pointer to: 'char *') at: availableRegisterSpace)) _: stackPartSize.
calloutState currentArg: calloutState currentArg + roundedSize].
^0!
Item was added:
+ ----- Method: ThreadedARM64FFIPlugin>>nonRegisterStructReturnIsViaImplicitFirstArgument (in category 'marshalling') -----
+ nonRegisterStructReturnIsViaImplicitFirstArgument
+ "Answer if a struct returned in memory is returned to the
+ referent of a pointer passed as an implciit first argument.
+ It almost always is. Subclasses can override if not."
+ ^false!
Item was added:
+ ----- Method: ThreadedARM64FFIPlugin>>returnStructInRegisters: (in category 'marshalling') -----
+ returnStructInRegisters: returnStructSize
+ "Answer if a struct result of a given size is returned in memory or not."
+ ^returnStructSize <= (2 * self wordSize) "??numIntRegs--> 8 * wordsize??"!
More information about the Vm-dev
mailing list