GCC/ObjC enhancements, comments requested

Richard Henderson rth@cygnus.com
Tue Feb 10 03:34:00 GMT 1998


On Sun, Feb 08, 1998 at 12:28:47PM -0800, Scott Christley wrote:
> > I guess I don't understand why you don't just pass everything by
> > reference if you don't know their types.
> 
> We do know the types, the issue is that we don't know the types until
> runtime ...

Which from my point of view counts as not knowing the types.

> ... so we must be able to perform the same logic at runtime that GCC
> at compile time.

Which can be arbitrarily complex for any given target.  Sorry to
rain on your parade, but the calling conventions for Sparc v9 and
MIPS n64, to name two examples, are quite nasty (but efficient)
when it comes to passing structs by value.  

It is sitting in my home directory at the moment, but for a sense
of scope the Sparc v9 function argument and return value macros
are implemented with 12 functions spanning 900 lines -- and I have
yet to add the bits to properly handle C++ nested classes.

> How can this be?  GCC somehow must decide how to pass this information; it
> is obviously doing it when you compile.  The issue is that we need access
> to this logic at runtime.

How?  I can't think of any way at all for you to give direct access
to the backing functions in any coherent fashion.

> I'm afraid I haven't explained the task clearly enough.

The task is clear enough, the reason is not. 

Why is there a requirement that you be able to call arbitrary functions
in the native calling convention?  Why can you not simply pass everything
by reference?  Loading up all pointer registers is a much simpler task.


r~



More information about the Gcc mailing list