Virtual Machine, Execution Engine and Interpreter
This is the JVM itself. It holds the pointers to all the other entities and serves
as the mediator between all of them.
Virtual Machine performs the start-up operation and the main execution loop.
VM holds a set of all class loaders - bootstrap and user-defined.
Execution engine itself is nothing more than an endless loop that consults the
ExecutionPool on each step about the next thread that is suitable to run.
Then, the thread's "step" function is called, which consists of three simple steps:
1. fetch the next opcode;
2. jump to the instruction body that will interpret and execute this command;
3. check the results and continue;
The Interpreter is the set of functions that implement all instructions specified in the JVM specification. Each such function receives a pointer to the thread executing it as the only parameter. From this thread pointer, the function has access to the thread's stack, current stack frame, current method code, current class, current constant pool and the VM itself.
Includes
| defs.h | All definitions used throughout the JVM implementation |
| VirtualMachine.h | VirtualMachine and ExecutionPool classes definition |
| opcodes.h | Macro definition of all the JVM opcodes and declaration of the Opcode structure. |
Sources
| VirtualMachine.cpp | VirtualMachine and ExecutionPool classes implementation |
| main.cpp | "main" function that starts the JVM |
| opcodes.cpp | Implementation of the JVM instruction set (big file!) |
@