25-05-2012, 04:42 PM
The Java Virtual Machine
jvm.pdf (Size: 58.68 KB / Downloads: 108)
JVM runtime behaviour
JVM architecture
.class le format
JVM instruction set
JVM Runtime Behaviour
VM startup
Class Loading/Linking/Initialisation
Instance Creation/Finalisation
Unloading Classes
VM exit
VM Startup and Exit
Startup
Load, link, initialise class containing main()
Invoke main() passing it the command-line arguments
Exit when:
{ all non-daemon threads end, or
{ some thread explicitly calls exit() method
Class Initialisation
Happens once just before rst instance creation, or rst use of static variable.
Initialise the superclass rst!
Execute (class) static initialiser code
Execute explicit initialisers for static variables
May not need to happen for use of nal static variable
Completed before anything else sees this class
Java Stack
JVM pushes and pops frames onto this stack
Each frame corresponds to the invocation of a method
Call a method ! push its frame onto the stack
Return from a method ! pop its frame
Frame holds parameter values, local variables, intermediate values etc.