src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/library_call.cpp	Thu Jul 16 16:02:38 2009
--- new/src/share/vm/opto/library_call.cpp	Thu Jul 16 16:02:38 2009

*** 3221,3237 **** --- 3221,3245 ---- uncommon_trap(Deoptimization::Reason_intrinsic, Deoptimization::Action_maybe_recompile); } if (!stopped()) { + Node *newcopy; + //set the original stack and the reexecute bit for the interpreter to reexecute + //the bytecode that invokes Arrays.copyOf if deoptimization happens + { + PreserveReexecuteAndSP preexecsp(this); + _sp += nargs; + jvms()->set_reexecute(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) ); 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); ! 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 // oop stores need checking. // Extreme case: Arrays.copyOf((Integer[])x, 10, String[].class).
*** 3239,3249 **** --- 3247,3257 ---- bool disjoint_bases = true; bool length_never_negative = true; generate_arraycopy(TypeAryPtr::OOPS, T_OBJECT, original, start, newcopy, intcon(0), moved, disjoint_bases, length_never_negative); + } //original reexecute and sp are set back here push(newcopy); } C->set_has_split_ifs(true); // Has chance for split-if optimization
*** 4023,4040 **** --- 4031,4055 ---- const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; int raw_adr_idx = Compile::AliasIdxRaw; const bool raw_mem_only = true; + //set the original stack and the reexecute bit for the interpreter to reexecute + //the bytecode that invokes Object.clone if deoptimization happens + { + PreserveReexecuteAndSP preexecsp(this); + _sp += nargs; + jvms()->set_reexecute(true); + Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL); if (array_ctl != NULL) { // It's an array. PreserveJVMState pjvms(this); set_control(array_ctl); Node* obj_length = load_array_length(obj); Node* obj_size = NULL; ! Node* alloc_obj = new_array(obj_klass, obj_length, nargs, ! Node* alloc_obj = new_array(obj_klass, obj_length, 0, raw_mem_only, &obj_size); if (!use_ReduceInitialCardMarks()) { // If it is an oop array, it requires very special treatment, // because card marking is required on each card of the array.
*** 4126,4135 **** --- 4141,4151 ---- result_reg->init_req(_slow_path, control()); result_val->init_req(_slow_path, slow_result); result_i_o ->set_req(_slow_path, i_o()); result_mem ->set_req(_slow_path, reset_memory()); } + } //original reexecute and sp are set back here // Return the combined state. set_control( _gvn.transform(result_reg) ); set_i_o( _gvn.transform(result_i_o) ); set_all_memory( _gvn.transform(result_mem) );

src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File