skip to main content
article

JavaScript AOT compilation

Published:06 April 2020Publication History
Skip Abstract Section

Abstract

Static compilation, a.k.a., ahead-of-time (AOT) compilation, is an alternative approach to JIT compilation that can combine good speed and lightweight memory footprint, and that can accommodate read-only memory constraints that are imposed by some devices and some operating systems. Unfortunately the highly dynamic nature of JavaScript makes it hard to compile statically and all existing AOT compilers have either gave up on good performance or full language support. We have designed and implemented an AOT compiler that aims at satisfying both. It supports full unrestricted ECMAScript 5.1 plus many ECMAScript 2017 features and the majority of benchmarks are within 50

References

  1. C. Anderson and et al. 2005. Towards Type Inference for Javascript. In Proceedings of the 19th European Conference on Object-Oriented Programming (ECOOP’05). Springer-Verlag, Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Andreasen and A. Møller. 2014. Determinacy in static analysis for jQuery. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2014, part of SPLASH 2014, Portland, OR, USA, October 20-24, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Stephen M. Blackburn and Kathryn S. McKinley. 2008. Immix: A Markregion Garbage Collector with Space Efficiency, Fast Collection, and Mutator Performance. In Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’08). New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. H.J. Boehm and M. Weiser. 1988. Garbage Collection in an Uncooperative Environment. Software, Practice, and Experience 18, 9 (Sept. 1988). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. C. F. Bolz, L. Diekmann, and L. Tratt. 2013. Storage Strategies for Collections in Dynamically Typed Languages. In ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Chambers and D. Ungar. 1989. Customization: Optimizing Compiler Technology for SELF, A Dynamically-Typed Object-Oriented Programming Language. In Conference Proceedings on Programming Language Design and Implementation (PLDI ’89). ACM, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Chandra, C. S. Gordon, J-B. Jeannin, C. Schlesinger, M. Sridharan, F. Tip, and Y. Choi. 2016. Type Inference for Static Compilation of JavaScript. In Proceedings of the 2016 ACM SIGPLAN International Conference on ObjectOriented Programming, Systems, Languages, and Applications (OOPSLA 2016). ACM, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Chang, E. Smith, R. Reitmaier, M. Bebenita, A. Gal, C. Wimmer, B. Eich, and M. Franz. 2009. Tracing for web 3.0: trace compilation for the next generation web applications. In In Proceedings of the International Conference on Virtual Execution Environments. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Chevalier-Boisvert and M. Feeley. 2015. Simple and Effective Type Check Removal through Lazy Basic Block Versioning. In 29th European Conference on Object-Oriented Programming, ECOOP 2015, July 5-10, 2015, Prague, Czech Republic.Google ScholarGoogle Scholar
  10. M. Chevalier-Boisvert and M. Feeley. 2016. Interprocedural Type Specialization of JavaScript Programs Without Type Analysis. In 30th European Conference on Object-Oriented Programming, ECOOP 2016, July 18-22, 2016, Rome, Italy.Google ScholarGoogle Scholar
  11. W. Choi, S. Chandra, G. Necula, and L. Sen. 2015. SJS: A Type System for JavaScript with Fixed Object Layout. In Static Analysis - 22nd International Symposium, SAS’15. Saint-Malo, France, 181–198.Google ScholarGoogle Scholar
  12. P. Cousot, R. Cousot, J. Feret, L. Mauborgne, A. Miné, D. Monniaux, and X. Rival. 2007. Combination of Abstractions in the ASTRÉE Static Analyzer. Springer Berlin Heidelberg, Berlin, Heidelberg.Google ScholarGoogle Scholar
  13. Clifford. D., H. Payer, M. Stanton, and B. Titzer. 2015. Memento Mori: Dynamic Allocation-site-based Optimizations. In Proceedings of the 2015 ACM SIGPLAN International Symposium on Memory Management. New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Deutsch and A. Schiffman. 1984. Efficient Implementation of the Smalltalk80 System. In Proceedings of the 11th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL ’84). ACM, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. ECMA International. 2015. Standard ECMA-262 - ECMAScript Language Specification (6.0 ed.).Google ScholarGoogle Scholar
  16. ECMA International. 2016. ECMAScript Test Suite (2 ed.). Technical Report TR/104.Google ScholarGoogle Scholar
  17. A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. 2009. 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, Dublin, Ireland, June 15-21, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Ghuloum and K. Dybvig. 2009. Fixing Letrec (reloaded). In Workshop on Scheme and Functional Programming. Cambridge, MA, USA.Google ScholarGoogle Scholar
  19. L. Gong, M. Pradel, and K. Sen. 2014. JITPROF: Pinpointing JIT-unfriendly JavaScript Code. Technical Report UCB/EECS-2014-144.Google ScholarGoogle Scholar
  20. Google. 2018. V8 JavaScript Engine. http://developers.google.com/v8.Google ScholarGoogle Scholar
  21. B. Hackett and S-Y. Guo. 2012. Fast and Precise Hybrid Type Inference for JavaScript. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’12). ACM, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. U. Hölzle, C. Chambers, and D. Ungar. 1991. Optimizing DynamicallyTyped Object-Oriented Languages With Polymorphic Inline Caches. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP ’91). Springer-Verlag, London, UK, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S H. Jensen, A. Møller, and P. Thiemann. 2009. Type Analysis for JavaScript. In Proceedings of the 16th International Symposium on Static Analysis (SAS ’09). Springer-Verlag, Berlin, Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Kangax. 2018. ECMAScript Compatibility Table. https://kangax.github.io/ compat-table/es6/.Google ScholarGoogle Scholar
  25. A. M. Kent, D. Kempe, and S. Tobin-Hochstadt. 2016. Occurrence Typing Modulo Theories. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’16). USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. B. S. Lerner, J. Politz, J.G., A. Guha, and S. Krishnamurthi. 2013. TeJaS: Retrofitting Type Systems for JavaScript. In Proceedings of the 9th Symposium on Dynamic Languages (DLS ’13). ACM, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. F. Logozzo and H. Venter. 2010. RATA: Rapid Atomic Type Analysis by Abstract Interpretation - Application to JavaScript Optimization. In Compiler Construction, 19th International Conference, CC 2010, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2010, Paphos, Cyprus, March 20-28, 2010. Proceedings. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Microsoft. 2013. TypeSscript, Language Specification, version 0.9.5.Google ScholarGoogle Scholar
  29. C. Park and S. Ryu. 2015. Scalable and Precise Static Analysis of JavaScript Applications via Loop-Sensitivity. In 29th European Conference on ObjectOriented Programming, ECOOP 2015, Prague, Czech Republic.Google ScholarGoogle Scholar
  30. M. Schäfer, M. Sridharan, J. Dolby, and F. Tip. 2013. Dynamic determinacy analysis. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, Seattle, WA, USA, June 16-19, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. S. Tobin-Hochstadt and M. Felleisen. 2010. Logical Types for Untyped Languages. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming (ICFP ’10). ACM, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. O. Waddell, D. Sarkar, and K. Dybvig. 2005. Fixing Letrec: A Faithful Yet Efficient Implementation of Scheme’s Recursive Binding Construct. HigherOrder and Symbolic Computation 18, 3 (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. JavaScript AOT compilation

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 53, Issue 8
          DLS '18
          August 2018
          100 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3393673
          Issue’s Table of Contents
          • cover image ACM Conferences
            DLS 2018: Proceedings of the 14th ACM SIGPLAN International Symposium on Dynamic Languages
            October 2018
            100 pages
            ISBN:9781450360302
            DOI:10.1145/3276945

          Copyright © 2018 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 6 April 2020

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!