Results 11 - 20
of
43
Annotations for Portable Intermediate Languages
, 2001
"... This paper identifies high-level program properties that can be discovered by static analysis in a compiler front end, and that are useful for classical low-level optimizations. We suggest how intermediate language code could be annotated to convey these properties to the code generator. ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
This paper identifies high-level program properties that can be discovered by static analysis in a compiler front end, and that are useful for classical low-level optimizations. We suggest how intermediate language code could be annotated to convey these properties to the code generator.
First-class Rules and Generic Traversal
, 2001
"... In this paper we present a functional language supporting first-class rules and generic traversal. This is achieved by generalizing the pattern matching constructs of standard functional languages. The case construct that ties rules together and prevents their reuse, is replaced by separate, firs ..."
Abstract
-
Cited by 6 (2 self)
- Add to MetaCart
In this paper we present a functional language supporting first-class rules and generic traversal. This is achieved by generalizing the pattern matching constructs of standard functional languages. The case construct that ties rules together and prevents their reuse, is replaced by separate, firstclass, pattern matching rules and a choice combinator that deals with pattern match failure. Generic traversal is achieved through application pattern matching in which a constructor application is generically divided into a prefix and a su#x, thus giving generic access to the subterms of a constructor term. Many highly generic term traversals can be defined in a type-safe way using this feature.
A certified framework for compiling and executing garbage-collected languages
- In ICFP
, 2010
"... We describe the design, implementation, and use of a machinecertified framework for correct compilation and execution of programs in garbage-collected languages. Our framework extends Leroy’s Coq-certified Compcert compiler and Cminor intermediate language. We add: (i) a new intermediate language, G ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
We describe the design, implementation, and use of a machinecertified framework for correct compilation and execution of programs in garbage-collected languages. Our framework extends Leroy’s Coq-certified Compcert compiler and Cminor intermediate language. We add: (i) a new intermediate language, GCminor, that includes primitives for allocating memory in a garbage-collected heap and for specifying GC roots; (ii) a precise, low-level specification for a Cminor library for garbage collection; and (iii) a proven semantics-preserving translation from GCminor to Cminor plus the GC library. GCminor neatly encapsulates the interface between mutator and collector code, while remaining simple and flexible enough to be used with a wide variety of source languages and collector styles. Front ends targeting GCminor can be implemented using any compiler technology and any desired degree of verification, including full semantics preservation, type preservation, or informal trust. As an example application of our framework, we describe a compiler for Haskell that translates the Glasgow Haskell Compiler’s Core intermediate language to GCminor. To support a simple but useful memory safety argument for this compiler, the front end uses a novel combination of type preservation and runtime checks, which is of independent interest.
Accurate garbage collection in uncooperative environments with lazy pointer stacks
- In International Conference on Compiler Construction (CC
"... Implementing a concurrent programming language such as Java by the means of a translator to an existing language is attractive as it provides portability over all platforms supported by the host language and reduces development time – as many low-level tasks can be delegated to the host compiler. Th ..."
Abstract
-
Cited by 6 (4 self)
- Add to MetaCart
Implementing a concurrent programming language such as Java by the means of a translator to an existing language is attractive as it provides portability over all platforms supported by the host language and reduces development time – as many low-level tasks can be delegated to the host compiler. The C and C++ programming languages are popular choices for many language implementations due to the availability of efficient compilers on a wide range of platforms. For garbage-collected languages, however, they are not a perfect match as no support is provided for accurately discovering pointers to heap-allocated data on thread stacks. We evaluate several previously published techniques, and propose a new mechanism, lazy pointer stacks, for performing accurate garbage collection in such uncooperative environments. We implemented the new technique in the Ovm Java virtual machine with our own Java-to-C/C++ compiler using GCC as a back-end compiler. Our extensive experimental results confirm that lazy pointer stacks outperform existing approaches: we provide a speed-up of 4.5 % over Henderson’s accurate collector with a 17 % increase in code size. Accurate collection is essential in the context of real-time systems, we thus validate our approach with the implementation of a real-time concurrent garbage collection algorithm. 1.
Widening Integer Arithmetic
"... Some codes require computations to use fewer bits of precision than are normal for the target machine. For example, Java requires 32-bit arithmetic even on a 64-bit target. To run narrow codes on a wide target machine, we present a widening transformation. Almost every narrow operation can be wi ..."
Abstract
-
Cited by 5 (2 self)
- Add to MetaCart
Some codes require computations to use fewer bits of precision than are normal for the target machine. For example, Java requires 32-bit arithmetic even on a 64-bit target. To run narrow codes on a wide target machine, we present a widening transformation. Almost every narrow operation can be widened by sign- or zero-extending the operands and using a target-machine instruction at its natural width. But extensions can sometimes be avoided, and our transformation avoids as many as possible. The key idea is knowing what each operation can accept in the high bits of its arguments and what it can guarantee about the high bits of its result. This knowledge is formalized using fill types, which drive the widening transformation.
An Applicative Control-Flow Graph Based on Huet’s Zipper
"... We are using ML to build a compiler that does low-level optimization. To support optimizations in classic imperative style, we built a control-flow graph using mutable pointers and other mutable state in the nodes. This decision proved unfortunate: the mutable flow graph was big and complex, and it ..."
Abstract
-
Cited by 5 (5 self)
- Add to MetaCart
We are using ML to build a compiler that does low-level optimization. To support optimizations in classic imperative style, we built a control-flow graph using mutable pointers and other mutable state in the nodes. This decision proved unfortunate: the mutable flow graph was big and complex, and it led to many bugs. We have replaced it by a smaller, simpler, applicative flow graph based on Huet’s (1997) zipper. The new flow graph is a success; this paper presents its design and shows how it leads to a gratifyingly simple implementation of the dataflow framework developed by Lerner, Grove, and Chambers (2002). 1
Staged Allocation: A Compositional Technique for Specifying and Implementing Procedure Calling Conventions
, 2006
"... We present staged allocation, a technique for specifying calling conventions by composing tiny allocators called stages. A specification written using staged allocation has a precise, formal semantics, and it can be executed directly inside a compiler. Specifications of nine standard C calling conve ..."
Abstract
-
Cited by 4 (4 self)
- Add to MetaCart
We present staged allocation, a technique for specifying calling conventions by composing tiny allocators called stages. A specification written using staged allocation has a precise, formal semantics, and it can be executed directly inside a compiler. Specifications of nine standard C calling conventions range in size from 15 to 30 lines each. An implementation of staged allocation takes about 250 lines of ML or 650 lines of C++. Each specification can be used not only to help a compiler implement the calling convention but also to generate a test suite.
First Class Rules and Generic Traversals for Program Transformation Languages
- Utrecht University
, 2001
"... The subject of this thesis is the construction of programming languages suitable for the implementation of program transformation systems. First class rules and generic traversals are especially useful in such languages. Stratego, a language specifically intended for program transformations, support ..."
Abstract
-
Cited by 3 (2 self)
- Add to MetaCart
The subject of this thesis is the construction of programming languages suitable for the implementation of program transformation systems. First class rules and generic traversals are especially useful in such languages. Stratego, a language specifically intended for program transformations, supports these features, but is untyped and impure. In this thesis we develop a pure non-strict functional language called RhoStratego, incorporating features from Stratego. First class rules are obtained through the equivalent of Stratego's left-biased choice operator. This approach is not only useful to strategic programming, but is also more powerful than existing proposals to extend pattern matching, such as views and pattern guards. Stratego's generic traversal primitives are implemented through a more fundamental mechanism, the application pattern match, whereby constructed values can be deconstructed in a generic and typeable fashion. We present the syntax and semantics of the language, as well as the semantics of a strict variant. Furthermore, we have developed a type system for RhoStratego, which consists of the Hindley-Milner type system extended with rank-2 polymorphism and typing rules to support generic traversals. The type system is powerful enough to allow, and ensure the safety of, type unifying and type preserving generic transformations. We have implemented a type checker that infers all types, except rank-2 types for which annotations must be given. We also discuss the results of the implementation of a compiler for RhoStratego, and in particular how generic traversals and the choice operator can be implemented. Contents 1
SINTL: A Strongly-Typed Generic Intermediate Language for Scheme
- Northwestern University, Computer Science Honors Thesis
, 2000
"... This paper describes SINTL, a strongly-typed generic intermediate language for Scheme. The paper begins by outlining the motivation for developing a sophisticated intermediate language for a new Scheme compiler. We consider two novel aspects of SINTL as an intermediate language for Scheme, a declara ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
This paper describes SINTL, a strongly-typed generic intermediate language for Scheme. The paper begins by outlining the motivation for developing a sophisticated intermediate language for a new Scheme compiler. We consider two novel aspects of SINTL as an intermediate language for Scheme, a declarative type system and type inference algorithm, and a register to stack machine conversion algorithm. We then demonstrate the effectiveness of these two techniques by discussing the JVM-SINTL backend, a fully functional backend to the Java Virtual Machine. Following a discussion of the representational choices and compilation techniques used in JVM-SINTL, we compare the performance of the JVM-SINTL backend relative to several popular Scheme compilers. Ultimately, this thesis demonstrates that a sophisticated compiler with well-selected analyses and optimizations can generate high-quality code running on the JVM, and acheive performance an order of magnitude better than current Scheme compilers to the JVM.
Faster laziness using dynamic pointer tagging
- In Proc. ICFP ’07
, 2007
"... In the light of evidence that Haskell programs compiled by GHC exhibit large numbers of mispredicted branches on modern processors, we re-examine the “tagless ” aspect of the STG-machine that GHC uses as its evaluation model. We propose two tagging strategies: a simple strategy called semitagging th ..."
Abstract
-
Cited by 3 (1 self)
- Add to MetaCart
In the light of evidence that Haskell programs compiled by GHC exhibit large numbers of mispredicted branches on modern processors, we re-examine the “tagless ” aspect of the STG-machine that GHC uses as its evaluation model. We propose two tagging strategies: a simple strategy called semitagging that seeks to avoid one common source of unpredictable indirect jumps, and a more complex strategy called dynamic pointertagging that uses the spare low bits in a pointer to encode information about the pointed-to object. Both of these strategies have been implemented and exhaustively measured in the context of a production compiler, GHC, and the paper contains detailed descriptions of the implementations. Our measurements demonstrate significant performance improvements (14 % for dynamic pointer-tagging with only a 2 % increase in code size), and we further demonstrate that much of the improvement can be attributed to the elimination of mispredicted branch instructions. As part of our investigations we also discovered that one optimisation in the STG-machine, vectored-returns, is no longer worthwhile and we explain why.

