hotspot/src/share/vm/opto/macro.cpp
changeset 28039 bf5a8340bf8a
parent 27645 8fe155d119af
child 28643 a665e19ca007
--- 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);