The Treewidth of Java Programs - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Communication Dans Un Congrès Année : 2002

The Treewidth of Java Programs

Ole A. Mæhle
  • Fonction : Auteur
Jan Arne Telle
  • Fonction : Auteur
  • PersonId : 889063

Résumé

Intuitively, the treewidth of a graph $G$ measures how close $G$ is to being a tree. The lower the treewidth, the faster we can solve various optimization problems on $G$, by dynamic programming along the tree structure. In the paper M.Thorup, All Structured |Programs have Small Tree-Width and Good Register Allocation [8] it is shown that the control-flow graph of any goto-free C program is at most 6. This result opened for the possibility of applying the dynamic programming bounded treewidth algorithms to various |compiler optimization tasks. In this paper we explore this possibility, in particular for Java programs. We first show that even if Java does not have a goto, the labelled break and continue statements are in a sense equally bad, and can be used to construct Java programs that are arbitrarily hard to understand and optimize. For Java programs lacking these labelled constructs Thorup's result for C still holds, and in the second part of the paper we |analyze the treewidth of label-free Java programs empirically. We do this by means of a parser that computes a tree-decomposition of the control-flow graph of a given Java program. We report on experiments running the parser on several of the Java API |packages, and the results tell us that on average the treewidth of the control-flow graph of these Java programs is no more than 2.5. This is the first empirical test of Thorup's result, and it confirms our suspicion that the upper bounds of treewidth 6, 5 and 4 are rarely met in practice, boding well for the application of treewidth to compiler optimization.
Fichier non déposé

Dates et versions

inria-00100731 , version 1 (26-09-2006)

Identifiants

  • HAL Id : inria-00100731 , version 1

Citer

Jens Gustedt, Ole A. Mæhle, Jan Arne Telle. The Treewidth of Java Programs. 4th International Workshop on Algorithm Engineering and Experiments - ALENEX'02, 2002, San Francisco, CA US, 12 p. ⟨inria-00100731⟩
102 Consultations
0 Téléchargements

Partager

Gmail Facebook X LinkedIn More