title: Why is the JVM stack-based and the Dalvik VM register-based?
body: <p>I'm curious, why did Sun decide to make the JVM stack-based and Google decide to make the DalvikVM register-based?</p>
  
  <p>I suppose the JVM can't really assume that a certain number of registers are available on the target platform, since it is supposed to be platform independent. Therefor it just postpones the register-allocation etc, to the JIT compiler. (Correct me if I'm wrong.)</p>
  
  <p>So the Android guys thought, "hey, that's inefficient, let's go for a register based vm right away..."? But wait, there are multiple different android devices, what number of registers did the Dalvik target? Are the Dalvik opcodes hardcoded for a certain number of registers?</p>
  
  <p>Do all current Android devices on the market have about the same number of registers? Or, is there a register re-allocation performed during dex-loading? How does all this fit together?</p>