I know that a lot of interpreted higher level languages like to abstract a lot of things and therefore cannot directly be compared with lower level constructs.
For example in some languages primitive values are implemented as references to value-objects. Most famously in Python.
When I learned programming, I was taught that primitives are simple values with a certain predefined size that get stored directly at an allocated memory address. I guess this is pretty much what happens in C/C++.
int a = 4; // put 4 directly at a memory location on the stack
Reading the specification of the JVM, it seems like they demand the same behavior.
A single local variable can hold a value of type boolean, byte, char, short, int, float, reference, or returnAddress. A pair of local variables can hold a value of type long or double.
Local variables are addressed by indexing. The index of the first local variable is zero. An integer is considered to be an index into the local variable array if and only if that integer is between zero and one less than the size of the local variable array.
A value of type long or type double occupies two consecutive local variables. Such a value may only be addressed using the lesser index. For example, a value of type double stored in the local variable array at index n actually occupies the local variables with indices n and n+1; however, the local variable at index n+1 cannot be loaded from. It can be stored into. However, doing so invalidates the contents of local variable n.
So this sounds very specific with little room to implement another way (for example as references to Java Value-Objects). Is this correct, or is this still up to the acutal implementation?