/** * @param t type of object to allocate * @return value number of the newly allocated object */ protected int addStatementsForConcreteSimpleType(final TypeReference t) { // assert we haven't allocated this type already. assert !typesAllocated.contains(t); if (DEBUG) { System.err.println(("addStatementsForConcreteType: " + t)); } NewSiteReference ref = NewSiteReference.make(getNewSiteForType(t), t); int alloc = getLocalForType(t); if (t.isArrayType()) { // for now, just allocate an array of size 1 in each dimension. int dim = t.getDimensionality(); int[] extents = new int[dim]; Arrays.fill(extents, 1); SSANewInstruction a = insts.NewInstruction(alloc, ref, extents); addInstruction(t, a, true); } else { SSANewInstruction a = insts.NewInstruction(alloc, ref); addInstruction(t, a, true); addCtorInvokeInstruction(t, alloc); } SSAReturnInstruction r = insts.ReturnInstruction(alloc, false); addInstruction(t, r, false); return alloc; }