public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: C++ and Java CNI: Check Java references
       [not found] <ODEEJFFGLIBKGLFBJHOIIEGEDMAA.james@westongold.com>
@ 2001-05-13 15:40 ` Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2001-05-13 15:40 UTC (permalink / raw)
  To: James Mansion; +Cc: gcc

>>>>> "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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-13 15:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ODEEJFFGLIBKGLFBJHOIIEGEDMAA.james@westongold.com>
2001-05-13 15:40 ` C++ and Java CNI: Check Java references Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).