A system of permitting stack allocation in a program with open-world
features is described. The system includes an escape analysis module to
(1) determine which objects of the program can be stack-allocated under a
closed-world assumption and (2) analyze, after stack allocation, which
stack allocation is invalidated due to the occurrence of an open-world
feature. A stack allocation module is provided to stack-allocate these
objects based on the determination of the escape analysis module. A stack
allocation recovery module is provided to recover those invalidated stack
allocations back to their original allocation in heap based on the
analysis of the escape analysis module. A method of permitting stack
allocation in a program with open-world features is also described.