Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
JIT-compilation for OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-01-04 (13:32)
From: Fabrice Le Fessant <fabrice.le_fessant@i...>
Subject: Re: JIT-compilation for OCaml?

> Hacking ocamlrun to produce native code simply by expanding
> each opcode from the abstract machine seems fairly easy. Some
> optimizations are lost.

This has already been done by Piumarta & Riccardi (PLDI'98 ?) on the
ocaml system, version 2.04 I think.

> Another idea would be to make the compiler outputs the "lambda"
> intermediate code (shared between ocamlc and ocamlopt) and distribute
> it,

The lambda code is not exactly the same for both bytecode and native
code. This is however not a really big problem. It would probably be a
good solution, since using both dynamic linking and ocamlopt, we can
generate assembler files and then load them dynamically ...

> , maybe with some modification to prevent reverse engineering.

Don't understand what you want. Reverse engineering is always
possible ... 

> For instance, it is possible to watch conditionnal jumps and
> reorganize the code so that the most taken branches don't need any
> jump.

This has nothing to do with JIT. Using profiling information can also
be done for statically compiled programs, by recompiling them with
this information. (this is already done by many compilers).

- Fabrice