Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Machine > Re: Weird entry...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 784 of 843
Post > Topic >>

Re: Weird entry in the exception table for monitorenter/monitorexit

by Roedy Green <see_website@[EMAIL PROTECTED] > Jul 19, 2007 at 12:53 AM

On Wed, 18 Jul 2007 05:16:46 -0700, Douwe <dmvos2000@[EMAIL PROTECTED]
> wrote,
quoted or indirectly quoted someone who said :

>result (I've removed the parts that are irrelevant)
>
>  public void test();
>     0  ldc <Class TestClass> [1]
>     2  dup
>     3  astore_1
>     4  monitorenter
>     5  aload_0 [this]
>     6  iconst_1
>     7  putfield TestClass.a : int [12]
>    10  aload_1
>    11  monitorexit
>    12  goto 18
>    15  aload_1
>    16  monitorexit
>    17  athrow
>    18  return
>      Exception Table:
>        [pc: 5, pc: 12] -> 15 when : any
>        [pc: 15, pc: 17] -> 15 when : any
>
>I do understand that after the monitor is entered it is very im****tant
>that it leaves it again with the instruction monitorexit. In normal
>case where no exceptions occur it will call monitorexit at the address
>11. But if an exception occurs it has to make sure monitorexit is
>called and therefore the exception table defines in the first entry
>that on any exception the VM jumps to address 15. Until here
>everything is understandable, but what is the second entry in the
>exception table telling me? if an exception occurs betweern 15 and 17
>then jump to 15 ... doesn't this cause an endless loop?

I will make a guess that the implementation of exception propagation
checks for a "in monitor" bit and deals with it.
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 




 2 Posts in Topic:
Weird entry in the exception table for monitorenter/monitorexit
Douwe <dmvos2000@[EMAI  2007-07-18 05:16:46 
Re: Weird entry in the exception table for monitorenter/monitore
Roedy Green <see_websi  2007-07-19 00:53:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:37:41 CST 2008.