Techniques for increasing the performance of virtual machines are
disclosed. It can be determined whether a program instruction which is to
be executed by the virtual machine is a branch instruction, and whether a
basic block of code is present in a code cache. If so, the basic block of
code can be executed. The basic block includes code that can be executed
for the program instruction. A cache can be used to store the basic block
for program instructions that are executed by the virtual machine. The
program instruction may be a bytecode and the code cache can be
implemented as a native code cache.