Escape analysis was recently added to Compiler2. However there are currently no
optimizations which take advantage of it. Adding an optimization to eliminate
locking and unlocking of unescaped objects is an easy, safe optimization to
take advantage of escape analysis.
Eliminating locking on unescaped objects has been added. As part of this change,
the bytecode escape estimator was added. Without it, almost no opportunities for
this optimization are detected.
This optimization is only effective when the DoEscapeAnalysis flag is turned on
(it is off by default.)