Dynamic class loading during program execution in the Java TM Programming Language is an impediment for generating code that is as e cient as code generated using static wholeprogram analysis and optimization. Whole-program analysis and optimization is possible for languages, such a s C + + , that do not allow new classes and/or methods to be loaded during program execution. One solution for performing wholeprogram analysis and avoiding incorrect execution after a new class is loaded is to invalidate and recompile a ected methods. Runtime invalidation and recompilation mechanisms can be expensive in both space and time, and, therefore, generally restrict optimization. To address these drawbacks, we propose a new framework, called the extant analysis framework, f o r i n terprocedural optimization of programs that support dynamic class (or method) loading. Given a set of classes comprising the closed world, w e perform an o ine static analysis which partitions references into two categories: (1) unconditionally extant references which p o i n t only to objects whose runtime type is guaranteed to be in the closed world and (2) conditionally extant references which p o i n t to objects whose runtime type is not guaranteed to be in the closed world. Optimizations solely dependent on the rst category can be statically performed, and are guaranteed to be correct even with any future class/method loading. Optimizations dependent o n the second category are guarded by dynamic tests, called extant safety tests, for correct execution behavior. We describe the properties for extant safety tests, and provide algorithms for their generation and placement.