public static void destroyFunction(MethodSlot function) {
    { Symbol functionname = function.slotName;
      Surrogate slotref = function.slotSlotref;
      MethodSlot realfunction = Symbol.lookupFunction(functionname);

      if (function == realfunction) {
        Stella.$FUNCTION_LOOKUP_TABLE$.removeAt(functionname);
      }
      if ((slotref != null) &&
          (function == ((Slot)(slotref.surrogateValue)))) {
        slotref.surrogateValue = null;
      }
      function.deletedPSetter(true);
      function.free();
    }
  }