A method for compiler optimization particularly well suited to
object-oriented language that permit dynamic class loading. The method
permits the compiler optimization of code associated with a potentially
polymorphic object that is a call parameter to a virtual procedure where
the procedure is a candidate for devirtualization through inlining. The
method includes steps for guarded devirtualizing of the procedure,
insertion of code to ensure privatization of the object before the
procedure is executed, creation of a guard assumptions associated with
the object and application of known optimization techniques to the code
associated with the object.