Request for reviews (S): 6681646: Relocking of a scalar replaced object during deoptimization is broken

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Mon Mar 31 10:14:48 PDT 2008


I want this for HS12 (if approved).

http://webrev.invokedynamic.info/kvn/6680665/index.html

Fixed 66681646: Relocking of a scalar replaced object during deoptimization is broken

Problem:
The test failed when trying exit the monitor after deoptimization
of the compiled method with eliminated lock.

When scalarized object is reallocated the mark word is set to
klass->prototype_header() by default. Which can have biased pattern.
Also if the object is not scalarized but only thread-local
the method revoke_biases_of_monitors() will relock it
before relock_objects() is called.

The lock should not be biased in order to safely move
the displaced mark word from the compiled frame
to the vframeArray and back to the interpreted frame.


Solution:
Add the check into relock_objects() to do nothing that if an object
is locked already.
Call fast_enter() in relock_objects() to relock an object - it
will revoke biased lock if needed.
Put reallocate and relock code under (fr->scope() != NULL) check
to avoid reference through NULL.

Reviewed by:
Fix verified (y/n): y, failed test cases.

Other testing:
JPRT, CTW, NSK tests




More information about the hotspot-compiler-dev mailing list