C++ and Java CNI: Check Java references
Jason Merrill
jason_merrill@redhat.com
Sun May 13 15:40:00 GMT 2001
>>>>> "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
More information about the Gcc
mailing list