
Run-time code generation (RTCG) enables program optimizations specific to values that are unknown until run time and improves the performance. This paper shows that RTCG can be used to determine dynamic method dispatches. It can produce a better result than conventional method dispatch prediction mechanisms because other run-time optimizations help the determination. Further, the determined functions can be inlined, and this may lead to other optimizations. These optimizations are implemented in the author’s RTCG system. The evaluation results showed good performance improvement.
We show how to increase locality of object-oriented programs using several heaps. We introduce the notion of sandwich types which allow a coarser view on objects. Our idea for increasing locality is to use one heap per object of sandwich types. Performance measurements demonstrate that the running time is improved by upto a factor 5 using this strategy. The paper shows how to derive sandwich types from classes. Thus, it is possible to control the allocation of the different heaps using compile-time information.
We describe a type system and typed semantics that use a hierarchy of monads to describe and delimit a variety of effects, including non-termination, exceptions, and state, in a call-by-value functional language. The type system and semantics can be used to organize and justify a variety of optimizing transformations in the presence of effects. In addition, we describe a simple monad inferencing algorithm that computes the minimum effect for each subexpression of a program, and provides more accurate effects information than local syntactic methods.
This paper presents STAL, a variant of Typed Assembly Language with constructs and types to support a limited form of stack allocation. As with other statically-typed low-level languages, the type system of STAL ensures that a wide class of errors cannot occur at run time, and therefore the language can be adapted for use in certifying compilers where security is a concern, Like the Java Virtual Machine Language (JVML), STAL supports stack allocation of local variables and procedure activation records, but unlike the JVML, STAL does not pre-suppose fixed notions of procedures, exceptions, or calling conventions. Rather, compiler writers can choose encodings for these high-level constructs using the more primitive RISC-like mechanisms of STAL. Consequently, some important optimizations that are impossible to perform within the JVML, such as tail call elimination or callee-saves registers, can be easily expressed within STAL.
On the basis of an A-normal form intermediate language we formally specify resource allocation in a compiler for a strict functional language. Here, resource is to be understood in the most general sense: registers, temporaries, data representations, etc. All these should be (and can be, but have never been) specified formally. Our approach employs a non-standard annotated type system for the formalization. Although A-normal form turns out not to be the ideal vehicle for this investigation, we can prove some basic properties using the formalization.