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


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

Re: [PATCH] Java: verification of interface types


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 ]



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