Salsa is a Java environment that includes a compiler from Java bytecode to C and a Java interpreter. While Salsa is aimed at applications that are statically configured, such as the Javac compiler, it is also designed to allow code to be dynamically loaded in an already compiled application. This novel feature is introduced by integrating our bytecode interpreter in the runtime library. Data structures between the Java compiled code and the interpreter are compatible and data allocated by the interpreter do not conflict with data allocated by the compiled code. Salsa is written in C and provides an efficient and flexible solution for the execution of Java applications.
Salsa's compiler generates C code that can be compiled into an efficient native code. To do so, several transformations have been implemented. First, the stack is statically evaluated away. Second, virtual method calls are transformed, when possible, into static (i.e., procedure) calls using a Class Hierarchy Analysis (CHA). For these virtual calls, type checks are also eliminated. Finally, Salsa implements several other more conventional optimizations for object-oriented languages such as method inlining.
Salsa refers to the Dance name, not to a beverage or an
island
. Salsa has been designed
with the goal of being also a front-end for our C-specializer. We soon
shall dance the Salsa in Tempo.
Salsa runs under Solaris 5.5, Sun/OS 4.1.4, Linux 2.0.
Salsa's
virtual machine is 64 bit compatible. A port has already been done for
Alpha/OSF1. Support for this port will be provided in the future
depending on the interest it raises.
Salsa is
provided in two different configurations with and without Garbage
Collection. The GC version is based on the Boehm-Demers-Weiser
conservative garbage collector.
Salsa
allows the mixing of compiled binary code and interpreted Java
bytecode. Test programs demonstrating Salsa features can be found in the
Salsa demo suite.
Whole-program optimizations such as the CHA require the compilation
of all classes referenced by a Java program. Therefore, many classes
of the Sun Java library are translated for each use of the Salsa
compiler, since the code generated differs from one program to
another. Drawbacks are that it consumes disk space and the compilation
process is a little bit slow for large programs such as the
javac compiler (10mn on a PC/Pentium 90Mhz).
C
generated code compiles only with Gcc (version 2.7.2 tested
successfully). This is only a minor limitation, since gcc is available on
many platforms and the binary code it produces is efficient.
Some minor
functions of the Java virtual machine are still missing. However, the
implementation is sufficiently mature to support complex programs such
as the javac compiler.
Our implementations lack thread support. This will be provided soon in the
next version for Linux and Solaris (hopefully in January).
Salsa is covered by a copyright statement that allows non-commercial use without fee. The Boehm-Demers-Weiser conservative garbage collector is covered by its own copyright.
Salsa is distributed in binary form:
SunOs 4.1.4 version gzipped tar file (GC and non GC versions)
Linux 2.0 version gzipped tar file (non GC version only)
Solaris 5.5 version gzipped tar file (available by the end of the week)
You will also need Sun java classes (classes.zip) from version 1.0.2 of the Java Developers Kit. Get the Solaris version from java.sun.com or the Linux version from www.blackdown.org.