The registers to which the dalvik bytecode refers are not machine registers at all, but they are actually points in the call stack. Whenever you call a method, dalvik allocates enough memory in the frame of the method stack to store all the registers that this method needs.
Please note that not all calculations will immediately change the value on the stack, vm, obviously, must load the values ββinto the machine register to perform calculations. The results can be stored in a machine register, which will be used later, without immediately writing it back to the appropriate location of the stack at the discretion of the virtual machine. Values ββwill be flushed back to the call stack if and when necessary (i.e. when you call another method, use different synchronization constructs or it needs a register for another calculation, etc.).
source share