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
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 < nicolas.cellier.aka.nice@gmail.com>:
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
vm-dev@lists.squeakfoundation.org