[DGD] importance of bytecode compatibility

Felix A. Croes felix at dworkin.nl
Sun Aug 7 17:54:19 CEST 2011


Carter Cheng <cartercheng at gmail.com> wrote:

> I am curious how important bytecode compatibility is with older
> versions- since a very direct way of implementing a JIT on LLVM would
> be to modify codegeni.c to generate llvm bitcode and store this
> information instead of the bytecode in the control block data. Would
> this be acceptable since the new vm breaks the compat anyhow?

It is not older, but newer versions that you should be concerned about.

When you provide JIT v1, people will use it.  If you make improvements
and create JIT v1.1 that is incompatible with v1, people will use it
only if there is an upgrade path from v1 -- maybe.

What I've seen with the existing precompiler (from LPC to C) is that
people who want persistence will start off using the precompiler,
but eventually abandon it because it is too much of a hassle in
combination with snapshots and live upgrading.

If your JIT code is stored in snapshots, then you either have to
guarantee forward compatibility or abandon a part of your userbase
with each incompatible change.  Guaranteed compatibility leads to
the sort of thing you can now see in dgd/src/interpret.c: two
different interpreter loops, one for old bytecode, and one for
the new bytecode.

If JIT code is not stored in snapshots but is compiled from DGD
bytecode rather than LPC source code, forward compatibility is
automatic.

How important this is, you'll have to decide for yourself.  My
personal preference is to compile from bytecode rather than
source code, and to keep JIT code out of the snapshots.

Regards,
Felix Croes



More information about the DGD mailing list