Mercurial > hg > truffle
comparison src/share/vm/opto/library_call.cpp @ 3278:66b0e2371912
7026700: regression in 6u24-rev-b23: Crash in C2 compiler in PhaseIdealLoop::build_loop_late_post
Summary: memory slices should be always created for non-static fields after allocation
Reviewed-by: never
author | kvn |
---|---|
date | Wed, 20 Apr 2011 18:29:35 -0700 |
parents | 13bc79b5c9c8 |
children | 286c498ae0d4 |
comparison
equal
deleted
inserted
replaced
3277:d934e4b931e9 | 3278:66b0e2371912 |
---|---|
3374 // How many elements will we copy from the original? | 3374 // How many elements will we copy from the original? |
3375 // The answer is MinI(orig_length - start, length). | 3375 // The answer is MinI(orig_length - start, length). |
3376 Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) ); | 3376 Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) ); |
3377 Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length); | 3377 Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length); |
3378 | 3378 |
3379 const bool raw_mem_only = true; | 3379 newcopy = new_array(klass_node, length, 0); |
3380 newcopy = new_array(klass_node, length, 0, raw_mem_only); | |
3381 | 3380 |
3382 // Generate a direct call to the right arraycopy function(s). | 3381 // Generate a direct call to the right arraycopy function(s). |
3383 // We know the copy is disjoint but we might not know if the | 3382 // We know the copy is disjoint but we might not know if the |
3384 // oop stores need checking. | 3383 // oop stores need checking. |
3385 // Extreme case: Arrays.copyOf((Integer[])x, 10, String[].class). | 3384 // Extreme case: Arrays.copyOf((Integer[])x, 10, String[].class). |
4172 TypePtr::BOTTOM); | 4171 TypePtr::BOTTOM); |
4173 record_for_igvn(result_reg); | 4172 record_for_igvn(result_reg); |
4174 | 4173 |
4175 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; | 4174 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; |
4176 int raw_adr_idx = Compile::AliasIdxRaw; | 4175 int raw_adr_idx = Compile::AliasIdxRaw; |
4177 const bool raw_mem_only = true; | |
4178 | |
4179 | 4176 |
4180 Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL); | 4177 Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL); |
4181 if (array_ctl != NULL) { | 4178 if (array_ctl != NULL) { |
4182 // It's an array. | 4179 // It's an array. |
4183 PreserveJVMState pjvms(this); | 4180 PreserveJVMState pjvms(this); |
4184 set_control(array_ctl); | 4181 set_control(array_ctl); |
4185 Node* obj_length = load_array_length(obj); | 4182 Node* obj_length = load_array_length(obj); |
4186 Node* obj_size = NULL; | 4183 Node* obj_size = NULL; |
4187 Node* alloc_obj = new_array(obj_klass, obj_length, 0, | 4184 Node* alloc_obj = new_array(obj_klass, obj_length, 0, &obj_size); |
4188 raw_mem_only, &obj_size); | |
4189 | 4185 |
4190 if (!use_ReduceInitialCardMarks()) { | 4186 if (!use_ReduceInitialCardMarks()) { |
4191 // If it is an oop array, it requires very special treatment, | 4187 // If it is an oop array, it requires very special treatment, |
4192 // because card marking is required on each card of the array. | 4188 // because card marking is required on each card of the array. |
4193 Node* is_obja = generate_objArray_guard(obj_klass, (RegionNode*)NULL); | 4189 Node* is_obja = generate_objArray_guard(obj_klass, (RegionNode*)NULL); |
4255 | 4251 |
4256 if (!stopped()) { | 4252 if (!stopped()) { |
4257 // It's an instance, and it passed the slow-path tests. | 4253 // It's an instance, and it passed the slow-path tests. |
4258 PreserveJVMState pjvms(this); | 4254 PreserveJVMState pjvms(this); |
4259 Node* obj_size = NULL; | 4255 Node* obj_size = NULL; |
4260 Node* alloc_obj = new_instance(obj_klass, NULL, raw_mem_only, &obj_size); | 4256 Node* alloc_obj = new_instance(obj_klass, NULL, &obj_size); |
4261 | 4257 |
4262 copy_to_clone(obj, alloc_obj, obj_size, false, !use_ReduceInitialCardMarks()); | 4258 copy_to_clone(obj, alloc_obj, obj_size, false, !use_ReduceInitialCardMarks()); |
4263 | 4259 |
4264 // Present the results of the slow call. | 4260 // Present the results of the slow call. |
4265 result_reg->init_req(_instance_path, control()); | 4261 result_reg->init_req(_instance_path, control()); |