]> gcc.gnu.org Git - gcc.git/commitdiff
jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle soft_monitorenter_node...
authorPer Bothner <bothner@gcc.gnu.org>
Thu, 26 Nov 1998 12:55:03 +0000 (04:55 -0800)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 26 Nov 1998 12:55:03 +0000 (04:55 -0800)
H
* jcf-write.c (generate_bytecode_insns):  In Call_EXPR, handle
soft_monitorenter_node, soft_monitorexit_node, throw_node.
   Handle pre/post-increment/decrement of long.
Handle missing exception handler (finally for synchronized).

From-SVN: r23903

gcc/java/jcf-write.c

index 8f53fd3cbcdf5148ee627fcbff139cdb24e6a112..6b987885058219bea101659fb73e65dc0b38764b 100644 (file)
@@ -1696,8 +1696,11 @@ generate_bytecode_insns (exp, target, state)
       /* Stack, if ARRAY_REF:  ..., [result, ] array, index, oldvalue. */
       /* Stack, if COMPONENT_REF:  ..., [result, ] objectref, oldvalue. */
       /* Stack, otherwise:  ..., [result, ] oldvalue. */
-      push_int_const (value, state); /* FIXME - assumes int! */
-      NOTE_PUSH (1);
+      if (size == 1)
+       push_int_const (value, state);
+      else
+       push_long_const (value, value >= 0 ? 0 : -1, state);
+      NOTE_PUSH (size);
       emit_binop (OPCODE_iadd + adjust_typed_op (type, 3), type, state);
       if (target != IGNORE_TARGET && ! post_op)
        emit_dup (size, offset, state);
@@ -1950,7 +1953,10 @@ generate_bytecode_insns (exp, target, state)
            tree catch_clause = TREE_OPERAND (clause, 0);
            tree exception_decl = BLOCK_EXPR_DECLS (catch_clause);
            struct jcf_handler *handler = alloc_handler (start_label, end_label, state);
-           handler->type = TREE_TYPE (TREE_TYPE (exception_decl));
+           if (exception_decl == NULL_TREE)
+             handler->type = NULL_TREE;
+           else
+             handler->type = TREE_TYPE (TREE_TYPE (exception_decl));
            generate_bytecode_insns (catch_clause, IGNORE_TARGET, state);
            if (CAN_COMPLETE_NORMALLY (catch_clause))
              emit_goto (finished_label, state);
@@ -2053,6 +2059,22 @@ generate_bytecode_insns (exp, target, state)
            OP2 (index);
            break;
          }
+       else if (f == soft_monitorenter_node
+                || f == soft_monitorexit_node
+                || f == throw_node)
+         {
+           if (f == soft_monitorenter_node)
+             op = OPCODE_monitorenter;
+           else if (f == soft_monitorexit_node)
+             op = OPCODE_monitorexit;
+           else
+             op = OPCODE_athrow;
+           generate_bytecode_insns (TREE_VALUE (x), STACK_TARGET, state);
+           RESERVE (1);
+           OP1 (op);
+           NOTE_POP (1);
+           break;
+         }
        else if (exp == soft_exceptioninfo_call_node)
          {
            NOTE_PUSH (1);  /* Pushed by exception system. */
This page took 0.06476 seconds and 5 git commands to generate.