This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ and Java CNI: Check Java references


>>>>> "James" == James Mansion <james@westongold.com> writes:

>> Just to be pedantic, it's impossible to eliminate the abstraction penalty
>> when the ABI is different for passing a pointer v. a smart pointer.  But if
>> you can inline most of the uses it shouldn't be a big deal.

> Isn't this exactly why its so worthwhile to have an ability to tag
> functions as 'fast_call' or whatever, guaranteeing that the compiler
> at the call site and implementation are 'the same' and so the call
> can be made more efficiently for pass/return of small structs?

I suspect the benefit would be small; smart pointers are usually passed by
invisible reference not just because they're structs, but because they have
copy constructors.

> Its gross to have smart pointers passed differently within a
> system where the binary representation is identical to a single
> pointer.  Also painful to pass pair<> (or similar) objects around
> by reference - even an x86 has enough registers to be worthwhile.

The normal x86 calling convention doesn't pass any arguments in registers.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]