Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2535838.2535866acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Tracing compilation by abstract interpretation

Published: 08 January 2014 Publication History

Abstract

Tracing just-in-time compilation is a popular compilation schema for the efficient implementation of dynamic languages, which is commonly used for JavaScript, Python, and PHP. It relies on two key ideas. First, it monitors the execution of the program to detect so-called hot paths, i.e., the most frequently executed paths. Then, it uses some store information available at runtime to optimize hot paths. The result is a residual program where the optimized hot paths are guarded by sufficient conditions ensuring the equivalence of the optimized path and the original program. The residual program is persistently mutated during its execution, e.g., to add new optimized paths or to merge existing paths. Tracing compilation is thus fundamentally different than traditional static compilation. Nevertheless, despite the remarkable practical success of tracing compilation, very little is known about its theoretical foundations.
We formalize tracing compilation of programs using abstract interpretation. The monitoring (viz., hot path detection) phase corresponds to an abstraction of the trace semantics that captures the most frequent occurrences of sequences of program points together with an abstraction of their corresponding stores, e.g., a type environment. The optimization (viz., residual program generation) phase corresponds to a transform of the original program that preserves its trace semantics up to a given observation as modeled by some abstraction. We provide a generic framework to express dynamic optimizations and to prove them correct. We instantiate it to prove the correctness of dynamic type specialization. We show that our framework is more general than a recent model of tracing compilation introduced in POPL~2011 by Guo and Palsberg (based on operational bisimulations). In our model we can naturally express hot path reentrance and common optimizations like dead-store elimination, which are either excluded or unsound in Guo and Palsberg's framework.

Supplementary Material

MP4 File (d1_left_t4.mp4)

References

[1]
V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: a transparent dynamic optimization system. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2000), pages 1--12, New York, NY, USA, 2000. ACM.
[2]
R. Barbuti, N. De Francesco, A. Santone, and G. Vaglini. Abstract interpretation of trace semantics for concurrent calculi. Information Processing Letters, 70(2):69--78, 1999.
[3]
M. Bebenita, F. Brandner, M. Fahndrich, F. Logozzo, W. Schulte, N. Tillmann, and H. Venter. SPUR: a trace-based JIT compiler for CIL. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA 2010), pages 708--725, New York, NY, USA, 2010. ACM.
[4]
I. Böhm, T.J.K. Edler von Koch, S.C. Kyle, B. Franke, and N. Topham. Generalized just-in-time trace compilation using a parallel task farm in a dynamic binary translator. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2011), pages 74--85, New York, NY, USA, 2011. ACM.
[5]
C.F. Bolz, A. Cuni, M. Fijałkowski, M. Leuschel, S. Pedroni, and A. Rigo. Allocation removal by partial evaluation in a tracing JIT. In Proceedings of the 20th ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM 2011), pages 43--52. ACM, 2011.
[6]
C.F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the metalevel: PyPy's tracing JIT compiler. In Proceedings of the 4thWorkshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems (ICOOOLPS 2009), pages 18--25, New York, NY, USA, 2009. ACM.
[7]
C. Colby and P. Lee. Trace-based program analysis. In Proceedings of the 23rd ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 1996), pages 195--207, New York, NY, USA, 1996. ACM.
[8]
P. Cousot. Constructive design of a hierarchy of semantics of a transition system by abstract interpretation (extended abstract). Electronic Notes in Theoretical Computer Science, 6(0):77--102, 1997. Proceedings of the 13th Annual Conference on Mathematical Foundations of Progamming Semantics (MFPS XIII).
[9]
P. Cousot. Constructive design of a hierarchy of semantics of a transition system by abstract interpretation. Theoretical Computer Science, 277(1-2):47--103, 2002.
[10]
P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 1977), pages 238--252, New York, NY, USA, 1977. ACM.
[11]
P. Cousot and R. Cousot. Systematic design of program analysis frameworks. In Proceedings of the 6th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 1979), pages 269--282, New York, NY, USA, 1979. ACM.
[12]
P. Cousot and R. Cousot. Systematic design of program transformation frameworks by abstract interpretation. In Proceedings of the 29th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 2002), pages 178--190, New York, NY, USA, 2002. ACM.
[13]
Mozilla Foundation. TraceMonkey. wiki.mozilla.org, October 2010.
[14]
Mozilla Foundation. IonMonkey. wiki.mozilla.org, May 2013.
[15]
A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M.R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E.W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2009), pages 465--478, New York, NY, USA, 2009. ACM.
[16]
A. Gal, C.W. Probst, and M. Franz. HotPathVM: an effective JIT compiler for resource-constrained devices. In Proceedings of the 2nd International Conference on Virtual Execution Environments (VEE 2006), pages 144--153. ACM, 2006.
[17]
S. Guo and J. Palsberg. The essence of compiling with traces. In Proceedings of the 38th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 2011), pages 563--574, New York, NY, USA, 2011. ACM.
[18]
M. Handjieva and S. Tzolovski. Refining static analyses by tracebased partitioning using control flow. In Proceedings of the 5th International Static Analysis Symposium (SAS 1998), volume 1503 of LNCS, pages 200--214. Springer, 1998.
[19]
Facebook Inc. The HipHop Virtual Machine, Facebook Engineering, December 2011.
[20]
Google Inc. A new crankshaft for V8, The Chromium Blog, December 2010.
[21]
Ecma International. ECMAScript Language Specification. Standard ECMA-262, Edition 5.1, June 2011.
[22]
F. Logozzo. Class invariants as abstract interpretation of trace semantics. Computer Languages, Systems and Structures, 35(2):100--142, 2009.
[23]
R. Milner. Communication and Concurrency. Prentice Hall, 1995.
[24]
M. Pall. The LuaJIT Project. luajit.org, 2005.
[25]
X. Rival. Symbolic transfer function-based approaches to certified compilation. In Proceedings of the 31st ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 2004), New York, NY, USA, 2004. ACM.
[26]
X. Rival and L. Mauborgne. The trace partitioning abstract domain. ACM Trans. Program. Lang. Syst., 29(5), 2007.
[27]
D.A. Schmidt. Trace-based abstract interpretation of operational semantics. Lisp Symb. Comput., 10(3):237--271, 1998.
[28]
F. Spoto and T. Jensen. Class analyses as abstract interpretations of trace semantics. ACM Trans. Program. Lang. Syst., 25(5):578--630, 2003.

Cited By

View all
  • (2021)ForerunnerProceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles10.1145/3477132.3483564(570-587)Online publication date: 26-Oct-2021
  • (2018)Dynamic tracingProceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis10.5555/3291656.3291702(1-13)Online publication date: 11-Nov-2018
  • (2018)Dynamic tracingProceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis10.1109/SC.2018.00037(1-13)Online publication date: 11-Nov-2018
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
January 2014
702 pages
ISBN:9781450325448
DOI:10.1145/2535838
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 08 January 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. abstract interpretation
  2. trace semantics
  3. tracing compilation

Qualifiers

  • Research-article

Conference

POPL '14
Sponsor:

Acceptance Rates

POPL '14 Paper Acceptance Rate 51 of 220 submissions, 23%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)13
  • Downloads (Last 6 weeks)2
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2021)ForerunnerProceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles10.1145/3477132.3483564(570-587)Online publication date: 26-Oct-2021
  • (2018)Dynamic tracingProceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis10.5555/3291656.3291702(1-13)Online publication date: 11-Nov-2018
  • (2018)Dynamic tracingProceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis10.1109/SC.2018.00037(1-13)Online publication date: 11-Nov-2018
  • (2017)Correctness of speculative optimizations with dynamic deoptimizationProceedings of the ACM on Programming Languages10.1145/31581372:POPL(1-28)Online publication date: 27-Dec-2017
  • (2016)An Abstract Interpretation-Based Model of Tracing Just-in-Time CompilationACM Transactions on Programming Languages and Systems10.1145/285313138:2(1-50)Online publication date: 4-Jan-2016
  • (2016)Automatic equivalence checking of programs with uninterpreted functions and integer arithmeticInternational Journal on Software Tools for Technology Transfer (STTT)10.1007/s10009-015-0366-118:4(359-374)Online publication date: 1-Aug-2016
  • (2015)A formal foundation for trace-based JIT compilersProceedings of the 13th International Workshop on Dynamic Analysis10.1145/2823363.2823369(25-30)Online publication date: 26-Oct-2015
  • (2015)Provably correct peephole optimizations with aliveACM SIGPLAN Notices10.1145/2813885.273796550:6(22-32)Online publication date: 3-Jun-2015
  • (2015)Provably correct peephole optimizations with aliveProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2737924.2737965(22-32)Online publication date: 3-Jun-2015
  • (2021)ForerunnerProceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles10.1145/3477132.3483564(570-587)Online publication date: 26-Oct-2021

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media