comparison src/share/vm/opto/library_call.cpp @ 730:9c6be3edf0dc

6589834: deoptimization problem with -XX:+DeoptimizeALot Summary: Relocate the stack pointer adjustment to where uncommon_trap is actually inserted for new_array. Reviewed-by: kvn, jrose
author cfang
date Thu, 23 Apr 2009 14:04:24 -0700
parents fbde8ec322d0
children 93c14e5562c4
comparison
equal deleted inserted replaced
729:04fa5affa478 730:9c6be3edf0dc
3053 set_control(normal_ctl); 3053 set_control(normal_ctl);
3054 if (!stopped()) { 3054 if (!stopped()) {
3055 // Normal case: The array type has been cached in the java.lang.Class. 3055 // Normal case: The array type has been cached in the java.lang.Class.
3056 // The following call works fine even if the array type is polymorphic. 3056 // The following call works fine even if the array type is polymorphic.
3057 // It could be a dynamic mix of int[], boolean[], Object[], etc. 3057 // It could be a dynamic mix of int[], boolean[], Object[], etc.
3058 _sp += nargs; // set original stack for use by uncommon_trap 3058 Node* obj = new_array(klass_node, count_val, nargs);
3059 Node* obj = new_array(klass_node, count_val);
3060 _sp -= nargs;
3061 result_reg->init_req(_normal_path, control()); 3059 result_reg->init_req(_normal_path, control());
3062 result_val->init_req(_normal_path, obj); 3060 result_val->init_req(_normal_path, obj);
3063 result_io ->init_req(_normal_path, i_o()); 3061 result_io ->init_req(_normal_path, i_o());
3064 result_mem->init_req(_normal_path, reset_memory()); 3062 result_mem->init_req(_normal_path, reset_memory());
3065 } 3063 }
3177 // How many elements will we copy from the original? 3175 // How many elements will we copy from the original?
3178 // The answer is MinI(orig_length - start, length). 3176 // The answer is MinI(orig_length - start, length).
3179 Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) ); 3177 Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) );
3180 Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length); 3178 Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length);
3181 3179
3182 _sp += nargs; // set original stack for use by uncommon_trap 3180 Node* newcopy = new_array(klass_node, length, nargs);
3183 Node* newcopy = new_array(klass_node, length);
3184 _sp -= nargs;
3185 3181
3186 // Generate a direct call to the right arraycopy function(s). 3182 // Generate a direct call to the right arraycopy function(s).
3187 // We know the copy is disjoint but we might not know if the 3183 // We know the copy is disjoint but we might not know if the
3188 // oop stores need checking. 3184 // oop stores need checking.
3189 // Extreme case: Arrays.copyOf((Integer[])x, 10, String[].class). 3185 // Extreme case: Arrays.copyOf((Integer[])x, 10, String[].class).
3901 // It's an array. 3897 // It's an array.
3902 PreserveJVMState pjvms(this); 3898 PreserveJVMState pjvms(this);
3903 set_control(array_ctl); 3899 set_control(array_ctl);
3904 Node* obj_length = load_array_length(obj); 3900 Node* obj_length = load_array_length(obj);
3905 Node* obj_size = NULL; 3901 Node* obj_size = NULL;
3906 _sp += nargs; // set original stack for use by uncommon_trap 3902 Node* alloc_obj = new_array(obj_klass, obj_length, nargs,
3907 Node* alloc_obj = new_array(obj_klass, obj_length,
3908 raw_mem_only, &obj_size); 3903 raw_mem_only, &obj_size);
3909 _sp -= nargs;
3910 assert(obj_size != NULL, ""); 3904 assert(obj_size != NULL, "");
3911 Node* raw_obj = alloc_obj->in(1); 3905 Node* raw_obj = alloc_obj->in(1);
3912 assert(raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); 3906 assert(raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), "");
3913 if (ReduceBulkZeroing) { 3907 if (ReduceBulkZeroing) {
3914 AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn); 3908 AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn);