Bug 9861 and Java 5 Generics

Terry Laurenzo tlaurenzo@gmail.com
Wed Aug 17 18:11:00 GMT 2005


The patch for the mangling changes is below.  I don't have any problem
assigning copyright.  What do I need to do in order to do that?

I had thought about using aliases to maintain BC.  There are a couple
of problems as I see it:

1. Right now, I am mangling the return type consistent with the IA64
ABI in the same manner as is done for the return type on C++ function
templates.  In essence, this means that the return type is being
mangled just prior to the first argument of the function (or if no
args, then just prior to the implicit void arg).  If we were to emit
an alias for the original encoding, then we open ourselves up to
unintended name collisions under certain circumstances.  For example, 
take the two methods:
        static void someMethod(String s, int i)
        static String someMethod(int i)
I believe that the mangled form of the first method without the return
type included (ie.  the backward compatible alias) would be the same
as the mangled form for the second method with the return type
included (ie. the "new way").
The only way I see to get around this is to diverge from the IA64 ABI
and invent a new mechanism for encoding the return types using a
delimiter of some kind to separate them from the rest of the argument
list.  That way, new style mangling and old style aliases would have
no chance of conflicting.  Thoughts?

2.  It is probably academic, but we would need to decide on how to
select which method is eligible to receive the compatibility alias. 
In practice, we could probably just choose the first method with a
given signature (not including return type), since no existing code
would have more than one method with the same signature excluding
return type.


Patch file is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mangle-gcc-4.1-20050515.patch
Type: application/octet-stream
Size: 4020 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20050817/070a549c/attachment.obj>


More information about the Java mailing list