The core principle of Jikes RVM is the meta-circularity, or the property of being a self-hosting runtime. While this is an important principle for compilers, many runtime environments are not written in the language in which they typically run, which may have certain limitations. For instance, for a Java runtime written in C or C++, a bug in the memory safety may have serious consequences, even though the Java application itself does have memory safety. Having a self-hosting environment also allows the runtime to easily take advantages of better libraries and abstractions. Very often, the application and the runtime need to communicate with each other. Implementing this functionality is considerably more complex, when the runtime and the application running on it are written in different languages. Meta-circularity also helps the developers to gain from the features they introduce by relying on a system where application, runtime and compiler have a consistent view of the system.
Jikes RVM does not include an interpreter. All the bytecode must first be translated into native machine code. An initial, basic and non optimized compilation is performed by the baseline compiler, which relies on lazy compilation. With lazy compilation, methods are compiled first time when they are invoked by the program. In the later execution stages, the adaptive optimization system starts detecting program hot spots and selectively recompiles them with the Jikes RVM’s optimizing compiler. Selective optimization is the key to enabling the deployment of sophisticated optimizing compilers as dynamic compilers. Since Jikes RVM is written in Java, the implementation of the adaptive optimization system has inherent benefits such as threads and monitors to structure the code. Consequently, compiler tasks are being carried out by separated threaded components that run concurrently in the java thread safe environment. Also, the easy to understand Java collection libraries confer simplicity to each component, hiding away details of the underlying data structure management.
Another benefit of Jikes RVM that comes from using Java is the clean threading interface between the language and the operating system threads, which allows Jikes RVM to have different underlying threading models in order to adapt to new programmer behaviors. For garbage collection Jikes RVM relies on Memory Management Toolkit (MMTk), which provides a powerful and popular set of precise garbage collectors. As MMTK is also written in Java, it can be directly linked into the code being compiled for efficiency. Thus, during the initial creation of object representation, MMTk naturally comes into play providing Jikes RVM with iterators for process references, object allocation and barrier implementations. Obviously, with Java’s threading model, all garbage collectors are parallel and integrate with the runtime model.
Jikes RVM provides not only a very performant virtual machine but also a very promising research platform. The extensibility coming from its meta-circular nature provides a great platform for multilanguage virtual machine research, an extension that would also allow aspects of Jikes RVM to be written in different programming languages. Providing aspect oriented programming within the virtual machine, making the entire virtual machine into an OS to remove barriers to runtime optimization are only a few other interesting extension that can be built into Jikes RVM.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment