diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-07 21:10:49 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-07 21:10:49 +0000 |
| commit | 2e18d182dfcb13eb14b09a9dd8fea8f7d7bffd2b (patch) | |
| tree | 9d0e7f2e3d8eea9278d7553dc439c5ea0969d3da /gcc/java/verify-glue.c | |
| parent | 376d874ca307abf96dfa8e3fe55525dd3a653cbd (diff) | |
| download | ppe42-gcc-2e18d182dfcb13eb14b09a9dd8fea8f7d7bffd2b.tar.gz ppe42-gcc-2e18d182dfcb13eb14b09a9dd8fea8f7d7bffd2b.zip | |
2005-03-04 Bryce McKinlay <mckinlay@redhat.com>
* verify-glue.c (vfy_is_assignable_from): Perform static check using
can_widen_reference_to if the C++ ABI is in use.
(vfy_get_interface_count, vfy_get_interface): Remove unused functions.
* verify-impl.c (debug_print, make_utf8_const, init_type, copy_type,
type_isresolved, init_state, set_pc, state_get_pc,
_Jv_BytecodeVerifier): Clean up unused and disabled functions.
(verify_fail): Report the current PC from the verifier context.
(free_state): Remove #if 0 block to enable this function.
(free_verifier_context): Call free_state on state_list iterator
values before freeing them.
* expr.c (pop_type_0): Pop correct type for error message when stack
contains a multi-word type.
2005-03-04 Ranjit Mathew <rmathew@hotmail.com>
* expr.c (build_java_array_length_access): Remove !flag_new_verifier
for known NULL array length access.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96044 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/verify-glue.c')
| -rw-r--r-- | gcc/java/verify-glue.c | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c index 5d480e88d68..b1664ba991a 100644 --- a/gcc/java/verify-glue.c +++ b/gcc/java/verify-glue.c @@ -231,17 +231,18 @@ vfy_get_class_name (vfy_jclass klass) bool vfy_is_assignable_from (vfy_jclass target, vfy_jclass source) { - /* At compile time, for the BC-ABI we assume that reference types are always - compatible. However, a type assertion table entry is emitted so that the - runtime can detect binary-incompatible changes. */ - - /* FIXME: implement real test for old ABI. */ - /* Any class is always assignable to itself, or java.lang.Object. */ if (source == target || target == object_type_node) return true; - /* Otherwise, a type assertion is required. */ + /* For the C++ ABI, perform this test statically. */ + if (! flag_indirect_dispatch) + return can_widen_reference_to (source, target); + + /* For the BC-ABI, we assume at compile time that reference types are always + compatible. However, a type assertion table entry is emitted so that the + runtime can detect binary-incompatible changes. */ + add_type_assertion (current_class, JV_ASSERT_TYPES_COMPATIBLE, source, target); return true; @@ -257,28 +258,6 @@ vfy_get_primitive_char (vfy_jclass klass) return (IDENTIFIER_POINTER (sig))[0]; } -int -vfy_get_interface_count (vfy_jclass klass ATTRIBUTE_UNUSED) -{ - /* FIXME: Need to merge from mainline to get this. */ - #if 0 - return BINFO_N_BASE_BINFOS (klass); - #endif - return -1; -} - -vfy_jclass -vfy_get_interface (vfy_jclass klass ATTRIBUTE_UNUSED, int index ATTRIBUTE_UNUSED) -{ - /* FIXME: Need to merge from mainline to get this. */ - #if 0 - vfy_jclass k; - k = BINFO_BASE_BINFO (klass, index); - return k; - #endif - return NULL; -} - bool vfy_is_array (vfy_jclass klass) { |

