On Tuesday, 18 de October de 2011 12:30:50 Olivier Goffart wrote:
> FYI:
> http://sourcery.mentor.com/public/cxx-abi/abi.html#normal-call
> 
> | In general, C++ value parameters are handled just like C parameters. This
> | includes class type parameters passed wholly or partially in registers. 
> | There are, however, some special cases.
> | 1. In the special case where the parameter type has a non-trivial copy   
> |
> |    constructor or destructor, the caller must allocate space for a
> |temporary   copy, and pass the resulting copy by reference (below). [...]
> 
> So because QChar and QLatin1String do not declare a copy constructor or a 
> destructor, they are passed in registers.
> 
> I just verified again with gcc -S of simple code.
> 
> (That is on Linux, I don't know about others ABI)

I called for that as early as
http://labs.qt.nokia.com/2008/04/28/string-theory/

Any struct that is movable and less than 8 or 16 bytes in size should be 
declared without a copy constructor or assignment operator (or defaulted) and 
passed by value. That also means adding them later is binary incompatible.

That applies to QChar, QLatin1Char and QLatin1String.

Mac's x86-64 ABI is the same as Linux's, see http://www.x86-64.org/

x86 is the only remaining major architecture to pass arguments on the stack 
exclusively. That's to change with x32, see 
http://sites.google.com/site/x32abi/

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to