public static Object buildMultiDimensionalArray(int[] numElements, int dimIndex, VM_Array arrayType) { if (!arrayType.isInstantiated()) { arrayType.load(); arrayType.resolve(); arrayType.instantiate(); }
public static Object buildMultiDimensionalArray(int[] numElements, int dimIndex, VM_Array arrayType, int allocator) { arrayType.load(); arrayType.resolve(); arrayType.instantiate();  VM.sysWrite("buildMultiDimensionalArray: dimIndex = ", dimIndex); VM.sysWriteln("                            numElements.len = ", numElements.length); for (int i=0; i<numElements.length; i++) VM.sysWriteln("                            numElements[", i, "] = ", numElements[i]);
  public static Object buildMultiDimensionalArray(int[] numElements, 						  int dimIndex, 						  VM_Array arrayType) {    if (!arrayType.isInstantiated()) {      arrayType.load();      arrayType.resolve();      arrayType.instantiate();    }    int    nelts     = numElements[dimIndex];    int    size      = arrayType.getInstanceSize(nelts);    Object newObject = quickNewArray(nelts, size, arrayType.getTypeInformationBlock());    if (++dimIndex == numElements.length)      return newObject; // all dimensions have been built    Object[] newArray     = (Object[]) newObject;    VM_Array newArrayType = arrayType.getElementType().asArray();       for (int i = 0; i < nelts; ++i)      newArray[i] = buildMultiDimensionalArray(numElements, dimIndex,                                                newArrayType);    return newArray;  }