java virtual machine
TRANSCRIPT
JAVA VIRTUAL MACHINEDhanith Krishna
Virtual Machines
A virtual machine (VM) is a software-based emulation of a computer.
JVM executes Java byte code
Byte code is one byte op-codes followed by optional parameters
JVM platform is used by Python, Ruby etc
code execution component of the Java platform
JVM Architecture
•Better Security
•Portability
•Compile Once Run Anywhere
NEED FOR JVM
IS JVM for JAVA alone ?
• Compilers for other languages based on JVM exists
• Assemblers on JVM
•Erjang
•Rhino
•Free Pascal
•Quercus
•Jython
•NetRexx
•Jruby
•Jacl
• Loads class to memory
• Verification
• Allocation of static fields
• Linking
• Invocation of initialization codes
• Starting Main as a single thread
• Additional Threads are created using Thread class
How class file works in JVM ?
JVM Architecture
Storage Management
Storage Management
Global Data – Global constant poolContains program constants and symbol table information
Per Thread Data – registers + stack + native stack
Heap – Dynamically allocated memory
Class File Format
JVM Instruction Set
•Load and store
•Arithmetic
•Type conversion
•Object creation and manipulation
•Operand stack management (push / pop)
•Control transfer (branching)
•Method invocation and return
•Throwing exceptions
•Monitor-based concurrency