Lowcode and x64

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Lowcode and x64

Nicolas Cellier
 
Hi Ronie,
From my understanding, following code cannot work in x64 because registers are overwritten while marshalling arguments:

generateLowcodeObjectTrampolines
    ... snip ...
    ceInstantiateClassIndexableSizeTrampoline := cogit genTrampolineFor: #instantiateClass:indexableSize:
                                                called: 'ceInstantiateClassIndexableSizeTrampoline'
                                                arg: ReceiverResultReg
                                                arg: Arg0Reg
                                                result: TempReg.
                                               
The first arg ReceiverResultReg (RDX) will overwrite Arg0Reg (RDI) before Arg0Reg is copied to Arg1Reg (RSI)...
See genMarshallNArgs:arg:arg:arg:arg:
and carefully read the comment for the x64 flavour, it's scary ;)

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Lowcode and x64

Ronie Salgado
 
Hi Nicolas,

Thanks for telling me about this. It seems that only ceInstantiateClassIndexableSizeTrampoline and ceByteSizeOfTrampoline needed that kind of correction.

During this month I will try to make Lowcode working with x86_64. I need it working in 64 bits OS X for using Metal with Woden 2, so for me this very important.

Best regards
Ronie

2016-11-27 18:50 GMT-03:00 Nicolas Cellier <[hidden email]>:
 
Hi Ronie,
From my understanding, following code cannot work in x64 because registers are overwritten while marshalling arguments:

generateLowcodeObjectTrampolines
    ... snip ...
    ceInstantiateClassIndexableSizeTrampoline := cogit genTrampolineFor: #instantiateClass:indexableSize:
                                                called: 'ceInstantiateClassIndexableSizeTrampoline'
                                                arg: ReceiverResultReg
                                                arg: Arg0Reg
                                                result: TempReg.
                                               
The first arg ReceiverResultReg (RDX) will overwrite Arg0Reg (RDI) before Arg0Reg is copied to Arg1Reg (RSI)...
See genMarshallNArgs:arg:arg:arg:arg:
and carefully read the comment for the x64 flavour, it's scary ;)

Cheers