skip to main content
10.1145/3358502.3361268acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

FlashFreeze: low-overhead JavaScript instrumentation for function serialization

Published: 20 October 2019 Publication History

Abstract

Object serialization is important to a variety of applications, including session migration and distributed computing. A general JavaScript object serializer must support function serialization as functions are first-class objects. However, JavaScript offers no built-in function serialization and limits custom serializers by exposing no meta operator to query a function’s captured variables. Code instrumentation can expose captured variables but state-of-the-art instrumentation techniques introduce high overheads, vary in supported syntax and/or use complex (de)serialization algorithms.
We introduce FlashFreeze, an instrumentation technique based on capture lists. FlashFreeze achieves a tiny run time overhead: an Octane score reduction of 3% compared to 76% for the state-of-the-art ThingsMigrate tool and 1% for the work-in-progress FSM tool. FlashFreeze supports all self-contained ECMAScript 5 programs except for specific uses of eval, with, and source code inspection. FlashFreeze’s construction gives rise to simple (de)serialization algorithms.

References

[1]
Norman Adams, David Kranz, Richard Kelsey, Jonathan Rees, Paul Hudak, and James Philbin. 1986. ORBIT: An Optimizing Compiler for Scheme. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction (SIGPLAN ’86). 219–233.
[2]
Apple Inc. 2019. WebKit: a fast, open source web browser engine. https://webkit.org/ Accessed on March 28, 2019.
[3]
Oren Ben-Kiki, Clark Evans, and Brian Ingerson. 2009. YAML Ain’t Markup Language (YAML™) version 1.2. https://yaml.org/spec/cvs/ spec.pdf Accessed on May 19, 2019.
[4]
John K. Bennett. 1987. The Design and Implementation of Distributed Smalltalk. In Conference Proceedings on Object-oriented Programming Systems, Languages and Applications (OOPSLA ’87). 318–330.
[5]
Gavin Bierman, Martín Abadi, and Mads Torgersen. 2014. Understanding TypeScript. In European Conference on Object-Oriented Programming. Springer, 257–281.
[6]
Akmal B Chaudhri. 2017. Apache Ignite Tip: Peer Class Loading Deployment Magic. https://www.gridgain.com/resources/blog/apacherignitetm-tip-peer-class-loading-deployment-magic Accessed on May 18, 2019.
[7]
Douglas Crockford. 2018. JSON in JavaScript. https://github.com/ douglascrockford/JSON-js Accessed on May 13, 2019.
[8]
Martín Dias, Mariano Martinez Peck, Stéphane Ducasse, and Gabriela Arévalo. 2014. Fuel: A fast general purpose object graph serializer. Software: Practice and Experience 44, 4 (2014), 433–453.
[9]
ECMA International. 2015. ECMAScript 2015 Language Specification. https://www.ecma-international.org/ecma-262/6.0/index.html Accessed on May 17, 2019.
[10]
Julien Gascon-Samson, Kumseok Jung, Shivanshu Goyal, Armin Rezaiean-Asel, and Karthik Pattabiraman. 2018. ThingsMigrate: Platform-independent migration of stateful JavaScript IoT applications. In 32nd European Conference on Object-Oriented Programming (ECOOP 2018). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
[11]
Liang Gong, Michael Pradel, Manu Sridharan, and Koushik Sen. 2015. DLint: dynamically checking bad coding practices in JavaScript. In Proceedings of the 2015 International Symposium on Software Testing and Analysis. ACM, 94–105.
[12]
Google Developers. 2017. Octane: the JavaScript benchmark suite for the modern web. https://developers.google.com/octane/ Accessed on March 28, 2019.
[13]
Google Developers. 2019. V8 JavaScript engine. https://v8.dev/ Accessed on March 28, 2019.
[14]
David Herman, Luke Wagner, and Alon Zakai. 2014. asm.js: Working Draft. http://asmjs.org/spec/latest/ Accessed on May 17, 2019.
[15]
ISO. 2017. ISO/IEC 14882:2017 Information technology — Programming languages — C++ (fifth ed.). International Organization for Standardization, Geneva, Switzerland. 1605 pages. https://www.iso.org/standard/ 68564.html
[16]
Eric Jonas, Qifan Pu, Shivaram Venkataraman, Ion Stoica, and Benjamin Recht. 2017. Occupy the cloud: Distributed computing for the 99%. In Proceedings of the 2017 Symposium on Cloud Computing. ACM, 445–451.
[17]
Kumseok Jung, Julien Gascon-Samson, Aarti Kashyap, Xuejie Tang, Karthik Pattabiraman, and marusshi. 2019. ThingsJS. https://github. com/DependableSystemsLab/ThingsJS Accessed on May 20, 2019.
[18]
Jae-Yun Kim, Hyeon-Jae Lee, and Soo-Mook Moon. 2018. Work-inProgress: Fast Snapshot Migration Using Static Code Instrumentation. In 2018 International Conference on Embedded Software (EMSOFT). IEEE, 1–2.
[19]
Jin-woo Kwon and Soo-Mook Moon. 2017. Web application migration with closure reconstruction. In Proceedings of the 26th International Conference on World Wide Web. International World Wide Web Conferences Steering Committee, 133–142.
[20]
James Teng Kin Lo, Eric Wohlstadter, and Ali Mesbah. 2013. Imagen: runtime migration of browser sessions for JavaScript web applications. In Proceedings of the 22nd international conference on World Wide Web. ACM, 815–826.
[21]
Mozilla and individual contributors. 2016. PDF.js: A general-purpose, web standards-based platform for parsing and rendering PDFs. https: //mozilla.github.io/pdf.js/ Accessed on May 17, 2019.
[22]
JinSeok Oh, Jin-woo Kwon, Hyukwoo Park, and Soo-Mook Moon. 2015. Migration of web applications with seamless execution. In ACM SIGPLAN Notices, Vol. 50. ACM, 173–185.
[23]
Narayan Prusty. 2015. Learning ECMAScript 6. Packt Publishing Ltd.
[24]
Axel Rauschmayer. 2011. JavaScript’s with statement and why it’s deprecated. https://2ality.com/2011/06/with-statement.html Accessed on August 30, 2019.
[25]
Zhong Shao and Andrew W. Appel. 2000. Efficient and Safe-for-space Closure Conversion. ACM Transactions on Programming Languages and Systems (TOPLAS) 22, 1 (Jan. 2000), 129–161.
[26]
Ubuntu Developers. 2019. Package nodejs 10.15.2. https://packages. ubuntu.com/disco/nodejs Accessed on August 31, 2019.
[27]
Wolfgang Van Raemdonck, Tom Van Cutsem, Kyumars Sheykh Esmaili, Mauricio Cortes, Philippe Dobbelaere, Lode Hoste, Eline Philips, Marc Roelands, and Lieven Trappeniers. 2017. Building connected car applications on top of the world-wide streams platform. In Proceedings of the 11th ACM international conference on distributed and event-based systems. ACM, 315–318.
[28]
Kris Zyp. 2017. How to write a TypeScript transform (plugin). https://dev.doctorevidence.com/how-to-write-a-typescripttransform-plugin-fc5308fdd943 Accessed on March 29, 2019.

Cited By

View all
  • (2022)Disclosure: Efficient Instrumentation-Based Web App Migration for Liquid ComputingWeb Engineering10.1007/978-3-031-09917-5_9(132-147)Online publication date: 1-Jul-2022

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
META 2019: Proceedings of the 4th ACM SIGPLAN International Workshop on Meta-Programming Techniques and Reflection
October 2019
39 pages
ISBN:9781450369855
DOI:10.1145/3358502
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 October 2019

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Closures
  2. Compilers
  3. Instrumentation
  4. JavaScript
  5. Serialization
  6. TypeScript

Qualifiers

  • Research-article

Conference

SPLASH '19
Sponsor:

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)12
  • Downloads (Last 6 weeks)0
Reflects downloads up to 19 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2022)Disclosure: Efficient Instrumentation-Based Web App Migration for Liquid ComputingWeb Engineering10.1007/978-3-031-09917-5_9(132-147)Online publication date: 1-Jul-2022

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media