To all Chives'ers and all Japhar'ers:

(To anyone in Japhar who doesn't know, we Chives people are another VM
project.  See http://sunsite.auc.dk/chives/ if you want to know any more.)

I propose that Chives and Japhar, as about the only two free VM projects 
that don't have JIT compilers (at least I think Japhar doesn't... am I 
right?), collaborate to develop an interface to a JIT compiler that can 
work with both.  What does everyone think?

== More details about proposed interface ==========================

I'm currently thinking about an interface that is based on explicit
linkage (eg, dlopen/dlsym), which uses the same sort of interface as JNI:
the tables of pointers, maybe even supporting COM on Win32 like JNI, etc.
Interfaces would be provided to the compiler allowing it to access info
like constant pool entries and bytecode to methods, and also to
communicate its results back to the VM.

There are several other specific requirements that are important to us in
the Chives project:

- Lots of control over the semantics of the generated code.  We need to
control things like calling conventions and interface access methods... I
suspect you want the same type of control over your own code semantics.
So instead of requiring that the VM work with a set type of code generated
by the JIT compiler, we would provide a way for the compiler and VM to
negotiate a set of code semantics.  There are two options here:

  1. Design a really complicated way for all relevant semantic info to be
     communicated to the compiler, so that the compiler can generate code
     according to those semantics.

  2. Provide a way to negotiate between enumerated code semantics, and
     require that the compiler contain specific support for different
     semantics of generated code.  This means that a compiler has to be
     aware of what VM it's generating code for, but it allows a lot
     simpler interface.  The specifics of each semantics would be
     documented for the compiler writer.

I rather favor the second.

- We also need extra info from the compiler in some situations.  So I'd
like to also allow the VM to negotiate with the compiler for what
information is available and is returned.  This would allow the compiler
to optionally do things like:

   * Use profiling info if available.  The compiler would request it, and
     the VM would either provide some info or inform the compiler it's not
     available.

   * (Specifically for Chives) Generate information on dependencies of
     generated code, so that we can more precisely manage the JIT cache.
     Ie, the compiler tells the VM that it inlined a method from class B
     into method A.a(), so that if B changes, Chives will recompile A.a().

I look forward to your comments,

Chris Smith

Reply via email to