Patent ID: 7076773

Claim:
An apparatus comprising: at least one processor; a memory coupled to the at least one processor; an object oriented program residing in the memory comprising a plurality of instructions; and a dynamic compiler residing in the memory and executed by the at least one processor, the dynamic compiler being invoked during execution of the object oriented program, the dynamic compiler allocating at least one object in the object oriented program to an invocation stack frame for a method that allocates the at least one object, the dynamic compiler comprising: an escape analysis mechanism that marks each instruction that allocates a new object as one of global escape, no escape, and arg escape based on information available from previously-loaded classes that are part of the object oriented program; and an object allocation mechanism that allocates at least one object that is created by an instruction marked as no escape by the escape analysis mechanism to an invocation stack frame for a method that allocates the object; wherein the dynamic compiler analyzes each class as it is loaded to determine whether the newly-loaded class affects the allocation of an object by the object allocation mechanism to the invocation stack frame, and if so, the dynamic compiler changes the allocation of the object to a heap.