Bug 9861 and Java 5 Generics

Terry Laurenzo tlaurenzo@gmail.com
Mon Aug 22 16:57:00 GMT 2005


> One final note about the symbol naming. Couldn't we only put the
> return type into the mangling in those cases where there actually is a
> clash?
This would definitely make the generated symbols smaller for the very
common case. The cost, I think is with the added complexity to the
mangling routines. When generating the mangled name, the mangler
would need to traverse the declarations within the current class to
see if there is more than one method with the same signature (w/o
return type). If there is, then it would emit the return type (for
all instances with the same signature). If not, then it would do it
the old way, ommiting the return type completely.
It would be important to include the return type on all methods that
are duplicate, not just the second and subsequent methods encountered
or else you could conceivably get symbol name conflicts from perfectly
ordinary cases (I think I commented on this earlier). The alternative
is to change the mangling to diverge from the way C++ encodes return
types (by essentially encoding them as the first method argument). 
This is probably a good idea anyway, so that return types are cleanly
isolated from the mangled arguments.
Maybe its just me, but the idea of having such complex and context
dependent mangling rules is setting off warning lights in my head.
TJ


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /