diff -r 8c08b28b7eee -r d3f3f7677537 src/share/vm/opto/macro.cpp --- a/src/share/vm/opto/macro.cpp Thu Dec 11 10:38:17 2014 +0000 +++ b/src/share/vm/opto/macro.cpp Tue Nov 25 17:33:59 2014 +0100 @@ -964,7 +964,11 @@ } bool PhaseMacroExpand::eliminate_allocate_node(AllocateNode *alloc) { - if (!EliminateAllocations || !alloc->_is_non_escaping) { + // Don't do scalar replacement if the frame can be popped by JVMTI: + // if reallocation fails during deoptimization we'll pop all + // interpreter frames for this compiled frame and that won't play + // nice with JVMTI popframe. + if (!EliminateAllocations || JvmtiExport::can_pop_frame() || !alloc->_is_non_escaping) { return false; } Node* klass = alloc->in(AllocateNode::KlassNode);