eJSTK: Building JavaScript virtual machines with customized datatypes for embedded systems

Abstract Using JavaScript as a description language can increase the productivity of application programs on embedded systems. Since JavaScript is a dynamic language, it is important for a JavaScript virtual machine (VM) to efficiently identify the types of first-class values and perform type-based dispatches. For embedded systems, the type-based dispatching code is desired to be compact as well as fast. Although operators of JavaScript are heavily overloaded and capable of accepting a variety of datatypes as operands, all the datatypes are not always necessarily used in a specific program. If some datatypes are never used in this program, a VM for a subset of JavaScript with operators that support limited datatypes suffices. Such a VM is expected to be compact and efficient. In addition, internal representation of datatype of each value may affect performance of type-based dispatching. This paper presents a novel framework that can generate a VM for a subset of JavaScript on the basis of operand specifications and datatype specifications given by the programmer. The operand specifications describe possible operand datatypes for every instruction and the datatype specifications describe adequate internal representations of necessary datatypes for a target program. The generated VM is specialized in the sense that it has efficient and minimum type-based dispatching code for all instructions.

[1]  Scott A. Mahlke,et al.  EFetch: Optimizing instruction fetch for event-driven web applications , 2014, 2014 23rd International Conference on Parallel Architecture and Compilation (PACT).

[2]  David Gregg,et al.  Implementing an Efficient Java Interpreter , 2001, HPCN Europe.

[3]  David Gregg,et al.  Vmgen—a generator of efficient virtual machine interpreters , 2002, Softw. Pract. Exp..

[4]  Julia L. Lawall,et al.  Static and Dynamic Program Compilation by Interpreter Specialization , 2000, High. Order Symb. Comput..

[5]  David Gregg,et al.  A Language and Tool for Generating Efficient Virtual Machine Interpreters , 2003, Domain-Specific Program Generation.

[6]  Craig Chambers,et al.  An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes , 1991 .

[7]  Philip Koopman,et al.  Better Embedded System Software , 2010 .

[8]  James R. Bell,et al.  Threaded code , 1973, CACM.

[9]  Eric Simon,et al.  Fast algorithms for compressed multimethod dispatch table generation , 1998, TOPL.

[10]  Christian Wimmer,et al.  Self-optimizing AST interpreters , 2012, DLS.

[11]  Stefan Brunthaler,et al.  Efficient interpretation using quickening , 2010, DLS '10.

[12]  Ben Klemens 21st Century C: C Tips from the New School , 2012 .

[13]  Clark Verbrugge,et al.  Analyzing the performance of code-copying virtual machines , 2008, OOPSLA '08.

[14]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[15]  Neil D. Jones,et al.  Transformation by interpreter specialisation , 2004, Sci. Comput. Program..

[16]  David Gregg,et al.  An optimized Java interpreter for connected devices and embedded systems , 2003, SAC '03.

[17]  John Aycock,et al.  A brief history of just-in-time , 2003, CSUR.

[18]  Christian Wimmer,et al.  A domain-specific language for building self-optimizing AST interpreters , 2015 .

[19]  Vijay Janapa Reddi,et al.  Microarchitectural implications of event-driven server-side web applications , 2015, 2015 48th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO).

[20]  Stefan Brunthaler,et al.  Inline Caching Meets Quickening , 2010, ECOOP.

[21]  Hyeon-Gyu Cho,et al.  Typed Architectures: Architectural Support for Lightweight Scripting , 2017, ASPLOS.

[22]  Takuya Azumi,et al.  mruby on TECS: Component-Based Framework for Running Script Program , 2015, 2015 IEEE 18th International Symposium on Real-Time Distributed Computing.

[23]  Todd A. Proebsting Optimizing an ANSI C interpreter with superoperators , 1995, POPL '95.

[24]  Kazuaki Tanaka,et al.  mruby -- Rapid Software Development for Embedded Systems , 2015, 2015 15th International Conference on Computational Science and Its Applications.