--- old/src/share/vm/opto/library_call.cpp Mon Jul 6 17:13:55 2009 +++ new/src/share/vm/opto/library_call.cpp Mon Jul 6 17:13:55 2009 @@ -3223,6 +3223,11 @@ } if (!stopped()) { + //set the original stack and the restart bit for deopt to restart + _sp += nargs; + assert(!jvms()->is_restart(), "restart should not have been set (?)"); + jvms()->set_restart(true); + // How many elements will we copy from the original? // The answer is MinI(orig_length - start, length). Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) ); @@ -3229,7 +3234,7 @@ Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length); const bool raw_mem_only = true; - Node* newcopy = new_array(klass_node, length, nargs, raw_mem_only); + Node* newcopy = new_array(klass_node, length, 0, raw_mem_only); // Generate a direct call to the right arraycopy function(s). // We know the copy is disjoint but we might not know if the @@ -3241,6 +3246,8 @@ generate_arraycopy(TypeAryPtr::OOPS, T_OBJECT, original, start, newcopy, intcon(0), moved, disjoint_bases, length_never_negative); + _sp -= nargs; + jvms()->set_restart(false); push(newcopy); } @@ -4025,6 +4032,11 @@ int raw_adr_idx = Compile::AliasIdxRaw; const bool raw_mem_only = true; + //set the original stack and the restart bit for deopt to restart + _sp += nargs; + assert(!jvms()->is_restart(), "restart should not have been set (?)"); + jvms()->set_restart(true); + Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL); if (array_ctl != NULL) { // It's an array. @@ -4129,6 +4141,9 @@ result_mem ->set_req(_slow_path, reset_memory()); } + _sp -= nargs; + jvms()->set_restart(false); + // Return the combined state. set_control( _gvn.transform(result_reg) ); set_i_o( _gvn.transform(result_i_o) );