summaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>1999-12-10 16:06:23 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>1999-12-10 16:06:23 +0000
commit37c32b0a09c933aca9cc761769ece6b1a928c586 (patch)
tree47d721442246f0cf2bfbddf397cdc82c91b72932 /gcc/java
parent7d1fa5a79d649b20e4f913a2fc140e9412bd869c (diff)
downloadgcc-37c32b0a09c933aca9cc761769ece6b1a928c586.tar.gz
1999-11-17 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/decl.c20
-rw-r--r--gcc/java/expr.c5
-rw-r--r--gcc/java/java-tree.h2
-rw-r--r--gcc/java/jcf-write.c3
-rw-r--r--gcc/java/parse.h2
6 files changed, 28 insertions, 12 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f8df0fe9255..2a9a10b813e 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,11 @@
+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
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 4d6ecbd579c..85b64e581fa 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -337,7 +337,7 @@ tree soft_newarray_node;
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;
@@ -706,12 +706,18 @@ init_decl_processing ()
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,
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 1b1cad2eeaf..c7332a52b07 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -523,7 +523,8 @@ java_stack_dup (size, offset)
}
}
-/* 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)
@@ -533,7 +534,7 @@ 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;
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 7c646e6ff88..a76439800aa 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -269,7 +269,7 @@ extern tree soft_newarray_node;
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;
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index a3710416ee6..8c39c6120ea 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2451,7 +2451,8 @@ generate_bytecode_insns (exp, target, state)
}
else if (f == soft_monitorenter_node
|| f == soft_monitorexit_node
- || f == throw_node)
+ || f == throw_node[0]
+ || f == throw_node[1])
{
if (f == soft_monitorenter_node)
op = OPCODE_monitorenter;
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index f4c05e948b1..692b33e9631 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -534,7 +534,7 @@ typedef struct _jdeplist {
#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; \
}