Also, to generalize the concept i would allow @<index> syntax for all
arguments (except from constants of course).
(Btw, is everyone ok with '@' syntax?)

- first change parser's #parseArgument to pass additional argument to
requestor, i.e. send
#argName: indirectIndex: type: ptrArity:
instead of
#argName:type:ptrArity:


Like that , you won't need to parse it again in NBFFICallout but just
check index for being not-nil.
Second, refactor NBSTInObjectArgument to be a wrapper around another
loader, i.e:

NBFnArgument subclass: #NBSTInObjectArgument
        instanceVariableNames: 'argumentLoader elementIndex'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'NativeBoost-Core-FFI'

NBSTInObjectArgument>>emitLoad: gen
        | baseAddress |
        argumentLoader emitLoad: gen to: gen asm EAX.

        gen proxy fetchPointer: elementIndex - 1 ofObject: gen asm EAX.
        ^ gen asm EAX

Like that , a @<index> syntax can be used not just for method
arguments but for any other,
e.g.
self@<index> , ivar@<index>


-- 
Best regards,
Igor Stasenko.

Reply via email to