This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to fix PR9861


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Lance Taylor wrote:
> Ian Lance Taylor <ian@airs.com> writes:
> 
> 
>>TJ Laurenzo <tlaurenzo@gmail.com> writes:
>>
>>
>>>The attached patch corrects PR9861 by including the return type in
>>>mangled names in the C++ and Java compilers for Java class methods. 
>>>This changes the ABI for Java types but does not make any changes to
>>>C++ programs that do not access Java types.
>>
>>How is the demangler going to work with this patch?  Is there any way
>>for the demangler to determine which names are Java names and which
>>are C++ names?  I don't see any obvious way, though I haven't looked
>>that hard.
> 
> 
> By the way, considering the demangler is not an unimportant point as
> any ambiguity in demangling is an ambiguity that can be happen when
> linking C++ and Java code together.  For example, your proposed
> mangling for
>     java.lang.Math.acos(double)
> appears to be
>     _ZN4java4lang4Math4acosEdd
> which is the mangled name which will be used for the C++ function
>     java::lang::Math::acos(double, double)

If we are changing the mangling for "Java" classes, is it possible
to have a mangling where the return type comes *before* the
class-cum-method name to disambiguate a (say) "void foo::bar(int,int)"
from an "int foo::bar(int)" when the return type is included?

Right now, without this patch, these seem to be encoded as
"ZN3foo3barEii" and "ZN3foo3barEi" respectively.

Thanks,
Ranjit.

- --
Ranjit Mathew       Email: rmathew AT gmail DOT com

Bangalore, INDIA.     Web: http://ranjitmathew.hostingzero.com/




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDM10IYb1hx2wRS48RAgOBAJ9gJIACog8fsSZax84eEJqjpPNV3gCfcdMt
KOBMo/YAbKwv3IDf4FKs9ZE=
=cHTC
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]