This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
ia64 eh, part 19 [java]
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Subject: ia64 eh, part 19 [java]
- From: Richard Henderson <rth at redhat dot com>
- Date: Wed, 28 Mar 2001 00:58:19 -0800
In the upcoming libjava patch, I got rid of the distinction
between _Jv_Throw and _Jv_Sjlj_Throw. But even if I hadn't
this would be a worthwhile cleanup.
r~
* java-tree.h (throw_node): Define as a single member of
java_global_trees instead of a separate array.
(JTI_THROW_NODE): New.
* decl.c (throw_node): Don't declare.
(init_decl_processing): Init a scalar throw_node.
Don't register it for gc.
* check-init.c (check_init): Reference scalar throw_node.
* expr.c (build_java_athrow): Likewise.
* jcf-write.c (generate_bytecode_insns): Likewise.
* parse.h (BUILD_THROW): Likewise.
Index: check-init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/check-init.c,v
retrieving revision 1.27
diff -c -p -d -r1.27 check-init.c
*** check-init.c 2001/02/08 03:45:14 1.27
--- check-init.c 2001/03/28 08:51:49
*************** check_init (exp, before)
*** 694,701 ****
for ( ; x != NULL_TREE; x = TREE_CHAIN (x))
check_init (TREE_VALUE (x), before);
! if (func == throw_node[0]
! || func == throw_node[1])
goto never_continues;
}
break;
--- 694,700 ----
for ( ; x != NULL_TREE; x = TREE_CHAIN (x))
check_init (TREE_VALUE (x), before);
! if (func == throw_node)
goto never_continues;
}
break;
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.97
diff -c -p -d -r1.97 decl.c
*** decl.c 2001/03/28 08:38:22 1.97
--- decl.c 2001/03/28 08:51:49
*************** tree decl_map;
*** 72,79 ****
static tree pending_local_decls = NULL_TREE;
- tree throw_node [2];
-
/* Push a local variable or stack slot into the decl_map,
and assign it an rtl. */
--- 72,77 ----
*************** init_decl_processing ()
*** 727,744 ****
t),
0, NOT_BUILT_IN,
NULL_PTR);
! throw_node[0] = builtin_function ("_Jv_Throw",
! build_function_type (ptr_type_node, t),
! 0, NOT_BUILT_IN, NULL_PTR);
/* Mark throw_nodes as `noreturn' functions with side effects. */
! TREE_THIS_VOLATILE (throw_node[0]) = 1;
! TREE_SIDE_EFFECTS (throw_node[0]) = 1;
! t = tree_cons (NULL_TREE, ptr_type_node, endlink);
! throw_node[1] = builtin_function ("_Jv_Sjlj_Throw",
! build_function_type (ptr_type_node, t),
! 0, NOT_BUILT_IN, NULL_PTR);
! TREE_THIS_VOLATILE (throw_node[1]) = 1;
! TREE_SIDE_EFFECTS (throw_node[1]) = 1;
t = build_function_type (int_type_node, endlink);
soft_monitorenter_node
= builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
--- 725,737 ----
t),
0, NOT_BUILT_IN,
NULL_PTR);
! throw_node = builtin_function ((USING_SJLJ_EXCEPTIONS
! ? "_Jv_Throw" : "_Jv_Sjlj_Throw"),
! build_function_type (ptr_type_node, t),
! 0, NOT_BUILT_IN, NULL_PTR);
/* Mark throw_nodes as `noreturn' functions with side effects. */
! TREE_THIS_VOLATILE (throw_node) = 1;
! TREE_SIDE_EFFECTS (throw_node) = 1;
t = build_function_type (int_type_node, endlink);
soft_monitorenter_node
= builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
*************** init_decl_processing ()
*** 884,891 ****
/* Register nodes with the garbage collector. */
ggc_add_tree_root (java_global_trees,
sizeof (java_global_trees) / sizeof (tree));
- ggc_add_tree_root (throw_node,
- sizeof (throw_node) / sizeof (tree));
ggc_add_tree_root (predef_filenames,
sizeof (predef_filenames) / sizeof (tree));
ggc_add_tree_root (&decl_map, 1);
--- 877,882 ----
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.105
diff -c -p -d -r1.105 expr.c
*** expr.c 2001/03/28 05:24:23 1.105
--- expr.c 2001/03/28 08:51:49
*************** build_java_athrow (node)
*** 600,606 ****
call = build (CALL_EXPR,
void_type_node,
! build_address_of (throw_node[USING_SJLJ_EXCEPTIONS ? 1 : 0]),
build_tree_list (NULL_TREE, node),
NULL_TREE);
TREE_SIDE_EFFECTS (call) = 1;
--- 600,606 ----
call = build (CALL_EXPR,
void_type_node,
! build_address_of (throw_node),
build_tree_list (NULL_TREE, node),
NULL_TREE);
TREE_SIDE_EFFECTS (call) = 1;
Index: java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.106
diff -c -p -d -r1.106 java-tree.h
*** java-tree.h 2001/03/24 01:13:30 1.106
--- java-tree.h 2001/03/28 08:51:49
*************** enum java_tree_index
*** 321,326 ****
--- 321,327 ----
JTI_END_PARAMS_NODE,
+ JTI_THROW_NODE,
JTI_ALLOC_OBJECT_NODE,
JTI_SOFT_INSTANCEOF_NODE,
JTI_SOFT_CHECKCAST_NODE,
*************** extern tree java_global_trees[JTI_MAX];
*** 544,549 ****
--- 545,552 ----
java_global_trees[JTI_END_PARAMS_NODE]
/* References to internal libjava functions we use. */
+ #define throw_node \
+ java_global_trees[JTI_THROW_NODE]
#define alloc_object_node \
java_global_trees[JTI_ALLOC_OBJECT_NODE]
#define soft_instanceof_node \
*************** extern tree java_global_trees[JTI_MAX];
*** 562,568 ****
java_global_trees[JTI_SOFT_BADARRAYINDEX_NODE]
#define soft_nullpointer_node \
java_global_trees[JTI_SOFT_NULLPOINTER_NODE]
- extern tree throw_node[];
#define soft_checkarraystore_node \
java_global_trees[JTI_SOFT_CHECKARRAYSTORE_NODE]
#define soft_monitorenter_node \
--- 565,570 ----
Index: jcf-write.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-write.c,v
retrieving revision 1.75
diff -c -p -d -r1.75 jcf-write.c
*** jcf-write.c 2001/03/24 01:13:29 1.75
--- jcf-write.c 2001/03/28 08:51:50
*************** generate_bytecode_insns (exp, target, st
*** 2513,2520 ****
}
else if (f == soft_monitorenter_node
|| f == soft_monitorexit_node
! || f == throw_node[0]
! || f == throw_node[1])
{
if (f == soft_monitorenter_node)
op = OPCODE_monitorenter;
--- 2513,2519 ----
}
else if (f == soft_monitorenter_node
|| f == soft_monitorexit_node
! || f == throw_node)
{
if (f == soft_monitorenter_node)
op = OPCODE_monitorenter;
Index: parse.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.h,v
retrieving revision 1.69
diff -c -p -d -r1.69 parse.h
*** parse.h 2001/03/28 05:24:23 1.69
--- parse.h 2001/03/28 08:51:50
*************** typedef struct _jdeplist {
*** 669,681 ****
TREE_SIDE_EFFECTS (WHERE) = 1; \
}
! #define BUILD_THROW(WHERE, WHAT) \
! { \
! (WHERE) = \
! build (CALL_EXPR, void_type_node, \
! build_address_of (throw_node[USING_SJLJ_EXCEPTIONS ? 1 : 0]), \
! build_tree_list (NULL_TREE, (WHAT)), NULL_TREE); \
! TREE_SIDE_EFFECTS ((WHERE)) = 1; \
}
/* Set wfl_operator for the most accurate error location */
--- 669,681 ----
TREE_SIDE_EFFECTS (WHERE) = 1; \
}
! #define BUILD_THROW(WHERE, WHAT) \
! { \
! (WHERE) = \
! build (CALL_EXPR, void_type_node, \
! build_address_of (throw_node), \
! build_tree_list (NULL_TREE, (WHAT)), NULL_TREE); \
! TREE_SIDE_EFFECTS ((WHERE)) = 1; \
}
/* Set wfl_operator for the most accurate error location */