This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Rewrite exception region handling in bytecode compiler
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Apr 2005 16:17:39 +0100
- Subject: Re: Rewrite exception region handling in bytecode compiler
- References: <16996.5477.350278.276241@cuddles.cambridge.redhat.com>
A little bit more is needed to use this patch on the gcc4 branch:
this is because the sorting is no longer necessary, and messes up the
exception ranges.
Andrew.
2005-04-28 Andrew Haley <aph@redhat.com>
PR java/20768
* verify.c (verify_jvm_instructions): Remove call to
handle_nested_ranges.
(start_pc_cmp): Remove function.
(verify_jvm_instructions): Remove PC sorting of exception regions.
Index: verify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/verify.c,v
retrieving revision 1.69
diff -c -2 -p -r1.69 verify.c
*** verify.c 10 Jan 2005 18:14:36 -0000 1.69
--- verify.c 28 Apr 2005 15:15:22 -0000
*************** static tree merge_types (tree, tree);
*** 46,50 ****
static const char *check_pending_block (tree);
static void type_stack_dup (int, int);
- static int start_pc_cmp (const void *, const void *);
static char *pop_argument_types (tree);
--- 46,49 ----
*************** struct pc_index
*** 347,359 ****
};
- /* A helper that is used when sorting exception ranges. */
- static int
- start_pc_cmp (const void *xp, const void *yp)
- {
- const struct pc_index *x = (const struct pc_index *) xp;
- const struct pc_index *y = (const struct pc_index *) yp;
- return x->start_pc - y->start_pc;
- }
-
/* This causes the next iteration to ignore the next instruction
and look for some other unhandled instruction. */
--- 346,349 ----
*************** verify_jvm_instructions (JCF* jcf, const
*** 449,454 ****
eh_count = JCF_readu2 (jcf);
- /* We read the exception handlers in order of increasing start PC.
- To do this we first read and sort the start PCs. */
starts = xmalloc (eh_count * sizeof (struct pc_index));
for (i = 0; i < eh_count; ++i)
--- 439,442 ----
*************** verify_jvm_instructions (JCF* jcf, const
*** 457,461 ****
starts[i].index = i;
}
- qsort (starts, eh_count, sizeof (struct pc_index), start_pc_cmp);
for (i = 0; i < eh_count; ++i)
--- 445,448 ----
*************** verify_jvm_instructions (JCF* jcf, const
*** 492,496 ****
free (starts);
- handle_nested_ranges ();
for (PC = 0;;)
--- 479,482 ----