Object obj = (Object) VM_Magic.addressAsObject(addr); VM_Type type = VM_Magic.getObjectType(obj); boolean isArray = type.isArrayType(); int length = getLength(obj, type, isArray);     for (int a = 0; a < numSubspaces; a++) { if (subspace[a].addressInRange(addr)) { int index = subspace[a].getIndex(addr); if (isArray) { tiles[index].arrayObjects++; tiles[index].arrayUsedSpace += length; if (VM_Interface.VerifyAssertions) VM_Interface._assert(tiles[index].arrayUsedSpace < arrayUsedSpaceStream.getMaxValue()); totalArrayObjects++; totalArrayUsedSpace += length; } else { tiles[index].scalarObjects++; tiles[index].scalarUsedSpace += length; if (VM_Interface.VerifyAssertions) VM_Interface._assert(tiles[index].arrayUsedSpace < arrayUsedSpaceStream.getMaxValue()); totalScalarObjects++; totalScalarUsedSpace += length; } return; } }
traceObject(addr, true);
  public void traceObject(VM_Address addr) {    // get length of object and determine if it's an array    Object obj = (Object) VM_Magic.addressAsObject(addr);    VM_Type type = VM_Magic.getObjectType(obj);    boolean isArray = type.isArrayType();    int length = getLength(obj, type, isArray);        // Update the stats    // FIXME we should account for space better to handle the case that objects    // overlap tiles    for (int a = 0; a < numSubspaces; a++) {      if (subspace[a].addressInRange(addr)) {        int index = subspace[a].getIndex(addr);	if (isArray) {	  tiles[index].arrayObjects++;	  tiles[index].arrayUsedSpace += length;	  if (VM_Interface.VerifyAssertions) 	    VM_Interface._assert(tiles[index].arrayUsedSpace < arrayUsedSpaceStream.getMaxValue());	  totalArrayObjects++;	  totalArrayUsedSpace += length;	} else {	  tiles[index].scalarObjects++;	  tiles[index].scalarUsedSpace += length;	  if (VM_Interface.VerifyAssertions) 	    VM_Interface._assert(tiles[index].arrayUsedSpace < arrayUsedSpaceStream.getMaxValue());	  totalScalarObjects++;	  totalScalarUsedSpace += length;	}	return;      }     }  }