if (VM.VerifyAssertions) VM._assert(compiledMethods[cmid] != null);  if (obsoleteMethods == null) {   obsoleteMethods = new int[100]; } else if (obsoleteMethodCount >= obsoleteMethods.length) { int newArray[] = new int[obsoleteMethods.length*2];  VM.disableGC(); for (int i = 0, n = obsoleteMethods.length; i < n; ++i) { newArray[i] = obsoleteMethods[i]; } VM.enableGC(); obsoleteMethods = newArray; } compiledMethod.setObsolete(true); obsoleteMethods[obsoleteMethodCount++] = cmid;
compiledMethod.setObsolete(); VM_Magic.sync(); scanForObsoleteMethods = true;
  public static synchronized void setCompiledMethodObsolete(VM_CompiledMethod compiledMethod) {    if (compiledMethod.isObsolete()) return; // someone else already marked it as obsolete.    int cmid = compiledMethod.getId();    // Currently, we avoid setting methods of java.lang.Object obsolete.    // This is because the TIBs for arrays point to the original version    // and are not updated on recompilation.    // !!TODO: When replacing a java.lang.Object method, find arrays in JTOC    //  and update TIB to use newly recompiled method.    if (compiledMethod.getMethod().getDeclaringClass().isJavaLangObjectType())      return;    if (VM.VerifyAssertions) VM._assert(compiledMethods[cmid] != null);    if (obsoleteMethods == null) {      // This should tend not to get too big as it gets compressed as we      // snip obsolete code at GC time.      obsoleteMethods = new int[100];    } else if (obsoleteMethodCount >= obsoleteMethods.length) {      int newArray[] = new int[obsoleteMethods.length*2];      // Disable GC during array copy because GC can alter the source array      VM.disableGC();      for (int i = 0, n = obsoleteMethods.length; i < n; ++i) {        newArray[i] = obsoleteMethods[i];      }      VM.enableGC();      obsoleteMethods = newArray;    }    compiledMethod.setObsolete(true);    obsoleteMethods[obsoleteMethodCount++] = cmid;  }