next up previous
Next: Hello world Up: JiST- Java in Simulation Previous: Motivation

Architecture

The JiST system architecture, depicted in Figure 1, consists of four distinct components: a compiler, a bytecode rewriter, a simulation kernel and a virtual machine. One writes JiST simulation programs in plain, unmodified Java and compiles them to bytecode using a regular Java language compiler. These compiled classes are then modified, via a bytecode-level rewriter, to run over a simulation kernel and to support the simulation time semantics described shortly. The simulation program, the rewriter and the JiST kernel are all written in pure Java. Thus, this entire process occurs within a standard, unmodified Java virtual machine (JVM).

Figure 1: The JiST system architecture - simulations are compiled (1), then dynamically instrumented by the rewriter (2) and finally executed (3). The compiler and virtual machine are standard Java language components. Simulation time semantics are introduced by the rewriting classloader and supported at runtime by the Java-based simulation kernel.
\begin{figure}\resizebox{\columnwidth}{!}{\begin{picture}(0,0)%
\includegraphics{figs/arch}%
\par
\end{picture}\input{figs/arch.texi}}
\end{figure}

The benefits of this approach to simulator construction over traditional systems and languages approaches are numerous. Embedding the simulation semantics within the Java language allows us to reuse a large body of work, including the Java language itself, its standard libraries and existing compilers. JiST benefits from the automatic garbage collection, type-safety, reflection and many other properties of the Java language. This approach also lowers the learning curve for users and facilitates the reuse of code for building simulations. The use of a standard virtual machine provides an efficient, highly-optimized and portable execution platform and allows for important cross-layer optimization between the simulation kernel and running simulation. Furthermore, since the kernel and the simulation are both running within the same process space we reduce serialization and context switching overheads. In summary, a key benefit of the JiST approach is that it allows for the efficient execution of simulation programs within the context of a modern and popular language. JiST combines simulation semantics, found in custom simulation languages and simulation libraries, with modern language capabilities. This design results in a system that is convenient to use, robust and efficient.


next up previous
Next: Hello world Up: JiST- Java in Simulation Previous: Motivation
2006-01-18