parse.h (BUILD_THROW): Add support for sjlj-exceptions.
authorAndrew Haley <aph@cygnus.com>
Fri, 10 Dec 1999 16:06:23 +0000 (16:06 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 10 Dec 1999 16:06:23 +0000 (16:06 +0000)
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.

From-SVN: r30859

gcc/java/ChangeLog
gcc/java/decl.c
gcc/java/expr.c
gcc/java/java-tree.h
gcc/java/jcf-write.c
gcc/java/parse.h

index f8df0fe9255b309b3ca9ea817f879d9b237174af..2a9a10b813ea85545575ec1b40a517a39e5c8f08 100644 (file)
@@ -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
index 4d6ecbd579c213c566401eab67e8d8cfc1d5a644..85b64e581fa35f3df4c01e44048ccec7f742dcfa 100644 (file)
@@ -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,
index 1b1cad2eeafbcc653c35638265f296cdd7adf119..c7332a52b073db0f4270e96b61df8cfb42324f19 100644 (file)
@@ -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;
index 7c646e6ff88aa6d9791827bda32d92bd2a318637..a76439800aa519f59cee2484ebc7209eb58316f8 100644 (file)
@@ -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;
index a3710416ee697b787b8566af20818dc18799ce92..8c39c6120ea4585cacdf2d7d2599b6ccda899f46 100644 (file)
@@ -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;
index f4c05e948b171435d9f2158c5b19ce691d3659bf..692b33e963158caa553c22c58a6385760c3ce9d8 100644 (file)
@@ -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;                                   \
   }