Java: [BC] Implement type assertion table

Tom Tromey tromey@redhat.com
Mon Nov 8 15:32:00 GMT 2004


>>>>> "Bryce" == Bryce McKinlay <mckinlay@redhat.com> writes:

>> We can do further optimizations in the case of arrays.  An array is
>> always assignable to Serializable or Cloneable, and never assignable
>> to anything other than Object or another array type.  Likewise,
>> non-arrays are never assignable to an array type.

Bryce> Hmm. I suspect most of these assertions would not actually occur in
Bryce> practice, though, unless perhaps we are compiling illegal
Bryce> bytecode.

Yeah, rejecting invalid ones isn't very important; not putting
known-valid assignments into the assertion table is more interesting.

Bryce> So, if we have, say, a Foo[] being assigned to a Bar[], we strip off
Bryce> the array type and just emit Foo->Bar?

Yes.

Tom



More information about the Java-patches mailing list