skip to main content
10.1145/1508293.1508304acmconferencesArticle/Chapter ViewAbstractPublication PagesveeConference Proceedingsconference-collections
research-article

Tracing for web 3.0: trace compilation for the next generation web applications

Published:11 March 2009Publication History

ABSTRACT

Today's web applications are pushing the limits of modern web browsers. The emergence of the browser as the platform of choice for rich client-side applications has shifted the use of in-browser JavaScript from small scripting programs to large computationally intensive application logic. For many web applications, JavaScript performance has become one of the bottlenecks preventing the development of even more interactive client side applications. While traditional just-in-time compilation is successful for statically typed virtual machine based languages like Java, compiling JavaScript turns out to be a challenging task. Many JavaScript programs and scripts are short-lived, and users expect a responsive browser during page loading. This leaves little time for compilation of JavaScript to generate machine code.

We present a trace-based just-in-time compiler for JavaScript that uses run-time profiling to identify frequently executed code paths, which are compiled to executable machine code. Our approach increases execution performance by up to 116% by decomposing complex JavaScript instructions into a simple Forth-based representation, and then recording the actually executed code path through this low-level IR. Giving developers more computational horsepower enables a new generation of innovative web applications.

References

  1. Adobe Systems Inc. ActionScript 3 Language Specification, 2006. http://livedocs.adobe.com/specs/actionscript/3/wwhelp/wwhimpl/js/html/wwhelp.htm.Google ScholarGoogle Scholar
  2. Adobe Systems Inc. ActionScript Virtual Machine 2 Overview, 2007. http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf.Google ScholarGoogle Scholar
  3. Adobe Systems Inc. Adobe Flex SDK, 2008. http://www.adobe.com/products/flex/flexdownloads/#sdk.Google ScholarGoogle Scholar
  4. O. Agesen, J. Palsberg, and M. I. Schwartzbach. Type Inference of SELF: Analysis of Objects with Dynamic and Multiple Inheritance. Software Practice and Experience, 25(9):975--995, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Aiken and B. Murphy. Static Type Inference in a Dynamically Typed Language. In Proceedings of the ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 279--290. ACM Press, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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, pages 1--12. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. R. Bell. Threaded Code. Communications of the ACM, 16(6):370--372, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Chambers and D. Ungar. Customization: Optimizing Compiler Technology for SELF, a Dynamically-Typed Object-Oriented Programming Language. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 146--160. ACM Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Cousot and R. Cousot. Systematic Design of Program Analysis Frameworks. In Proceedings of the ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pages 269--282. ACM Press, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and F. Zadeck. Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. ECMA. Standard ECMA-262: ECMAScript Language Specification, 3rd edition, 1999. http://www.ecma-international.org/publications/standards/Ecma-262.htm.Google ScholarGoogle Scholar
  12. M. Ertl and D. Gregg. The Structure and Performance of Efficient Interpreters. Journal of Instruction-Level Parallelism, 5:1--25, 2003.Google ScholarGoogle Scholar
  13. A. Gal, C. W. Probst, and M. Franz. HotpathVM: An Effective JIT Compiler for Resource-Constrained Devices. In Proceedings of the International Conference on Virtual Execution Environments, pages 144--153. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Garrett, J. Dean, D. Grove, and C. Chambers. Measurement and Application of Dynamic Receiver Class Distributions. Technical Report CSE-TR-94-03-05, University of Washington, 1994.Google ScholarGoogle Scholar
  15. J. O. Graver and R. E. Johnson. A Type System for Smalltalk. In Proceedings of the ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 136--150. ACM Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. U. Hölzle, C. Chambers, and D. Ungar. Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches. In Proceedings of the European Conference on Object-Oriented Programming, pages 21--38. LNCS 512, Springer-Verlag, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. U. Hölzle and D. Ungar. Optimizing Dynamically-Dispatched Calls with Run-Time Type Feedback. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 326--336. ACM Press, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. JavaScript:TraceMonkey - Mozilla Wiki, 2008. https://wiki.mozilla.org/JavaScript:TraceMonkey.Google ScholarGoogle Scholar
  19. T. Lindholm and F. Yellin. The JavaTM Virtual Machine Specification. Addison-Wesley, 2nd edition, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Microsoft Developer Network. JScript (Windows Script Technologies), 2008. http://msdn.microsoft.com/en-us/library/hbxc2t98(VS.85).aspx.Google ScholarGoogle Scholar
  21. R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  22. Mozilla Foundation. SpiderMonkey (JavaScript-C) Engine, 2008. http://www.mozilla.org/js/spidermonkey/.Google ScholarGoogle Scholar
  23. Mozilla Foundation. Tamarin Central, 2008. http://hg.mozilla.org/tamarin-central/.Google ScholarGoogle Scholar
  24. F. Nielson. Program Transformations in a Denotational Setting. ACM Transactions on Programming Languages and Systems, 7(3):359--379, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Pall. LuaJIT Roadmap, 2008. http://lua-users.org/lists/lua-l/2008-02/msg00051.html.Google ScholarGoogle Scholar
  26. Y. Shi, K. Casey, M. A. Ertl, and D. Gregg. Virtual Machine Showdown: Stack Versus Registers. ACM Transactions on Architecture and Code Optimization, 4(4):1--36, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. SunSpider JavaScript Benchmark, 2008. http://webkit.org/perf/sunspider-0.9/sunspider.html.Google ScholarGoogle Scholar
  28. Surfin' Safari -- Blog Archive -- Announcing SquirrelFish, 2008. http://webkit.org/blog/189/announcing-squirrelfish/.Google ScholarGoogle Scholar
  29. S. Thatte. Type inference with partial types. In Proceedings of the International Colloquium on Automata, Languages and Programming, pages 615--629. LNCS 317, Springer-Verlag, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Zaleski, A. D. Brown, and K. Stoodley. YETI: A graduallY Extensible Trace Interpreter. In Proceedings of the International Conference on Virtual Execution Environments, pages 83--93. ACM Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Tracing for web 3.0: trace compilation for the next generation web applications

    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
    • Published in

      cover image ACM Conferences
      VEE '09: Proceedings of the 2009 ACM SIGPLAN/SIGOPS international conference on Virtual execution environments
      March 2009
      148 pages
      ISBN:9781605583754
      DOI:10.1145/1508293

      Copyright © 2009 ACM

      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 ACM 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]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 11 March 2009

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate80of235submissions,34%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader