public static void finalizeObjects() {
    if (((Boolean)(Logic.$INHIBITOBJECTFINALIZATIONp$.get())).booleanValue() ||
        ((Logic.$UNFINALIZED_OBJECTS$.theConsList == Stella.NIL) ||
         (!Logic.worldStateP(((Context)(Stella.$CONTEXT$.get())))))) {
      return;
    }
    { Object old$InhibitobjectfinalizationP$000 = Logic.$INHIBITOBJECTFINALIZATIONp$.get();
      Object old$Termsourcebeingparsed$000 = Logic.$TERMSOURCEBEINGPARSED$.get();
      Object old$Descriptionunderconstruction$000 = Logic.$DESCRIPTIONUNDERCONSTRUCTION$.get();
      Object old$Termunderconstruction$000 = Logic.$TERMUNDERCONSTRUCTION$.get();

      try {
        Native.setBooleanSpecial(Logic.$INHIBITOBJECTFINALIZATIONp$, true);
        Native.setSpecial(Logic.$TERMSOURCEBEINGPARSED$, null);
        Native.setSpecial(Logic.$DESCRIPTIONUNDERCONSTRUCTION$, null);
        Native.setSpecial(Logic.$TERMUNDERCONSTRUCTION$, null);
        Stella.finalizeClassesAndSlots();
        { Stella_Object renamed_Object = null;
          Cons iter000 = Logic.$UNFINALIZED_OBJECTS$.reverse().theConsList;

          for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
            renamed_Object = iter000.value;
            Logic.finalizeObject(renamed_Object);
          }
        }
        Logic.$UNFINALIZED_OBJECTS$.clear();

      } finally {
        Logic.$TERMUNDERCONSTRUCTION$.set(old$Termunderconstruction$000);
        Logic.$DESCRIPTIONUNDERCONSTRUCTION$.set(old$Descriptionunderconstruction$000);
        Logic.$TERMSOURCEBEINGPARSED$.set(old$Termsourcebeingparsed$000);
        Logic.$INHIBITOBJECTFINALIZATIONp$.set(old$InhibitobjectfinalizationP$000);
      }
    }
  }