Unsafe.copy(srcPtr, dstPtr, length * elemsize);
Unsafe.copy(srcPtr, dstPtr, size);
	public static void arrayCopy(Object src, int srcPos, Object dst,			int dstPos, int length) throws PrivilegedActionPragma {		Class src_class = src.getClass();		Class dst_class = dst.getClass();		if (!src_class.isArray()) {			Unsafe.debug('!');			throw new ArrayStoreException("src is not an array");		}		if (!dst_class.isArray()) {			Unsafe.debug("dst is not an array:");			Unsafe.debug(dst_class.getName());			throw new ArrayStoreException("dst is not an array");		}		String src_name = src_class.getName();		String dst_name = dst_class.getName();		char src_type = src_name.charAt(1);		char dst_type = dst_name.charAt(1);		if (src_type == '[') {			src_type = 'L';		}		if (dst_type == '[') {			dst_type = 'L';		}		if (src_type != dst_type) {			Unsafe.debug("invalid array types:");			Unsafe.debug(src_class.getName());			Unsafe.debug(dst_class.getName());			throw new ArrayStoreException("Invalid array types");		}		if (srcPos < 0) {			throw new IndexOutOfBoundsException("srcPos < 0");		}		if (dstPos < 0) {			throw new IndexOutOfBoundsException("dstPos < 0");		}		if (length < 0) {			throw new IndexOutOfBoundsException("length < 0");		}		final int slotSize = Unsafe.getCurrentProcessor().getArchitecture()				.getReferenceSize();		final Offset lengthOffset = Offset				.fromIntSignExtend(VmArray.LENGTH_OFFSET * slotSize);		final int dataOffset = VmArray.DATA_OFFSET * slotSize;		final Address srcAddr = ObjectReference.fromObject(src).toAddress();		final Address dstAddr = ObjectReference.fromObject(dst).toAddress();		final int srcLen = srcAddr.loadInt(lengthOffset);		final int dstLen = dstAddr.loadInt(lengthOffset);		if (srcPos + length > srcLen) {			throw new IndexOutOfBoundsException("srcPos+length > src.length ("					+ srcPos + "+" + length + " > " + srcLen + ")");		}		if (dstPos + length > dstLen) {			throw new IndexOutOfBoundsException("dstPos+length > dst.length");		}		final int elemsize;		final boolean isObjectArray;		switch (src_type) {		case 'Z':		// Boolean		case 'B':			// Byte			elemsize = 1;			isObjectArray = false;			break;		case 'C':		// Character		case 'S':			// Short			elemsize = 2;			isObjectArray = false;			break;		case 'I':		// Integer		case 'F':			// Float			elemsize = 4;			isObjectArray = false;			break;		case 'L':			// Object			elemsize = slotSize;			isObjectArray = true;			break;		case 'J':		// Long		case 'D':			// Double			elemsize = 8;			isObjectArray = false;			break;		default:			// Unsafe.debug("uat:");			// Unsafe.debug(src_type);			// Unsafe.debug(src_name);			throw new ArrayStoreException("Unknown array type");		}		final Address srcPtr = srcAddr.add(dataOffset + (srcPos * elemsize));		final Address dstPtr = dstAddr.add(dataOffset + (dstPos * elemsize));		Unsafe.copy(srcPtr, dstPtr, length * elemsize);		if (isObjectArray) {			final VmWriteBarrier wb = Vm.getHeapManager().getWriteBarrier();			if (wb != null) {				wb.arrayCopyWriteBarrier(src, srcPos, srcPos + length);			}		}	}