if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) {
if (unresolvedFound == lastUnresolved) { if (unresolvedFound == 0) {
	private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException {		log("Emitting objects", Project.MSG_DEBUG);		PrintWriter debugOut = null;		try {			if (debug) {				debugOut = new PrintWriter(new FileWriter(debugFile));			}			final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses);			final long start = System.currentTimeMillis();			int cnt = 0;			int lastUnresolved = -1;			int loops = 0;			while (true) {				loops++;				compileClasses(os, arch);				final Collection objectRefs = new ArrayList(os.getObjectRefs());				int unresolved = 0; // Number of unresolved references found in the following loop				int emitted = 0; // Number of emitted objects in the following loop				for (Iterator i = objectRefs.iterator(); i.hasNext();) {					X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next();					if (!ref.isResolved()) {						final Object obj = ref.getObject();						if (!(obj instanceof Label)) {							unresolved++;							if (obj instanceof VmType) {								((VmType) obj).link();							}														final boolean skip;							if (blockObjects == null) {								skip = false;							} else {								skip = blockObjects.contains(obj);							}							if (!skip) {							//if (obj != skipMe) {								emitter.emitObject(obj);								emitted++;								X86Stream.ObjectRef newRef = os.getObjectRef(obj);								if (ref != newRef) {									throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName());								}								if (!ref.isResolved()) {									throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName()));								}							}						}					}				}				if (unresolved == lastUnresolved) {					if ((unresolved == 0) || (blockObjects != null)) {						break;					}				}				lastUnresolved = unresolved;				cnt += emitted;			}			final long end = System.currentTimeMillis();			log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops");			if (debugOut != null) {				debugOut.close();				debugOut = null;			}		} catch (ClassNotFoundException ex) {			throw new BuildException(ex);		} catch (IOException ex) {			throw new BuildException(ex);		}	}