Each [[Thread (computer programming)|thread]] has its own program counter.
CodeThe verificationJVM isverifies appliedthe tocode of the bytecode class files at program load time. This means that only a limited amount of bytecode sequences form valid programs, e.g. a JUMP (branch) instruction can only target an instruction within the same function. Because of this, the fact that JVM is a stack architecture does not imply a speed penalty for emulation on register based architectures when using a JIT compiler: In face of the codeverified JVM architecture, it makes no difference to a JIT compiler whether it gets named imaginary registers or imaginary stack positions that need to be allocated to the target architectures registers. In fact, code verification makes the JVM different from a classic stack architecture whose efficient emulation with a JIT compiler is more complicated and typically carried out by a slower interpreter.
Code verification also ensures that arbitrary bitpatterns cannot get used as an address. [[Memory protection]] is achieved without the need for an [[Memory management unit|MMU]]. Thus, JVM is an efficient way of getting memory protection on simple silicon that has no MMU.