A Profiling-Based Approach to Type Specialization for Dynamically Typed Languages
Dynamic typing brings convenience to programming but also poses challenges for compilers to generate efficient code. We propose a profiling-based method that collects type information by warming up and running JavaScript programs. By monitoring the program execution and recording the type information of bytecode and variables, a rule-based type inference scheme and a supplementary solution supporting JavaScript source code are presented. With static program analysis and the JavaScript type system, constraints and inferences are applied to variable types to generate more accurate and reliable type information. This paper implements a type inference system that takes JavaScript source code as input and outputs type information files. Experiments on benchmarks such as SunSpider show that, compared with WebAssembly binaries compiled without type information, those with type information achieve an average performance improvement of 6.18% and a maximum performance improvement of 58.9% in execution efficiency.
Authors
- Xiaohua Shi (ORCID: https://orcid.org/0000-0002-4180-6954)
- Ziye Li
- Haonan Guo
- Hao Hao
Publication Details
- Journal
- International Journal of Software Engineering and Knowledge Engineering
- Published
- 2026-10-13
- DOI
- https://doi.org/10.1142/s0218194026420027
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00