<div dir="ltr">Hi all,<br>I have practically solved <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443</a> for passing/returning struct by value on X64SysV FFI.<br><br>I still have a few cases of packed struct or union to handle, but I know how to handle them and finish the job.<br><br>Practically, but not yet... There is an issue that I can't easily solve: slang inlining.<br><br>The generated code works on fast VM, but not debug nor assert...<br>It does not work because #ffiCalloutTo:SpecOnStack:in: is not inlined.<br>Since it uses sender's alloca as stack pointer (where FFI argVector was marshalled), it obviously will mess the stack if not inlined!<br><br>The code is not inlined because a sub-function sends a recursive message .<br>Unfortunately I have to check struct alignment for correctly determining the type of 8-byte registers, and algorithm for checking struct alignment is recursive because we must first check alignment of sub-struct....<br><br>Having a recursive function should not be a problem, just don't inline it, but invoke it.<br>Unfortunately, our strategy is to inline only sends that can be completely inlined (and recursively for every sub-send).<br><br>So I'm currently blocked...<br>I'd like to specify to not inquire further sends that explicitely refuse to be inlined, maybe in the unless block in checkForCompletenessIn:<br><br>parseTree<br>        nodesDo:<br>            [:node|<br>             ...snip...]<br>        unless:<br>            [:node|<br>            node isSend<br><div>            and: [node selector == #cCode:inSmalltalk:</div><div>               <b> or: [node explicitelyRefuseToBeInlined</b><br></div><div>                or: [aCodeGen isAssertSelector: node selector]]]].</div><div><br></div><div>Thoughts?<br></div><br></div>