Modern programming languages offer much flexibility by means of new language concepts or even new programming paradigms like aspect-oriented programming. An example of an established such concept is virtual methods. To reduce the performance costs of the additional flexibility, modern execution environments, i.e., virtual machines, apply dynamic optimizations to the programs they execute, e.g., they can de-virtualize methods.
More advanced language concepts are aspect-oriented programming – which allows the programmer to flexibly add functionality to be executed under certain dynamic conditions – or predicate dispatch – in which a concrete method implementation is selected based on arbitrary predicates when multiple implementations apply at a call site.
In contrast to a static compiler, which has to perform optimizations based on pessimistic assumptions, a virtual machine can apply optimistic assumptions, when performing optimizations. If the assumption turns wrong later (e.g., because of dynamic class loading), optimizations based on it will to be undone. A second advantage of dynamic optimizations is that the profile of the running application, e.g., which control flow through a method is the most frequent one, can be considered.
At Software Technology Group we do research in developing dynamic optimizations for advanced language concepts. In concrete, we are developing a virtual machine with dedicated support for AspectJ-like aspect-oriented programming languages and partly support for predicate dispatch. Additionally, we also research how compilers and intermediate representations must be designed for such languages in order to facilitate dynamic optimizations. If you want to make your first steps in the research area, please contact Andreas Sewe for more information.