Java: [BC] Implement type assertion table
Bryce McKinlay
mckinlay@redhat.com
Thu Nov 4 23:40:00 GMT 2004
For the BC-ABI, it isn't sufficient to determine type compatibility at
compile type - if the class heirarchy changes at runtime such that a
given class is no longer assignment compatible with another class, type
safety could be violated. Instead, the runtime must be able to detect
incompatible changes and throw a verification error during class
initialization.
This patch implements type assertions for the new verifier, and changes
the way type assertions are implemented. Previously, where we'd emit an
artificial method containing the assertions as code, we now generate a
table of simple assertion entries, consisting of a 'type code' and up to
two string operands. This gives the runtime additional flexibility in
how the assertions are evaluated, as well saving space in the binary and
making it easier to ensure backwards-compatibility for binaries.
OK to commit?
Bryce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcj-type-assertion.patch
Type: text/x-patch
Size: 24910 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20041104/da50e045/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libjava-type-assertion.patch
Type: text/x-patch
Size: 5872 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20041104/da50e045/attachment-0001.bin>
More information about the Java-patches
mailing list