int oldCount = obsoleteMethodCount; obsoleteMethodCount = 0;  for (int i = 0; i < oldCount; i++) { int currCM = obsoleteMethods[i]; if (compiledMethods[currCM].isObsolete()) { compiledMethods[currCM] = null; } else { obsoleteMethods[obsoleteMethodCount++] = currCM; compiledMethods[currCM].setObsolete(true);
int max = numCompiledMethods(); for (int i=0; i<numCompiledMethods(); i++) { VM_CompiledMethod cm = compiledMethods[i]; if (cm != null) { if (cm.isActiveOnStack()) { if (cm.isObsolete()) {  scanForObsoleteMethods = true; VM_Magic.sync(); } cm.clearActiveOnStack(); } else { if (cm.isObsolete()) {  compiledMethods[i] = null; } }
  public synchronized static void snipObsoleteCompiledMethods() {    if (obsoleteMethods == null) return;        int oldCount = obsoleteMethodCount;    obsoleteMethodCount = 0;    for (int i = 0; i < oldCount; i++) {      int currCM = obsoleteMethods[i];      if (compiledMethods[currCM].isObsolete()) {        compiledMethods[currCM] = null;         // break the link      } else {        obsoleteMethods[obsoleteMethodCount++] = currCM; // keep it        compiledMethods[currCM].setObsolete(true);       // maybe next time      }    }  }