Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
tutorial
Public Access

ShortCut: Architectural Support for Fast Object Access in Scripting Languages

Published: 24 June 2017 Publication History
  • Get Citation Alerts
  • Abstract

    The same flexibility that makes dynamic scripting languages appealing to programmers is also the primary cause of their low performance. To access objects of potentially different types, the compiler creates a dispatcher with a series of if statements, each performing a comparison to a type and a jump to a handler. This induces major overhead in instructions executed and branches mispredicted.
    This paper proposes architectural support to significantly improve the efficiency of accesses to objects. The idea is to modify the instruction that calls the dispatcher so that, under most conditions, it skips most of the branches and instructions needed to reach the correct handler, and sometimes even the execution of the handler itself. Our novel architecture, called ShortCut, performs two levels of optimization. Its Plain design transforms the call to the dispatcher into a call to the correct handler --- bypassing the whole dispatcher execution. Its Aggressive design transforms the call to the dispatcher into a simple load or store --- bypassing the execution of both dispatcher and handler. We implement the ShortCut software in the state-of-the-art Google V8 JIT compiler, and the ShortCut hardware in a simulator. We evaluate ShortCut with the Octane and SunSpider JavaScript application suites. Plain ShortCut reduces the average execution time of the applications by 30% running under the baseline compiler, and by 11% running under the maximum level of compiler optimization. Aggressive ShortCut performs only slightly better.

    References

    [1]
    ECMAScript. http://www.ecmascript.org/.
    [2]
    JavaScriptCore. https://trac.webkit.org/wiki/JavaScriptCore.
    [3]
    Node.js. https://nodejs.org/.
    [4]
    Octane Benchmark. https://developers.google.com/octane/.
    [5]
    Python Programming Language. https://www.python.org/.
    [6]
    Ruby on Rails. http://rubyonrails.org/.
    [7]
    Ruby Programming Language. https://www.ruby-lang.org/.
    [8]
    SunSpider Benchmark. https://webkit.org/perf/sunspider/sunspider.html.
    [9]
    The Chromium Projects. https://www.chromium.org/.
    [10]
    Tizen. https://www.tizen.org/.
    [11]
    V8 JavaScript Engine. https://developers.google.com/v8/.
    [12]
    Varun Agrawal, Abhiroop Dabral, Tapti Palit, Yongming Shen, and Michael Ferdman. 2015. Architectural Support for Dynamic Linking. In Proceedings of the Twentieth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '15). ACM, New York, NY, USA, 691--702.
    [13]
    Wonsun Ahn, Jiho Choi, Thomas Shull, Maria J. Garzaran, and Josep Torrellas. 2014. Improving JavaScript Performance by Deconstructing the Type System. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '14). ACM, New York, NY, USA, 496--507.
    [14]
    Owen Anderson, Emily Fortuna, Luis Ceze, and Susan Eggers. 2011. Checked Load: Architectural Support for JavaScript Type-checking on Mobile Processors. In Proceedings of the 2011 IEEE 17th International Symposium on High Performance Computer Architecture (HPCA '11). 419--430.
    [15]
    Benedikt Meurer. 2017. V8: Behind the Scenes (February Edition feat. A tale of TurboFan). http://benediktmeurer.de/2017/03/01/v8-behind-the-scenes-february-edition/. (March 2017).
    [16]
    Burton H. Bloom. 1970. Space/Time Trade-offs in Hash Coding with Allowable Errors. Commun. ACM 13, 7 (July 1970), 422--426.
    [17]
    Trevor E. Carlson, Wim Heirman, Stijn Eyerman, Ibrahim Hur, and Lieven Eeckhout. 2014. An Evaluation of High-Level Mechanistic Core Models. ACM Trans. Archit. Code Optim. 11, 3, Article 28 (Aug. 2014), 25 pages.
    [18]
    Gaurav Chadha, Scott Mahlke, and Satish Narayanasamy. 2015. Accelerating Asynchronous Programs Through Event Sneak Peek. In Proceedings of the 42Nd Annual International Symposium on Computer Architecture (ISCA '15). ACM, New York, NY, USA, 642--654.
    [19]
    Craig Chambers, David Ungar, and Elgin Lee. 1989. An Efficient Implementation of SELF, a Dynamically-typed Object-oriented Language Based on Prototypes. In Conference Proceedings on Object-oriented Programming Systems, Languages and Applications (OOPSLA '89). ACM, New York, NY, USA, 49--70.
    [20]
    L. Peter Deutsch and Allan M. Schiffman. 1984. Efficient Implementation of the Smalltalk-80 System. In Proceedings of the 11th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL '84). ACM, New York, NY, USA, 297--302.
    [21]
    Gem Dot, Alejandro Martínez, and Antonio González. 2016. ERICO: Effective Removal of Inline Caching Overhead in Dynamic Typed Languages. In Proceedings of the 2016 IEEE 23rd International Conference on High Performance Computing (HiPC '16). 372--381.
    [22]
    Chen Lei Farooq, Muhammad Umar and Lizy K. John. 2010. Value Based BTB Indexing for Indirect Jump Prediction. In Proceedings of the 2010 IEEE 16th International Symposium on High Performance Computer Architecture (HPCA '10). 1--11.
    [23]
    Urs Hölzle, Craig Chambers, and David Ungar. 1991. Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP '91). Springer-Verlag, London, UK, UK, 21--38. http://dl.acm.org/citation.cfm?id=646149.679193
    [24]
    José A. Joao, Onur Mutlu, Hyesoon Kim, Rishi Agarwal, and Yale N. Patt. 2008. Improving the Performance of Object-oriented Languages with Dynamic Predication of Indirect Jumps. In Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS XIII). ACM, New York, NY, USA, 80--90.
    [25]
    Channoh Kim, Sungmin Kim, Hyeon Gyu Cho, Dooyoung Kim, Jaehyeok Kim, Young H. Oh, Hakbeom Jang, and Jae W. Lee. 2016. Short-Circuit Dispatch: Accelerating Virtual Machine Interpreters on Embedded Processors. In Proceedings of the 43rd Annual International Symposium on Computer Architecture (ISCA '16). 291--303.
    [26]
    Hyesoon Kim, José A. Joao, Onur Mutlu, Chang Joo Lee, Yale N. Patt, and Robert Cohn. 2007. VPC Prediction: Reducing the Cost of Indirect Branches via Hardware-based Dynamic Devirtualization. In Proceedings of the 34th Annual International Symposium on Computer Architecture (ISCA '07). ACM, New York, NY, USA, 424--435.
    [27]
    Johnny K. F. Lee and Alan Jay Smith. 1984. Branch Prediction Strategies and Branch Target Buffer Design. Computer 17, 1 (Jan. 1984), 6--22.
    [28]
    Chi-Keung Luk, Robert Cohn, Robert Muth, Harish Patil, Artur Klauser, Geoff Lowney, Steven Wallace, Vijay Janapa Reddi, and Kim Hazelwood. 2005. Pin: Building Customized Program Analysis Tools with Dynamic Instrumentation. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '05). ACM, New York, NY, USA, 190--200.
    [29]
    Mojtaba Mehrara, Po-Chun Hsu, Mehrzad Samadi, and Scott Mahlke. 2011. Dynamic Parallelization of JavaScript Applications Using an Ultra-lightweight Speculation Mechanism. In Proceedings of the 2011 IEEE 17th International Symposium on High Performance Computer Architecture (HPCA '11). IEEE Computer Society, Washington, DC, USA, 87--98. http://dl.acm.org/citation.cfm?id=2014698.2014898
    [30]
    Mojtaba Mehrara and Scott Mahlke. 2011. Dynamically Accelerating Client-side Web Applications Through Decoupled Execution. In Proceedings of the 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO '11). IEEE Computer Society, Washington, DC, USA, 74--84. http://dl.acm.org/citation.cfm?id=2190025.2190055
    [31]
    Kristen Nygaard and Ole-Johan Dahl. 1978. The Development of the SIMULA Languages. SIGPLAN Not. 13, 8 (Aug. 1978), 245--272.
    [32]
    Yuhao Zhu, Daniel Richins, Matthew Halpern, and Vijay Janapa Reddi. 2015. Microarchitectural Implications of Event-driven Server-side Web Applications. In Proceedings of the 48th International Symposium on Microarchitecture (MICRO-48). ACM, New York, NY, USA, 762--774.

    Cited By

    View all
    • (2021)Judging a type by its pointer: optimizing GPU virtual functionsProceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3445814.3446734(241-254)Online publication date: 19-Apr-2021
    • (2021)Judging a type by its pointer: optimizing GPU virtual functionsProceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3445814.3446734(241-254)Online publication date: 19-Apr-2021
    • (2020)Type freezing: exploiting attribute type monomorphism in tracing JIT compilersProceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization10.1145/3368826.3377907(16-29)Online publication date: 22-Feb-2020
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGARCH Computer Architecture News
    ACM SIGARCH Computer Architecture News  Volume 45, Issue 2
    ISCA'17
    May 2017
    715 pages
    ISSN:0163-5964
    DOI:10.1145/3140659
    Issue’s Table of Contents
    • cover image ACM Conferences
      ISCA '17: Proceedings of the 44th Annual International Symposium on Computer Architecture
      June 2017
      736 pages
      ISBN:9781450348928
      DOI:10.1145/3079856
    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].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 24 June 2017
    Published in SIGARCH Volume 45, Issue 2

    Check for updates

    Author Tags

    1. Inline Caching
    2. JavaScript
    3. Microarchitecture
    4. Scripting Language

    Qualifiers

    • Tutorial
    • Research
    • Refereed limited

    Funding Sources

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)88
    • Downloads (Last 6 weeks)13
    Reflects downloads up to 11 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2021)Judging a type by its pointer: optimizing GPU virtual functionsProceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3445814.3446734(241-254)Online publication date: 19-Apr-2021
    • (2021)Judging a type by its pointer: optimizing GPU virtual functionsProceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3445814.3446734(241-254)Online publication date: 19-Apr-2021
    • (2020)Type freezing: exploiting attribute type monomorphism in tracing JIT compilersProceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization10.1145/3368826.3377907(16-29)Online publication date: 22-Feb-2020
    • (2019)Characterization of Unnecessary Computations in Web Applications2019 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS)10.1109/ISPASS.2019.00010(11-21)Online publication date: Mar-2019
    • (2018)JSCore: architectural support for accelerating JavaScript execution (short WIP paper)ACM SIGPLAN Notices10.1145/3299710.321134353:6(104-108)Online publication date: 19-Jun-2018
    • (2018)JSCore: architectural support for accelerating JavaScript execution (short WIP paper)Proceedings of the 19th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems10.1145/3211332.3211343(104-108)Online publication date: 19-Jun-2018
    • (2018)Rethinking the memory hierarchy for modern languagesProceedings of the 51st Annual IEEE/ACM International Symposium on Microarchitecture10.1109/MICRO.2018.00025(203-216)Online publication date: 20-Oct-2018
    • (2017)SAVI objects: sharing and virtuality incorporatedProceedings of the ACM on Programming Languages10.1145/31338691:OOPSLA(1-24)Online publication date: 12-Oct-2017
    • (2017)Cross-layer workload characterization of meta-tracing JIT VMs2017 IEEE International Symposium on Workload Characterization (IISWC)10.1109/IISWC.2017.8167760(97-107)Online publication date: Oct-2017

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media