Run-time specialization (RTS) is a technique that efficiently generates specialized programs with respect
to run-time values. For efficiently generating specialized programs, RTS constructs compiled native code fragments
called templates at compile-time, and generates a specialized program by merely copying the templates. The
generated programs are, on the other hand, less efficient, since the technique prevents many optimizations.
We propose bytecode specialization (BCS), which generates programs in a bytecode language, and then
translates the generated bytecode into native code by using Just-In-Time (JIT) compilers. The advantages of BCS
are: (1) efficient specialization processes that are similar to RTS, (2) efficient specialized programs thanks
to the optimizations of JIT compilers, and (3) independence of source-to-bytecode compilers and of bytecode-to-native
compilers thanks to our proposed binding-time analysis, which directly handles bytecode programs.
Thus far, we have implemented a BCS system for a Java Virtual Machine subset. Our micro-benchmark shows that BCS
with JIT compiler generates a specialized program that runs more than 3-fold faster than the one specialized by
traditional RTS techniques, and that our specialization process takes only 610 microseconds.