[BC ABI] Type assertions
Andrew Haley
aph@redhat.com
Mon Aug 30 13:36:00 GMT 2004
Tom Tromey writes:
> >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
>
> Andrew> This does far too much checking, in that even when we can prove at
> Andrew> compile time that an assigment is legal, we still output the
> Andrew> assertions. Some optimization required.
>
> There aren't many we can actually elide. Casts to Object; casts from
> the current class to its direct superclass or superinterfaces; and
> casts from an array type to Object, Cloneable, Serializable, and, if
> the array's component type is a reference type, Object[], Cloneable[],
> and Serializable[]. Are there any more?
It depends... If we decide to do early binding within a jarfile, we
can remove all assertions that are provable in the context of that
jar. (Yeah, I know early binding isn't strictly BC, but we'll
probably do it anyway in some cases.)
> Andrew> + verify_identifier_node = get_identifier ("<verify>");
>
> This is created but never used.
>
> Andrew> + /* Add an assertion of the form "source_type is a subclass/
> Andrew> + subinterface of target_type" to the "__verify" function of the
> Andrew> + current class. */
>
> Comment refers to a different name.
Sorry?
> Andrew> + = build_decl (FUNCTION_DECL, get_identifier ("__verify"),
>
> Probably meant verify_identifier_node here.
Yes.
Andrew.
More information about the Java-patches
mailing list