Efficient Java Bytecode Analysis and Sequence Identification for Embedded Systems
DOI:
https://doi.org/10.21015/vtcs.v13i2.2227Abstract
Conventional tools and techniques of bytecode profiling require a lot of resources to generate bytecode sequences. Embedded devices have limited resources, and using conventional profilers to analyze bytecode execution traces and generate basic blocks is time-consuming. However, it often negates the benefits of creating Super instructions in some scenarios. Furthermore, these techniques provide complete basic blocks to be used as Super instructions. This paper proposes a simple and high-performance technique based on partial control flow analysis to identify basic blocks by locating control transfer instructions and their targets. Subsequently, the proposed approach extracts repeating patterns within the basic blocks to determine the most frequently repeated sequences to maximize the benefit from the super instructions. The SPECjvm 2008 benchmark suite and a custom bubble sort example were used in this study for the prototype implementation of the proposed framework. The prototype implementation of the technique identified the sequences of length 2 to 50 from the basic blocks, and then their frequency, ranging from 2 to 50, was extracted. It was observed that most basic blocks consist of 2 to 10 instructions in the actual code. The repeating sequences within basic blocks give better results compared to full basic blocks used as a super instruction. This approach enhances the execution performance and reduces the storage requirements of Java bytecode in embedded devices.
References
D. Yu, J. Yang, X. Chen, and J. J. I. A. Chen, “Detecting Java code clones based on bytecode sequence alignment,” IEEE Access, vol. 7, pp. 22421–22433, 2019.
F. H. Quradaa, S. Shahzad, R. Saeed, and M. M. Sufyan, “A novel code representation for detecting Java code clones using high-level and abstract compiled code representations,” PLOS ONE, vol. 19, no. 5, e0302333, 2024.
T. Lindholm, F. Yellin, G. Bracha, and A. Buckley, The Java Virtual Machine Specification. Boston, MA, USA: Pearson Education, 2014.
A. Iqbal and M. A. Khan, “Optimizing storage space on embedded systems using superinstructions,” Statistics, Computing and Interdisciplinary Research, vol. 6, no. 2, pp. 219–236, 2024.
D. Yu et al., “Detecting Java code clones with multi-granularities based on bytecode,” in Proc. IEEE 41st Annu. Comput. Softw. Appl. Conf. (COMPSAC), vol. 1, 2017, pp. 317–326.
A. Cuomo, A. Santone, and U. Villano, “CD-Form: A clone detector based on formal methods,” Science of Computer Programming, vol. 95, pp. 390–405, 2014.
O. Santana, Mastering the Java Virtual Machine: An In-depth Guide to JVM Internals and Performance Optimization. Birmingham, U.K.: Packt Publishing, 2024.
R. Brenguier, L. Cordeiro, D. Kroening, and P. Schrammel, “JBMC: A bounded model checking tool for Java bytecode,” arXiv preprint arXiv:2302.02381, 2023.
Y. Patel, N. Chovatia, and H. Kaur, “Securing payment transactions: A comprehensive review of smart cards and contactless payments with cryptographic methods,” in Proc. 11th Int. Conf. Comput. Sustain. Global Develop. (INDIACom), 2024, pp. 785–790.
J. S. Yalli, M. H. Hasan, and A. A. Badawi, “Internet of Things (IoT): Origins, embedded technologies, smart applications, and its growth in the last decade,” IEEE Access, vol. 12, pp. 91357–91382, 2024.
T. Geçer and V. Akgiray, “Payment card systems,” in The Financial Technology Revolution: Theory, Innovation, and Revenue Streams. Cham, Switzerland: Springer Nature, 2025, pp. 63–89.
K. Markantonakis et al., “CO-TSM: A flexible model for secure embedded device ownership and management,” Smart Cities, vol. 7, no. 5, pp. 2887–2909, 2024.
M. Zilli et al., “A light-weight compression method for Java Card technology,” ACM SIGBED Review, vol. 11, no. 4, pp. 13–18, 2015.
M. Zilli et al., “Instruction folding compression for Java Card runtime environment,” in Proc. 17th Euromicro Conf. Digital Syst. Design, 2014, pp. 228–235.
C. Li, Y. Jiang, C. Xu, and Z. Su, “Validating JIT compilers via compilation space exploration,” ACM Trans. Comput. Syst., vol. 43, no. 3, pp. 1–37, 2025.
C. Pichler et al., “Hybrid execution: Combining ahead-of-time and just-in-time compilation,” in Proc. 15th ACM SIGPLAN Int. Workshop VMIL, 2023, pp. 39–49.
K. Williams et al., “Optimization strategies for a Java virtual machine interpreter on the Cell Broadband Engine,” in Proc. 5th Conf. Comput. Frontiers, 2008, pp. 189–198.
B. L. Titzer, “Whose baseline compiler is it anyway?” in Proc. IEEE/ACM Int. Symp. Code Generation Optim. (CGO), 2024, pp. 207–220.
O. Larose, M. Vollmer, and S. Marr, “AST, bytecode, and the space in between: An exploration of interpreter design tradeoffs,” in ICOOOLPS 2025, Bergen, Norway, 2025.
O. Larose et al., “AST vs. bytecode: Interpreters in the age of meta-compilation,” Proc. ACM Program. Lang., vol. 7, no. OOPSLA2, pp. 318–346, 2023.
N. Dashdamirli, “Cross-platform development for microcontrollers: Design of a virtual machine based portable programming language,” Transport Systems and Technologies, vol. 45, no. 1, pp. 8–21, 2025.
K. Casey, M. A. Ertl, and D. Gregg, “Optimizing indirect branch prediction accuracy in virtual machine interpreters,” ACM SIGPLAN Notices, vol. 29, no. 6, pp. 37–45, 2007.
D. P. O’Donoghue and J. F. Power, “Identifying and evaluating a generic set of superinstructions for embedded Java programs,” presented at the Int. Conf. Embedded Syst. Appl., Las Vegas, USA, 2004.
L. R. Ton et al., “Instruction folding in Java processor,” in Proc. Int. Conf. Parallel Distrib. Syst., 1997, pp. 138–143.
B. Wan et al., “SJBCD: A Java code clone detection method based on bytecode using Siamese neural network,” Applied Sciences, vol. 13, no. 17, p. 9580, 2023.
A. Schäfer et al., “Finding source code clones in intermediate representations of Java bytecode,” in Proc. IEEE 17th Int. Workshop Softw. Clones (IWSC), 2023, pp. 37–43.
T. S. Heinze et al., “StoneDetector: Conventional and versatile code clone detection for Java,” arXiv preprint arXiv:2508.03435, 2025.
F. H. Quradaa, S. Shahzad, and R. S. Almoqbily, “A systematic literature review on the applications of recurrent neural networks in code clone research,” PLOS ONE, vol. 19, no. 2, e0296858, 2024.
T. Nonaka and T. Ugawa, “Design and implementation of superinstructions for JavaScript virtual machine generation system for embedded systems eJSTK,” Journal of Information Processing, vol. 27, pp. 658–670, 2019.
S. Zakirov et al., “How to select superinstructions for Ruby,” IPSJ Online Transactions, vol. 3, pp. 54–61, 2010.
G. Suzuki et al., “mruby on resource-constrained low-power coprocessors of embedded devices,” in Proc. ACM SIGPLAN MPLR, 2024, pp. 41–47.
H. Silangern and K. Tanaka, “Internet of Things implemented with mruby,” in Proc. Int. Conf. Comput. Sci. Appl., 2024, pp. 165–181.
C. Badea et al., “A simplified Java compilation system for resource-constrained embedded processors,” Univ. California, Irvine, Tech. Rep. CECS-07-03, 2007.
B. Stephenson and W. Holst, “Advancements in multicode optimization,” in Companion 19th ACM SIGPLAN Conf. OOPSLA, 2004, pp. 186–187.
B. Stephenson and W. Holst, “Multicodes: Optimizing virtual machines using bytecode sequences,” in Companion 18th ACM SIGPLAN Conf. OOPSLA, 2003, pp. 328–329.
D. Gregg et al., “Implementing an efficient Java interpreter,” in Proc. Int. Conf. High-Performance Comput. Netw., 2001, pp. 613–620.
M. A. Ertl et al., “vmgen—A generator of efficient virtual machine interpreters,” Softw.: Pract. Exper., vol. 32, no. 3, pp. 265–294, 2002.
M. A. Ertl and B. Paysan, “The performance effects of virtual-machine instruction pointer updates,” in Proc. ECOOP 2024, pp. 14:1–14:21.
F. Nabiyev, “Translating C into Java bytecode,” Ph.D. dissertation, Vilniaus Universitetas, 2025.
Downloads
Published
How to Cite
Issue
Section
License
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (CC-By) that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).
This work is licensed under a Creative Commons Attribution License CC BY