This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [java/c++/rfc] avoid plt references to cni methods
- From: Andrew Haley <aph at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 May 2005 14:44:17 +0100
- Subject: Re: [java/c++/rfc] avoid plt references to cni methods
- References: <20050524211342.GA22147@redhat.com>
Richard Henderson writes:
> The idea is that CNI code will be in the same DSO as its corresponding
> Java code. Indeed, after this patch it MUST be in the same DSO.
I think that's a reasonable requirement. I guess we should document
it.
> We arrange for the C++ front end to emit hidden aliases for all of
> the functions that we need, and we use those in the _Jv_Method
> table.
OK.
> On the C++ side, I need to wait until we've resolved clones. Since
> this is done during cgraph_analyze_function, which makes it difficult
> to do this except for a separate pass over the generated functions.
>
> I've somewhat arbitrarily chosen to extend the mangling grammar:
>
> <special_name> := HA <encoding>
>
> where "HA" stands for "hidden alias". It's not inconcievable that
> such aliases could be useful in other cases. In any event, it seemed
> safer to inject myself into a logical point in the grammar like this
> than invent my own private prefix/suffix which could just as easily
> conflict with other symbols.
I guess that's OK, but it seems a little arbitrary. I wonder if there
ought to be some well-defined langauge-specific way to do special
mangling: we're going to need to extend it again for Java methods that
only differe by return type.
> On the Java side, I've rearranged things to use the name mangling
> langhook. This reduces the number of places that need to touch
> DECL_ASSEMBLER_NAME to the builtins and the mangler itself. This
> ensures that we don't set DECL_ASSEMBLER_NAME before it's absolutely
> necessary, which in turn allows us time to call java_mark_class_local.
> Which will in turn set bits that will in fact *change* the mangling
> for CNI methods.
I see.
This looks good.
Andrew.