532
533 // (At this point we can assume disjoint_bases, since types differ.)
534 int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
535 Node* p1 = basic_plus_adr(dest_klass, ek_offset);
536 Node* n1 = LoadKlassNode::make(_igvn, NULL, C->immutable_memory(), p1, TypeRawPtr::BOTTOM);
537 Node* dest_elem_klass = transform_later(n1);
538 Node* cv = generate_checkcast_arraycopy(&local_ctrl, &local_mem,
539 adr_type,
540 dest_elem_klass,
541 src, src_offset, dest, dest_offset,
542 ConvI2X(copy_length), dest_uninitialized);
543 if (cv == NULL) cv = intcon(-1); // failure (no stub available)
544 checked_control = local_ctrl;
545 checked_i_o = *io;
546 checked_mem = local_mem->memory_at(alias_idx);
547 checked_value = cv;
548 }
549 }
550 // At this point we know we do not need type checks on oop stores.
551
552 // Let's see if we need card marks:
553 if (alloc != NULL && GraphKit::use_ReduceInitialCardMarks()) {
554 // If we do not need card marks, copy using the jint or jlong stub.
555 copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT);
556 assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
557 "sizes agree");
558 }
559 }
560
561 if (!(*ctrl)->is_top()) {
562 // Generate the fast path, if possible.
563 Node* local_ctrl = *ctrl;
564 MergeMemNode* local_mem = MergeMemNode::make(mem);
565 transform_later(local_mem);
566
567 generate_unchecked_arraycopy(&local_ctrl, &local_mem,
568 adr_type, copy_type, disjoint_bases,
569 src, src_offset, dest, dest_offset,
570 ConvI2X(copy_length), dest_uninitialized);
571
572 // Present the results of the fast call.
573 result_region->init_req(fast_path, local_ctrl);
|
532
533 // (At this point we can assume disjoint_bases, since types differ.)
534 int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
535 Node* p1 = basic_plus_adr(dest_klass, ek_offset);
536 Node* n1 = LoadKlassNode::make(_igvn, NULL, C->immutable_memory(), p1, TypeRawPtr::BOTTOM);
537 Node* dest_elem_klass = transform_later(n1);
538 Node* cv = generate_checkcast_arraycopy(&local_ctrl, &local_mem,
539 adr_type,
540 dest_elem_klass,
541 src, src_offset, dest, dest_offset,
542 ConvI2X(copy_length), dest_uninitialized);
543 if (cv == NULL) cv = intcon(-1); // failure (no stub available)
544 checked_control = local_ctrl;
545 checked_i_o = *io;
546 checked_mem = local_mem->memory_at(alias_idx);
547 checked_value = cv;
548 }
549 }
550 // At this point we know we do not need type checks on oop stores.
551
552 BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
553 if (alloc != NULL && !bs->array_copy_requires_gc_barriers(copy_type)) {
554 // If we do not need gc barriers, copy using the jint or jlong stub.
555 copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT);
556 assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
557 "sizes agree");
558 }
559 }
560
561 if (!(*ctrl)->is_top()) {
562 // Generate the fast path, if possible.
563 Node* local_ctrl = *ctrl;
564 MergeMemNode* local_mem = MergeMemNode::make(mem);
565 transform_later(local_mem);
566
567 generate_unchecked_arraycopy(&local_ctrl, &local_mem,
568 adr_type, copy_type, disjoint_bases,
569 src, src_offset, dest, dest_offset,
570 ConvI2X(copy_length), dest_uninitialized);
571
572 // Present the results of the fast call.
573 result_region->init_req(fast_path, local_ctrl);
|