We present an interprocedural flow-insensitive points-to analysis based on type inference methods with an almost linear time cost complexity. To our knowledge, this is the asymptotically fastest non-trivial interprocedural points-to analysis algorithm yet described. The algorithm is based on a non-standard type system. The type inferred for any variable represents a set of locations and includes a type which in turn represents a set of locations possibly pointed to by the variable. The type inferred for a function variable represents a set of functions it may point to and includes a type signature for these functions. The results are equivalent to those of a flowinsensitive alias analysis (and control flow analysis) that assumes alias relations are reflexive and transitive.This work makes three contributions. The first is a type system for describing a universally valid storage shape graph for a program in linear space. The second is a constraint system which often leads to better results than the "obvious" constraint system for the given type system. The third is an almost linear time algorithm for points-to analysis by solving a constraint system.Modern optimizing compilers and program understanding and browsing tools for pointer languages such as C [KR88] are dependent on semantic information obtained by either an alias analysis or a points-to analysis. Alias analyses compute pairs of expressions (or access paths) that may be aliased (e.g., [LR92,LRZ93]). Pointsto analyses compute a store model using abstract locations (e.g., [CWZ90, EGH94, WL95, Ruf95]). Most current compilers and programming tools use only intraprocedural analyses, as the polynomial time and space complexity of the common data-flow based analyses prevents the use of interprocedural analyses for large programs. Interprocedural analysis is becoming increasingly important, as it is necessary to support whole-program optimization and various program understanding tools. Previously published interprocedural analysis algorithms have not been reported to have been successfully applied to programs around 100,000 lines of C code (the published results are practically all for less than 10,000 lines of C code). Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that new copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers or to redistribute requires prior specific permission and/or a fee. Request permissions from Publications Dept, ACM Inc, Fax +1 (212) 869-0481, or
A fast and scalable interprocedural escape analysis algorithm is presented. The analysis computes a description of a subset of created objects whose lifetime is bounded by the lifetime of a runtime stack frame. The analysis results can be used for many purposes, including stack allocation of objects, thread synchronization elimination, deadstore removal, code motion, and iterator reduction. A method to use the analysis results for transforming a program to allocate some objects on the runtime stack is also presented. For non-trivial programs, typically 10%-20% of all allocated objects are placed on the runtime stack after the transformation.
We present an interprocedural flow-insensitive points-to analysis algorithm based on monomorphic type inference. The source language model the important features of C including pointers, pointer arithmetic, pointers to functions, structured objects, and unions. The algorithm is based on a non-standard type system where types represent nodes and edges in a storage shape graph.This work is an extension of previous work on performing points-to analysis of C programs in almost linear time. This work makes three new contributions. The first is an extension of a type system for describing storage shape graphs to include objects with internal structure. The second is a constraint system that can deal with arbitrary use of pointers and which incorporates a two-tier domain of pointer offsets to improve the results of the analysis. The third is an efficient inference algorithm for the constraint system, leading to an algorithm that has close to linear time and space performance in practice.Keywords: interprocedural program analysis, points-to analysis, C programs, standard types, constraint solving. noni IntroductionModern optimizing compilers and program understanding and browsing tools for pointer languages like C lAme89, KR88] are dependent on semantic information obtained by either an alias analysis or a points-to analysis. Alias analyses compute pairs of expressions (or access paths) that may be aliased (e.g., [LR92,LRZ93]). Pointsto analyses compute a store model using abstract locations (e.g., [CWZ90,EGH94,WL95,Ruf95]). Points-to analysis results serve no purpose in themselves, but they are a prerequisite for most other analyses and transformations for imperative programs (e.g., computing use-def relations, permitted code motion, and detection of use of uninitialized variables).Most current compilers and programming tools use only intraprocedural points-to analyses, as the polynomial time and space complexity of the common data-flow based points-to analyses prevents the use of interprocedural analyses for large programs. Interprocedural analysis is becoming increasingly important, as it is a prerequisite for whole-program optimization and various program understanding tools.
Garbage collection for a multi-threaded program typically involves either stopping all threads while doing the collection or involves copious amounts of synchronization between threads. However, a lot of data is only ever visible to a single thread, and such data should ideally be collected without involving other threads.Given an escape analysis, a memory management system may allocate thread-specific data in thread-specific heaps and allocate shared data in a shared heap. Garbage collection of data in a thread-specific heaps can be done independent of other threads and of data in their thread-specific heaps. For multi-threaded programs, thread-specific heaps allow reduced garbage collection latency for active threads. On multi-processor computers, thread-specific heaps allow concurrent garbage collection of different thread-specific heaps with minimal synchronization overhead.We present an escape analysis and a sample memory management system using thread-specific heaps.
The Marmot system is a research platform for studying the implementation of high level programming languages. It currently comprises an optimizing native-code compiler, runtime system, and libraries for a large subset of Java. Marmot integrates well-known representation, optimization, code generation, and runtime techniques with a few Java-specific features to achieve competitive performance. This paper contains a description of the Marmot system design, along with highlights of our experience applying and adapting traditional implementation techniques to Java. A detailed performance evaluation assesses both Marmot's overall performance relative to other Java and C++ implementations, and the relative costs of various Java language features in Marmot-compiled code. Our experience with Marmot has demonstrated that well-known compilation techniques can produce very good performance for static Java applicationscomparable or superior to other Java systems, and approaching that of C++ in some cases.We seek to bring the benefits of Java's high level features to larger programs while minimizing the associated performance penalty. Our approach is to adapt well-known implementation techniques from existing language implementations to Java, integrating them with new Java-specific technology where necessary. We have constructed a system, Marmot, that includes a static optimizing compiler, runtime system, and libraries for a large subset of Java. The native-code compiler implements standard scalar optimizations of the sort found in Fortran, C and C++ compilers [2] and basic object-oriented optimizations such as call binding based on class hierarchy analysis [3,4]. It uses modern representation techniques such as SSA form and type-based compilation [5,6] to improve optimization and to support precise garbage collection. The runtime system supports multithreading, efficient synchronization and exception mechanisms, and several garbage collectors, including a precise generational collector. Marmot is implemented almost entirely in Java, and is one of its own most demanding test cases.Our experience with Marmot demonstrates that well-known compilation techniques can produce very good performance for static Java applications -comparable or superior to other Java systems, and approaching that of C++ in some cases. Marmot reduces the costs of safety checks in many programs to a modest 5-10 per cent of execution time. Synchronization costs can be quite significant, and optimization techniques to reduce these costs are worth pursuing. Recognizing single threaded programs and optimizing them accordingly can be an important special case. Although Marmot includes a quality generational collector and further reduces the cost of storage by allocating objects with appropriately bounded lifetimes and statically known sizes on the stack, storage management costs can still be significant.We begin this paper by describing and motivating the subset of Java supported by Marmot. Sections 3-5 describe the design and implementation of the native-cod...
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.