Parameter based constant propagation

  • Authors:
  • Péricles Rafael Oliveira Alves;Igor Rafael de Assis Costa;Fernando Magno Quintão Pereira;Eduardo Lage Figueiredo

  • Affiliations:
  • Departamento de Ciência da Computação, UFMG, Belo Horizonte, MG, Brazil;Departamento de Ciência da Computação, UFMG, Belo Horizonte, MG, Brazil;Departamento de Ciência da Computação, UFMG, Belo Horizonte, MG, Brazil;Departamento de Ciência da Computação, UFMG, Belo Horizonte, MG, Brazil

  • Venue:
  • SBLP'12 Proceedings of the 16th Brazilian conference on Programming Languages
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

JavaScript is nowadays the lingua franca of web browsers. This programming language is not only the main tool that developers have to implement the client side of web applications, but it is also the target of frameworks such as Google Web Toolkit. Given this importance, it is fundamental that JavaScript programs can be executed efficiently. Just-in-time (JIT) compilation is one of the keys to achieve this much necessary efficiency. An advantage that a JIT compiler has over a traditional compiler is the possibility to use runtime values to specialize the target code. In this paper we push JIT speculation to a new extreme: we have empirically observed that many JavaScript functions are called only once during a typical browser section. A natural way to capitalize on this observation is to specialize the code produced by a function to the particular values that are passed to this function as parameters. We have implemented this approach on IonMonkey, the newest JIT compiler used in the Mozilla Firefox browser. By coupling this type of parameter specialization with constant propagation, a classical compiler optimization, we have been able to experimentally observe speedups of up to 25% on well-known algorithms. These gains are even more remarkable because they have been obtained over a worldly known, industrial quality JavaScript runtime environment.