摘要:
Information is computed about the reachability relationships among objects and pointers to enable transformation of a computer program for optimizing the creation and destruction of objects, while strictly performing the semantics of the original program. An interprocedural analysis is used to determine whether an object that is allocated on the heap during the execution of a procedure is not reachable from any global variable, parameter, or the return value of the procedure after it returns. If so, that object can be allocated on the stack frame of the procedure in which it is otherwise heap-allocated. This simplifies the memory allocation and deallocation operations, as allocation on the stack can be done more efficiently than allocation on the heap, and objects allocated on the stack frame of a procedure are automatically deallocated when the procedure returns, without incurring the overhead of garbage collection. This, in turn, leads to faster programs which use fewer computer processor resources to execute. The interprocedural analysis of the program summarizes the effect of a procedure call succinctly for different calling contexts of the procedure using a single summary representation. The method handles exceptions in the programming language, while taking advantage of the information about the visibility of variables in the exception handler. Variants of the method show how one or several of the features of the method may be performed.
摘要:
A method and system for detecting and eliminating interferences between resources in SSA-form &phgr;-instructions so that an optimizing compiler can translate optimized SSA-form code back to non-SSA-form code. The method traverses the control flow graph associated with an SSA-form program or routine in order to analyze each &phgr;-instruction within the SSA-form program or routine. All possible pairs of resources associated with each &phgr;-instruction are analyzed for interference. Once all interferences have been detected, the method inserts copy instructions into the SSA-form intermediate-level code program or routine in order to eliminate the interferences.