+1999-12-10 Andrew Haley <aph@cygnus.com>
+
+ * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
+ decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
+ expr.c (build_java_athrow): Add support for sjlj-exceptions.
+ java-tree.h: Ditto.
+ jcf-write.c: Ditto.
+
1999-12-5 Anthony Green <green@cygnus.com>
* decl.c (init_decl_processing): Mark throw_node as a noreturn
tree soft_anewarray_node;
tree soft_multianewarray_node;
tree soft_badarrayindex_node;
-tree throw_node;
+tree throw_node [2];
tree soft_checkarraystore_node;
tree soft_monitorenter_node;
tree soft_monitorexit_node;
0, NOT_BUILT_IN,
NULL_PTR);
t = tree_cons (NULL_TREE, ptr_type_node, endlink);
- throw_node = builtin_function ("_Jv_Throw",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL_PTR);
- /* Mark throw_node as a `noreturn' function with side effects. */
- TREE_THIS_VOLATILE (throw_node) = 1;
- TREE_SIDE_EFFECTS (throw_node) = 1;
+ 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,
}
}
-/* Calls _Jv_Throw. Discard the contents of the value stack. */
+/* Calls _Jv_Throw or _Jv_Sjlj_Throw. Discard the contents of the
+ value stack. */
static void
build_java_athrow (node)
call = build (CALL_EXPR,
void_type_node,
- build_address_of (throw_node),
+ build_address_of (throw_node[exceptions_via_longjmp ? 1 : 0]),
build_tree_list (NULL_TREE, node),
NULL_TREE);
TREE_SIDE_EFFECTS (call) = 1;
extern tree soft_anewarray_node;
extern tree soft_multianewarray_node;
extern tree soft_badarrayindex_node;
-extern tree throw_node;
+extern tree throw_node[];
extern tree soft_checkarraystore_node;
extern tree soft_monitorenter_node;
extern tree soft_monitorexit_node;
#define BUILD_THROW(WHERE, WHAT) \
{ \
(WHERE) = build (CALL_EXPR, void_type_node, \
- build_address_of (throw_node), \
+ build_address_of (throw_node[exceptions_via_longjmp ? 1 : 0]), \
build_tree_list (NULL_TREE, (WHAT)), NULL_TREE); \
TREE_SIDE_EFFECTS ((WHERE)) = 1; \
}