Mercurial > hg > truffle
diff src/share/vm/opto/escape.cpp @ 4777:e9a5e0a812c8
7125896: Eliminate nested locks
Summary: Nested locks elimination done before lock nodes expansion by looking for outer locks of the same object.
Reviewed-by: never, twisti
author | kvn |
---|---|
date | Sat, 07 Jan 2012 13:26:43 -0800 |
parents | 1dc233a8c7fe |
children | 73df3733f2eb |
line wrap: on
line diff
--- a/src/share/vm/opto/escape.cpp Sat Jan 07 10:39:23 2012 -0800 +++ b/src/share/vm/opto/escape.cpp Sat Jan 07 13:26:43 2012 -0800 @@ -1842,20 +1842,15 @@ Node *n = C->macro_node(i); if (n->is_AbstractLock()) { // Lock and Unlock nodes AbstractLockNode* alock = n->as_AbstractLock(); - if (!alock->is_eliminated() || alock->is_coarsened()) { + if (!alock->is_non_esc_obj()) { PointsToNode::EscapeState es = escape_state(alock->obj_node()); assert(es != PointsToNode::UnknownEscape, "should know"); if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) { - if (!alock->is_eliminated()) { - // Mark it eliminated to update any counters - alock->set_eliminated(); - } else { - // The lock could be marked eliminated by lock coarsening - // code during first IGVN before EA. Clear coarsened flag - // to eliminate all associated locks/unlocks and relock - // during deoptimization. - alock->clear_coarsened(); - } + assert(!alock->is_eliminated() || alock->is_coarsened(), "sanity"); + // The lock could be marked eliminated by lock coarsening + // code during first IGVN before EA. Replace coarsened flag + // to eliminate all associated locks/unlocks. + alock->set_non_esc_obj(); } } }