I have been reading every now and then on the virtual machines of programming languages like Java, Python and Lua. They all have a notion of bytecode, into which the source code is translated and that is excutable on a virtual machine (register or stack based).
Now on an x86 architecture, all code resides in RAM which is addressable using the CPU's address space. An instruction pointer register points to the position in memory that is currently executed. Jumps modify this instruction pointer register, but basically software in memory is linearized into one piece of RAM.
With Virtual Machines, I am not so certain. Before executing the virtual machine, is all bytecode copied/linked together into a contiguous array with all instructions? Or does the VM keep various modules in different bytecode pages that are swapped/exchanged as needed?