EN | RU | ES

JEVM Features Summary

JEVM Design Goals
  • Portability to different DSPs and different OSs
  • Efficient memory utilization suitable for embedded systems
  • Concurrent priority-driven architecture using native OS support
  • Concurrent runtime garbage collection (not Stop-The-World approach)
  • Bounded run-time stack used by the virtual machine
  • To be used with real-time embedded operating systems
JEVM Features
  • Clean-Room implementation (non based on any existing VM software)
  • Concurrent multithreaded design of the VM
  • One-to-one mapping of Java threads to native threads
  • Concurrent Non-conservative Garbage Collector
  • Full conformance to Java VM Specification
  • Full implementation of Java Native Interface (JNI)
  • Architecture, design and implementation oriented to embedded applications
  • Generic UNICODE support (important for international language processing)
  • The set of implemented clean-room Java class packages, targeting both Sun's J2ME configurations CLDC/CDC compliance, is:
    • java/lang
    • java/lang/ref
    • java/lang/reflect
    • java/math
    • java/io
    • java/util
    • java/util/zip
    • java/util/jar
    • java/net
  • The set of Java class packages, derived from GNU Classpath and Kaffe open-source projects is:
    • [ GNU Classpath http://www.classpath.org ]
    • java/math
    • java/security
    • java/security/cert
    • java/text
    • gnu/java/awt
    • gnu/java/lang
    • gnu/java/text
    • [ Kaffe project http://www.kaffe.org ]
    • java/applet
    • java/awt
    • java/awt/color
    • java/awt/datatransfer
    • java/awt/dnd
    • java/awt/dnd/peer
    • java/awt/event
    • java/awt/font
    • java/awt/geom
    • java/awt/im
    • java/awt/image
    • java/awt/image/renderable
    • java/awt/peer
    • java/awt/print
    • kaffe/applet
    • kaffe/awt
    • kaffe/io
    • kaffe/util
    • kaffe/util/log

JEVM Architecture

Architectural Foundations
  • JEVM has 32 bit architecture (Java VM is specified this way)
  • JEVM supports both 8-bit and 16-bit bytes
  • JEVM assumes an underlying multitasking OS with file loading capability
  • Clean-Room implementation (non based on any existing VM software)
Memory Management
JEVM Memory Allocator
  • Standard overhead of just 4 bytes per allocated block
  • Front-End (volatile blocks) and Back-End (persistent blocks) strategies
  • Supports pre-allocated memory partition or entirely OS-based allocation
  • Entirely concurrent with respect to memory allocation and release
  • Very fast and has nearly deterministic performance
Garbage-Collected Heap Allocator
  • Standard overhead of just 4 bytes per allocated block
  • Additional 4 bytes are used for class descriptor index and monitors inflation-deflation
  • Uses JEVM allocator to supply memory chunks
  • Entirely concurrent with respect to memory allocation
  • Only Garbage Collector frees and merges heap blocks
Garbage Collector
  • Uses traditional mark-and-sweep strategy
  • Non-conservative (with precise determination of heap objects)
  • Separate garbage collector thread performs collection
  • Scheduled periodically and on low heap situations
  • Interacts with Finalizer thread for objects needing finalization
  • Provides information about memory consumption
  • Root set: Reference Stacks, static members, global and finalized references
Reference Stack
  • A novel method for tracking references to objects for garbage collection
  • Java threads have Java Stack Frame and Reference Stack Frame per method
  • Reference Stack is an object allocated from the garbage-collected heap
  • JEVM stores in Reference Stack references that are active in Java Stack
  • Garbage collector scans Reference Stack frames as every other heap object
Virtual Machine
Class Manager
  • JEVM initialization and setup, JEVM data structures management
  • Loading, preprocessing and validation of classes and interfaces (class files)
  • Constant pool and class/interface management, hashing, interning, etc.
  • Dynamic native method modules loading and linking
  • Class unloading (including native methods)
  • Objects creation and initialization support (strings, arrays, etc.)
  • Class and method resolution (static, virtual, interface and overloaded methods)
  • Field resolution (static or based on class instance), casting support
  • Native method invocation and native exception handling
Byte Code Processor
  • This is the core of the JEVM and represents a bytecode interpreting execution loop
  • Every Java thread is implemented by a native thread executing bytecodes
  • Direct threading method for byte execution is under investigation (to avoid loop penalty)
  • Performs method invocation (argument passing and return values)
  • Performs object creation and construction (using garbage-collected allocator)
  • Performs synchronization at Java level using monitors
  • Performs Java level exception handling
Stack Frame Manager
  • Manages Java Stack Frames and Reference Stack Frames
  • Handles method entry and exit processing for Java and native methods
Object Finalizer
  • Implemented by a dedicated finalizer thread
  • Activated by garbage collector when an object needs finalization
  • Executes finalization method
  • Has global finalization buffer (part of the root set)
Supporting Modules
Portability Modules
  • Native methods caller (argument passing using native conventions)
  • Multithreading and thread synchronization, timing support
  • JEVM synchronization support (critical section, locks)
  • Monitor implementation, utility functions (I/O support) etc.
Native Interface Support
  • JNI interface functions exporting much of JEVM functionality
  • KNI (K-virtual machine Native Interface) support
  • Global reference registration and management (part of the root set)
  • Endian and data type conversions for native methods
Native Class Methods
  • Fundamental object methods
  • Thread methods (thread management, interruption, blocking)
  • System methods (time, info) and I/O methods (file and stream I/O)
  • Utility methods (conversions, math, etc) and string methods (NLS)
Java Debug Interface
  • Completely supported using sockets
  • Eclipse environment used for host debugging
JEVM Portability Issues
Target Dependency
  • Endian, data types (64, 32, 16 bit), Java types sizes
  • Native floating point data types and sizes
  • JEVM internally uses big endian, objects are aligned at 4 bytes
  • Inline coding (critical section, atomic operations)
OS Dependency
  • Needs thread management mechanisms and thread-specific data pointer
  • Needs critical section and synchronization mechanisms with timeout
  • Needs file I/O capabilities (POSIX-style) and C run-time library
  • Needs native modules loading and relocation
JEVM Project
Project Status
  • Development platform – Windows, Linux
  • JEVM Complies to CDC/CLDC/MIDP
  • JEVM supports all weak references flavours
  • GNU's Mauve Java class library test suite passed
  • JEVM supports MIDP code and GUI from Sun
  • java/net on DSP, running Treck TCP/IP stack
  • JTAG interface emulates sockets for TI DSKs
  • Java debugging supported using Eclipse via JTAG
  • Supports GNU Classpath library under Linux
  • Supports Kaffe AWT and NanoX under DSP/BIOS
  • Supports Kaffe AWT and NanoX under Linux
  • Runs NetClue Java browser under Linux
  • Runs SPEC-JVM and SPEC-JBB benchmarks
  • JEVM can run with 8MB, browser needs 50
DSP Platforms Supported
  • TMS320C6xxx under DSP/BIOS on DSK6xxx
  • TMS320C55xx under DSP/BIOS on DSK5510
  • TMS320C64xx under MediaLinux from Softier Inc
  • TMS320C6xxx under Talon OS on DSK6xxx
  • TMS320C55xx under Talon OS on DSK5510
JEVM Class Libraries
  • GUI-less environment using JEVM's own compact class library
  • GUI (AWT) support with JEVM class library and Kaffe AWT implementation
  • GUI (AWT) support when using the GNU Classpath library
JEVM Roadmap
  • Development of Just-In-Time (JIT) Compiler
  • Supporting domain-specific JSRs
Related Links