--- a/hotspot/src/share/vm/opto/macro.cpp Fri Dec 05 15:16:01 2014 +0100
+++ b/hotspot/src/share/vm/opto/macro.cpp Tue Nov 25 17:33:59 2014 +0100
@@ -971,7 +971,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);