Phase detection using trace compilation

  • Authors:
  • Christian Wimmer;Marcelo S. Cintra;Michael Bebenita;Mason Chang;Andreas Gal;Michael Franz

  • Affiliations:
  • University of California, Irvine;University of California, Irvine;University of California, Irvine;University of California, Irvine;University of California, Irvine;University of California, Irvine

  • Venue:
  • PPPJ '09 Proceedings of the 7th International Conference on Principles and Practice of Programming in Java
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic compilers can optimize application code specifically for observed code behavior. Such behavior does not have to be stable across the entire program execution to be beneficial for optimizations, it must only be stable for a certain program phase. To specialize code for a program phase, it is necessary to detect when the execution behavior of the program changes (phase change). Trace-based compilation is an efficient method to detect such phase changes. A trace tree is a collection of frequently executed code paths through a code region, which is assembled dynamically at run time as the program executes. Program execution tends to remain within such a trace tree during a stable phase, whereas phase changes cause a sudden increase in side exits from the trace tree. Because trace trees are recorded at run time by observing the interpreter, the actual values of variables and expressions are also available. This allows a definition of phases based not only on recurring control flow, but also on recurring data values. The compiler can use constant values for variables that change their value rarely and rely on phase detection to handle the case when the variable value actually changes. Our evaluation shows that phase detection based on trace trees results in phases that match the intuitive expectation of a programmer and that are also useful for compiler optimizations.