Projects

Kresten Krab Thorup krab@eos.dk
Tue May 9 23:25:00 GMT 2000


"Boehm, Hans" wrote:

> I'm pretty sure you won't catch a Java compiler generating a .class file in
> which _Jv_MonitorEnter() and _Jv_MonitorExit() don't nest.  The question is
> whether a hand generated .class file, or one generated by some non-Java
> compiler should compile correctly.  According to the original version of
> "The Java Virtual Machine Specification", I believe the answer was "yes".
> Whether that has been changed, I don't know.

With the new JVM spec, the verifier is allowed to reject a class file in which
monitor operations do not nest.  It does not have to reject such files, but
I know that for example the HotSpot VM will reject such class files.  The
reason is that the HotSpot VM allocates monitor objects on the call stack, and
I beleive the HotSpot team did the lobbying to have this restriction in the VM
Spec.  [a "locked object" also has it's gc info moved to the stack, so they
only need room for one word in each object to administer both]

-- Kresten
                 WHO'S AT JAOO? - http://www.jaoo.dk
-----------------------------------------------------------------------
Eastfork Object Space (EOS), Margrethepladsen 3, 8000  Århus C, Denmark
Tel: +45 8732 8787 / Fax: +45 8732 8788 / Mob: +45 2343 4626





More information about the Java mailing list