summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1998-11-26 12:55:03 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1998-11-26 12:55:03 +0000
commitf39c74e463722d8b787b27d03458ad29da7b1c8a (patch)
tree86f275cc3e71337fcb2c2b879b9ed757b2d4bbf3 /gcc
parent763d326791e319f789de36e5610c2d2d187a6df8 (diff)
downloadgcc-f39c74e463722d8b787b27d03458ad29da7b1c8a.tar.gz
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). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/jcf-write.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 8f53fd3cbcd..6b987885058 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -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. */