The specialization classes compiler
man page
Authors: Nic
Volanschi & Francois-Xavier
Josset
JSCC is a compiler for the Java language extended with specialization
classes. Our compiler produces a (standard) Java program, which manages
its own specialization by itself.
The compiler is written in Java, and is accesible by ftp (see instalation
instructions).
The input consists of a Java class X (placed in a file X.java)
and a set of corresponding specialization classes (all defined in a file
X.SC), which define adaptive/specialization behavior for class
X. The compiler is run as follows:
The compilation process happens in three phases:
- The first phase preprocesses class X in order to reduce it
to a Java sub-set, easier to treat by the second phase. More specifically,
contracted assignments (++, +=, ...) are rewritten to
their expanded forms. The result is placed in a file called ./results/rppro/X.java.
- The second phase creates a set of Java classes:
- one enclosing class wich has the same interface as class X,
but incorporates the adaptive/specialization behavior; this class doesn't
contain a real implementation for the adaptive/specializable methods -
it just forward the calls to the implementation objects
- several implementation classes, offering different implementations
for the adaptive/specializable methods; there is always a generic implementation
and one or more specialized implementations, one for each specialization
class attached to class X.
All these classes are placed in the results sub-directory.
The enclosing class is put in file results/X.java. The generic
implementation is put in ./results/XImpl.java. The specialized
implementation corresponding to a specialization class SpecX is
put in ./results/SpecXImpl.java.
- In the third phase, the Sun Java compiler (javac) is called
to compile all classes under ./results/ into bytecodes, placed
relative to the current directory.
Now, assuming that class X defines a main method, it can be ran as follows:
See also
Send any comments to: Philippe.Boinot@irisa.fr