Bytecode Testing Framework for SableVM Code-copying Engine

Code-copying is a very attractive, simple-JIT, highly portable fast byte code execution technique with implementation costs close to a classical interpreter. The idea is to reuse, at Virtual Machine (VM) runtime, chunks of VM binary code, copy them, concatenate an d execute together at a greater speed. Unfortunatelly code-copying makes anwarranted assumptio ns about the code generated by the compiler used to compile the VM. It is therefore necessary to find which VM code chunks can be safely used after being copied and which can not. Previously used manual testing and assembly analysis were highly ineffective and error prone. In this work we present a test su ite, Bytecode Testing Framework (BTF) that contains a comprehensive set of fine-grained Java assembly t ests. These tests are then used in conjunction with SableVM JVM testing mode to semi-automatically detect one-by-one which code chunks are safe to use. With this techunique we ported SableVM’s code-copyi ng engine to several architectures and had external contributors with no VM knowledge port SableVM to n ew architectures within as little as one hour. The presented Bytecode Testing Framework greatly imp roved reliability and ease of porting of SableVM’s code-copying engine, thus its practical usabili ty.