This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Java: verification of interface types
- To: Per Bothner <per at bothner dot com>
- Subject: Re: [PATCH] Java: verification of interface types
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Mon, 15 Jan 2001 14:26:35 +1300
- CC: gcc-patches at gcc dot gnu dot org, Tom Tromey <tromey at redhat dot com>, java-discuss at sources dot redhat dot com
- References: <m2zogtn07d.fsf@kelso.bothner.com>
Per Bothner wrote:
> Sun catches type-unsafe interface
> calls at run-time by type-checking at each invokeinterface call.
That is surprising. Maybe it actually does this check once when the
invokeinterface is compiled by the JIT.
> I actually don't know if we catch this in Gcj after the constant-type
> inteface method calls have been implemented.
We don't. Its definatly something that should be sorted out at compile time,
for native compiled classes. For bytecode maybe it needs to be done at runtime
in order to conform to the Java ABI rules.
> The real solution would be an explicit representation (during
> verification) of intersection types. (We only need this for
> interfaces, since the intersection of class types is just the least
> common super-type.) That should not be very difficult, but it will
> have to wait until some other time.
Perhaps I dont really understand the problem here, but whats wrong with
interface_of_p () ? When compiling/verifying bytecode, it is difficult to
determine the compile-time type of the variable you're invoking the interface
method on?
regards
[ bryce ]