static int[] buildDoesImplement(VM_Class t) { if (t.isJavaLangObjectType()) {  return new int[MIN_DOES_IMPLEMENT_SIZE];
static int[] buildDoesImplement(VM_Array t) { if (arrayDoesImplement == null) { int cloneIdx = VM_Type.JavaLangCloneableType.getDoesImplementIndex(); int serialIdx = VM_Type.JavaIoSerializableType.getDoesImplementIndex(); int size = Math.max(cloneIdx, serialIdx); size = Math.max(MIN_DOES_IMPLEMENT_SIZE, size+1); int [] tmp = new int[size]; tmp[cloneIdx] = VM_Type.JavaLangCloneableType.getDoesImplementBitMask(); tmp[serialIdx] |= VM_Type.JavaIoSerializableType.getDoesImplementBitMask(); arrayDoesImplement = tmp;
  static int[] buildDoesImplement(VM_Class t) {    if (t.isJavaLangObjectType()) {      // object implements no interfaces.      return new int[MIN_DOES_IMPLEMENT_SIZE];    }    VM_Class [] superInterfaces = t.getDeclaredInterfaces();    if (!t.isInterface() && superInterfaces.length == 0) {      // I add nothing new; share with parent.      return t.getSuperClass().getDoesImplement();    }    // I need one of my own; first figure out how big it needs to be.    int size;    if (t.isInterface()) {      size = Math.max(MIN_DOES_IMPLEMENT_SIZE, t.getDoesImplementIndex()+1);    } else {      size = t.getSuperClass().getDoesImplement().length;    }    for (int i=0; i<superInterfaces.length; i++) {      VM_Class superInterface = superInterfaces[i];      size = Math.max(size, superInterface.getDoesImplement().length);    }    // then create and populate it    int[] mine = new int[size];    if (t.isInterface()) {      mine[t.getDoesImplementIndex()] = t.getDoesImplementBitMask();    } else {      int[] parent = t.getSuperClass().getDoesImplement();      for (int j=0; j<parent.length; j++) {        mine[j] |= parent[j];      }    }    for (int i=0; i<superInterfaces.length; i++) {      int[] parent = superInterfaces[i].getDoesImplement();      for (int j=0; j<parent.length; j++) {        mine[j] |= parent[j];      }    }        return mine;  }