/**
  * This is the basic template for the full arraycopy checks, including a check that the underlying
  * type is really an array type.
  */
 @Snippet
 public static void arraycopySlowPathIntrinsic(
     Object src,
     int srcPos,
     Object dest,
     int destPos,
     int length,
     @ConstantParameter JavaKind elementKind,
     @ConstantParameter SnippetInfo slowPath,
     @ConstantParameter Object slowPathArgument) {
   Object nonNullSrc = GraalDirectives.guardingNonNull(src);
   Object nonNullDest = GraalDirectives.guardingNonNull(dest);
   KlassPointer srcHub = loadHub(nonNullSrc);
   KlassPointer destHub = loadHub(nonNullDest);
   checkArrayType(srcHub);
   checkArrayType(destHub);
   checkLimits(nonNullSrc, srcPos, nonNullDest, destPos, length);
   if (length == 0) {
     zeroLengthDynamicCounter.inc();
   } else {
     nonZeroLengthDynamicCounter.inc();
     nonZeroLengthDynamicCopiedCounter.add(length);
   }
   ArrayCopySlowPathNode.arraycopy(
       nonNullSrc, srcPos, nonNullDest, destPos, length, elementKind, slowPath, slowPathArgument);
 }