aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2006-06-08 14:01:40 +0000
committerAndrew Haley <aph@gcc.gnu.org>2006-06-08 14:01:40 +0000
commit313ab5ee9c2616aa6c3058cf992d2f69b52fc2db (patch)
tree06de34fc6cdfcf4bb3efea134a03b6b617bab797 /gcc/java/class.c
parent297750da0393e5542752140f9ad5abb924f6305e (diff)
downloadgcc-313ab5ee9c2616aa6c3058cf992d2f69b52fc2db.zip
gcc-313ab5ee9c2616aa6c3058cf992d2f69b52fc2db.tar.gz
gcc-313ab5ee9c2616aa6c3058cf992d2f69b52fc2db.tar.bz2
expr.c (build_field_ref): Pass NULL_TREE as SPECIAL arg to get_symbol_table_index().
2006-06-08 Andrew Haley <aph@redhat.com> * expr.c (build_field_ref): Pass NULL_TREE as SPECIAL arg to get_symbol_table_index(). (maybe_rewrite_invocation): Set SPECIAL if we need to access a private method. (build_known_method_ref): New arg: special. Pass it to get_symbol_table_index. (get_symbol_table_index): Put SPECIAL in the TREE_PURPOSE field of the method list. (build_invokevirtual): New arg: special. Pass it to get_symbol_table_index. (expand_invoke): New variable: special. Pass it to maybe_rewrite_invocation(). Pass it to build_known_method_ref(). * class.c (build_symbol_entry): Add new arg: special. Use it to build the symbol table conbstructor. (emit_symbol_table): Extract SPECIAL from the method list and pass it to build_symbol_entry(). * parse.y (patch_invoke): Call maybe_rewrite_invocation() and set special accordingly. From-SVN: r114487
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 403318a..44f435c 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -62,7 +62,7 @@ static int supers_all_compiled (tree type);
static tree maybe_layout_super_class (tree, tree);
static void add_miranda_methods (tree, tree);
static int assume_compiled (const char *);
-static tree build_symbol_entry (tree);
+static tree build_symbol_entry (tree, tree);
static tree emit_assertion_table (tree);
static void register_class (void);
@@ -2651,7 +2651,7 @@ emit_register_classes (tree *list_p)
/* Make a symbol_type (_Jv_MethodSymbol) node for DECL. */
static tree
-build_symbol_entry (tree decl)
+build_symbol_entry (tree decl, tree special)
{
tree clname, name, signature, sym;
clname = build_utf8_ref (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))));
@@ -2667,6 +2667,12 @@ build_symbol_entry (tree decl)
signature = build_utf8_ref (unmangle_classname
(IDENTIFIER_POINTER (signature),
IDENTIFIER_LENGTH (signature)));
+ /* SPECIAL is either NULL_TREE or integer_one_node. We emit
+ signature addr+1 if SPECIAL, and this indicates to the runtime
+ system that this is a "special" symbol, i.e. one that should
+ bypass access controls. */
+ if (special != NULL_TREE)
+ signature = build2 (PLUS_EXPR, TREE_TYPE (signature), signature, special);
START_RECORD_CONSTRUCTOR (sym, symbol_type);
PUSH_FIELD_VALUE (sym, "clname", clname);
@@ -2701,8 +2707,9 @@ emit_symbol_table (tree name, tree the_table, tree decl_list,
list = NULL_TREE;
while (method_list != NULL_TREE)
{
+ tree special = TREE_PURPOSE (method_list);
method = TREE_VALUE (method_list);
- list = tree_cons (NULL_TREE, build_symbol_entry (method), list);
+ list = tree_cons (NULL_TREE, build_symbol_entry (method, special), list);
method_list = TREE_CHAIN (method_list);
index++;
}