From 173f556ccc41ea93cf66896d0c7778241467407f Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Tue, 7 Mar 2000 08:58:26 +0000 Subject: decl.c (init_decl_processing): Added new class fields `depth', `ancestors', and `idt' to class_type_node. 2000-03-06 Bryce McKinlay * decl.c (init_decl_processing): Added new class fields `depth', `ancestors', and `idt' to class_type_node. Use _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node. * class.c (make_class_data): Push initial values for new fields. * java-tree.h: Updated prototype for `build_invokeinterface'. * expr.c (build_invokeinterface): Changed parameters to accept `method' tree. Calculate index of `method' in its declaring interface. Build call to _Jv_LookupInterfaceMethodIdx. (expand_invoke): Call `build_invokeinterface' with new parameters. * parse.y (patch_invoke): Call `build_invokeinterface' with new parameters. (This is Bryce McKinlay's implementation of the interfaces constant-time dispatch and type checking techniques designed by Per Bothner.) From-SVN: r32381 --- gcc/java/decl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/java/decl.c') diff --git a/gcc/java/decl.c b/gcc/java/decl.c index f258ed8..17ec135 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -661,6 +661,9 @@ init_decl_processing () PUSH_FIELD (class_type_node, field, "interface_count", short_type_node); PUSH_FIELD (class_type_node, field, "state", byte_type_node); PUSH_FIELD (class_type_node, field, "thread", ptr_type_node); + PUSH_FIELD (class_type_node, field, "depth", short_type_node); + PUSH_FIELD (class_type_node, field, "ancestors", ptr_type_node); + PUSH_FIELD (class_type_node, field, "idt", ptr_type_node); for (t = TYPE_FIELDS (class_type_node); t != NULL_TREE; t = TREE_CHAIN (t)) FIELD_PRIVATE (t) = 1; push_super_field (class_type_node, object_type_node); @@ -815,9 +818,9 @@ init_decl_processing () 0, NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, - tree_cons (NULL_TREE, ptr_type_node, endlink))); + tree_cons (NULL_TREE, int_type_node, endlink))); soft_lookupinterfacemethod_node - = builtin_function ("_Jv_LookupInterfaceMethod", + = builtin_function ("_Jv_LookupInterfaceMethodIdx", build_function_type (ptr_type_node, t), 0, NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, double_type_node, -- cgit v1.1