diff src/share/vm/opto/macro.cpp @ 20705:d3f3f7677537

6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94 Summary: OOM during reallocation of scalar replaced objects in deoptimization causes crashes Reviewed-by: kvn, jrose
author roland
date Tue, 25 Nov 2014 17:33:59 +0100
parents e7b3d177adda
children 7848fc12602b
line wrap: on
line diff
--- 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);