@article{oai:ipsj.ixsq.nii.ac.jp:00220342, author = {Yuta, Hirasawa and Hideya, Iwasaki and Tomoharu, Ugawa and Hiro, Onozawa and Yuta, Hirasawa and Hideya, Iwasaki and Tomoharu, Ugawa and Hiro, Onozawa}, issue = {10}, journal = {情報処理学会論文誌}, month = {Oct}, note = {Virtual machines (VMs) for dynamically managed languages such as JavaScript are generally implemented in C or C++. Implementation of VMs in such low-level languages offers the advantage of high flexibility, but it suffers from problems of descriptiveness and safety. These problems are due to the fact that even though a variety of VM operations are based on the VM's internal datatypes for first-class objects in the target language, the C code typically treats all VM internal datatypes as a single type in C. In addition, VMs implemented in C or C++ have a size problem which is a serious issue for VMs on embedded systems. The reason for this problem is the difficulty of eliminating unnecessary code fragments from the C code for a specific application. To solve these problems, we propose a domain-specific language for describing VM programs and a corresponding compiler to C programs, called VMDL and VMDLC, respectively. We also propose related utility tools. This framework enables generation of C source code for an eJSVM, a JavaScript VM for embedded systems. VMDL's concise syntax enables static VM datatype analysis for optimizations and error detection. We evaluated the framework and confirmed its effectiveness from both qualitative and quantitative viewpoints. ------------------------------ This is a preprint of an article intended for publication Journal of Information Processing(JIP). This preprint should not be cited. This article should be cited as: Journal of Information Processing Vol.30(2022) (online) DOI http://dx.doi.org/10.2197/ipsjjip.30.679 ------------------------------, Virtual machines (VMs) for dynamically managed languages such as JavaScript are generally implemented in C or C++. Implementation of VMs in such low-level languages offers the advantage of high flexibility, but it suffers from problems of descriptiveness and safety. These problems are due to the fact that even though a variety of VM operations are based on the VM's internal datatypes for first-class objects in the target language, the C code typically treats all VM internal datatypes as a single type in C. In addition, VMs implemented in C or C++ have a size problem which is a serious issue for VMs on embedded systems. The reason for this problem is the difficulty of eliminating unnecessary code fragments from the C code for a specific application. To solve these problems, we propose a domain-specific language for describing VM programs and a corresponding compiler to C programs, called VMDL and VMDLC, respectively. We also propose related utility tools. This framework enables generation of C source code for an eJSVM, a JavaScript VM for embedded systems. VMDL's concise syntax enables static VM datatype analysis for optimizations and error detection. We evaluated the framework and confirmed its effectiveness from both qualitative and quantitative viewpoints. ------------------------------ This is a preprint of an article intended for publication Journal of Information Processing(JIP). This preprint should not be cited. This article should be cited as: Journal of Information Processing Vol.30(2022) (online) DOI http://dx.doi.org/10.2197/ipsjjip.30.679 ------------------------------}, title = {Generating Virtual Machine Code of JavaScript Engine for Embedded Systems}, volume = {63}, year = {2022} }