Collecting Type Information Using Unit Tests for Customizing JavaScript Virtual Machines

Proceedings of the 14th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems(2019)

引用 0|浏览5
暂无评分
摘要
To use JavaScript for Internet of Things (IoT), it is essential to reduce the size of the virtual machine (VM). Although operators in JavaScript are polymorphic, many applications apply operators to only a limited set of datatypes. Thus, customizing a VM to include only implementations of operators of datatypes used can reduce the size of the VM. In this research, we determine the set of operand datatypes that are possibly given to each operator for individual applications. Because JavaScript is a dynamically typed programming language, it is difficult to infer types accurately. Instead, as a practical approach, we obtain type information from executions of unit tests of the application. We implemented a prototype system to record datatypes that are given to each operator in executions of unit tests for Jasmine. The system does not record operands of operators executed by the Jasmine's code but only those by the application's code. We applied this system to two small applications and found that it determined type information with high accuracy.
更多
查看译文
关键词
JavaScript, embedded systems, type, virtual machine
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要