4313 _array_path, // plain array allocation, plus arrayof_long_arraycopy
4314 _instance_path, // plain instance allocation, plus arrayof_long_arraycopy
4315 PATH_LIMIT
4316 };
4317 RegionNode* result_reg = new RegionNode(PATH_LIMIT);
4318 result_val = new PhiNode(result_reg, TypeInstPtr::NOTNULL);
4319 PhiNode* result_i_o = new PhiNode(result_reg, Type::ABIO);
4320 PhiNode* result_mem = new PhiNode(result_reg, Type::MEMORY, TypePtr::BOTTOM);
4321 record_for_igvn(result_reg);
4322
4323 Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL);
4324 if (array_ctl != NULL) {
4325 // It's an array.
4326 PreserveJVMState pjvms(this);
4327 set_control(array_ctl);
4328 Node* obj_length = load_array_length(obj);
4329 Node* obj_size = NULL;
4330 Node* alloc_obj = new_array(obj_klass, obj_length, 0, &obj_size); // no arguments to push
4331
4332 BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
4333 if (bs->array_copy_requires_gc_barriers(T_OBJECT)) {
4334 // If it is an oop array, it requires very special treatment,
4335 // because gc barriers are required when accessing the array.
4336 Node* is_obja = generate_objArray_guard(obj_klass, (RegionNode*)NULL);
4337 if (is_obja != NULL) {
4338 PreserveJVMState pjvms2(this);
4339 set_control(is_obja);
4340 obj = access_resolve(obj, ACCESS_READ);
4341 // Generate a direct call to the right arraycopy function(s).
4342 Node* alloc = tightly_coupled_allocation(alloc_obj, NULL);
4343 ArrayCopyNode* ac = ArrayCopyNode::make(this, true, obj, intcon(0), alloc_obj, intcon(0), obj_length, alloc != NULL, false);
4344 ac->set_cloneoop();
4345 Node* n = _gvn.transform(ac);
4346 assert(n == ac, "cannot disappear");
4347 ac->connect_outputs(this);
4348
4349 result_reg->init_req(_objArray_path, control());
4350 result_val->init_req(_objArray_path, alloc_obj);
4351 result_i_o ->set_req(_objArray_path, i_o());
4352 result_mem ->set_req(_objArray_path, reset_memory());
4353 }
|
4313 _array_path, // plain array allocation, plus arrayof_long_arraycopy
4314 _instance_path, // plain instance allocation, plus arrayof_long_arraycopy
4315 PATH_LIMIT
4316 };
4317 RegionNode* result_reg = new RegionNode(PATH_LIMIT);
4318 result_val = new PhiNode(result_reg, TypeInstPtr::NOTNULL);
4319 PhiNode* result_i_o = new PhiNode(result_reg, Type::ABIO);
4320 PhiNode* result_mem = new PhiNode(result_reg, Type::MEMORY, TypePtr::BOTTOM);
4321 record_for_igvn(result_reg);
4322
4323 Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL);
4324 if (array_ctl != NULL) {
4325 // It's an array.
4326 PreserveJVMState pjvms(this);
4327 set_control(array_ctl);
4328 Node* obj_length = load_array_length(obj);
4329 Node* obj_size = NULL;
4330 Node* alloc_obj = new_array(obj_klass, obj_length, 0, &obj_size); // no arguments to push
4331
4332 BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
4333 if (bs->array_copy_requires_gc_barriers(true, T_OBJECT, true, BarrierSetC2::Parsing)) {
4334 // If it is an oop array, it requires very special treatment,
4335 // because gc barriers are required when accessing the array.
4336 Node* is_obja = generate_objArray_guard(obj_klass, (RegionNode*)NULL);
4337 if (is_obja != NULL) {
4338 PreserveJVMState pjvms2(this);
4339 set_control(is_obja);
4340 obj = access_resolve(obj, ACCESS_READ);
4341 // Generate a direct call to the right arraycopy function(s).
4342 Node* alloc = tightly_coupled_allocation(alloc_obj, NULL);
4343 ArrayCopyNode* ac = ArrayCopyNode::make(this, true, obj, intcon(0), alloc_obj, intcon(0), obj_length, alloc != NULL, false);
4344 ac->set_cloneoop();
4345 Node* n = _gvn.transform(ac);
4346 assert(n == ac, "cannot disappear");
4347 ac->connect_outputs(this);
4348
4349 result_reg->init_req(_objArray_path, control());
4350 result_val->init_req(_objArray_path, alloc_obj);
4351 result_i_o ->set_req(_objArray_path, i_o());
4352 result_mem ->set_req(_objArray_path, reset_memory());
4353 }
|