[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Question re. compilation of exceptions/monitors in Jimple (fwd)



Hello Jean-Pierre,

The monitor will not be automatically released by the JVM. The monitor must
be released explicitly by the exception handler. Although you are evidently
working with RTJ, you will find a good discusion on monitor and exception
code generation in the JVM specification 2nd edition page 394 Chapter 7.14.

I have some problems understanding how the Jimple code is produced. Looking
at the Java source code, the compiler (at any rate javac) need not have
produced the monitorenter and monitorexit instructions. If the compiler had
indeed produced this bytecode (i.e. not handcrafted), I would say it is a
compiler bug.

Regards,
Stephen Cheng


> -----Original Message-----
> From: owner-soot-list@sable.mcgill.ca
> [mailto:owner-soot-list@sable.mcgill.ca]On Behalf Of Prof. Laurie
> HENDREN
> Sent: 24 April 2002 17:26
> To: soot-list@sable.mcgill.ca
> Subject: Question re. compilation of exceptions/monitors in Jimple (fwd)
>
>
>
>
> +-------------------------------------------------------------+
> | Professor Laurie Hendren, School of Computer Science        |
> | McGill University                                           |
> | 318 McConnell Engineering Building      tel: (514) 398-7391 |
> | 3480 University Street                  fax: (514) 398-3883 |
> | Montreal, Quebec H3A 2A7               hendren@cs.mcgill.ca |
> | CANADA                  http://www.sable.mcgill.ca/~hendren |
> +-------------------------------------------------------------+
>
> ---------- Forwarded message ----------
> Date: Wed, 24 Apr 2002 18:17:17 +0200
> From: Jean-Pierre Talpin <Jean-Pierre.Talpin@irisa.fr>
> To: hendren@sable.mcgill.ca
> Subject: Question re. compilation of exceptions/monitors in Jimple
>
> Dear Laurie Hendren,
>
> I would have a technical question regarding the translation of
> exceptions/monitors in
> Jimple. Sorry for addressing it directly to you, may be you could
> just pass it to the person
> who implements/maintain Jimple.
>
> The question is about the interaction between exceptions and
> monitors. It works perfectly in
> almost all programs we have compiled/tested so far.  There is one
> example (attached) in
> which we do not know or understand whether a monitor should be
> released or not
> (enter/release of monitors are vital in the use we are making of
> Jimple, as they mark
> (blocks of) atomic transitions for our model-checker).
>
> In the example (method called ''essai''), consider the
> ''exception from label0 to label14
> with label15'' statement and the program label4. At label4,
> monitor r9 is entered. When the
> goto from label4 to label10 is performed, exception r23 is thrown
> and catched by label15.
> But monitor r9 is not released by label15 or label16? Is this a
> correct understanding of the
> handling of r23 at label10, or is label12 invoked instead of
> label15 (from ''throwable from
> label2 to label11 with label12'') ?
>
> Best regards,
>
> Jean-Pierre.
>
>