Version franaise
Home About Download Resources Contact us
Browse thread
JIT compilation of OCaml's bytecode
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mikkel_Fahnøe_Jørgensen <mikkel@d...>
Subject: Re: [Caml-list] JIT compilation of OCaml's bytecode
2009/1/25 Jon Harrop <jon@ffconsultancy.com>:
>
> AFAIK, OCaml's bytecode is typeless. How hard would it be to infer types from
> the bytecode in order to create type-specific functions during JIT
> compilation?

I assume you have already studied the other ocamljit approach
http://cristal.inria.fr/~starynke/ocamljit.html

Regarding types in bytecode, I don't know, but perhaps it is
worthwhile looking at Javascript (and possibly Lua) jitters. Recent
advances in trace-trees does with dynamic type detection along
execution paths. I suspect the polymorphic typing of ocaml requires a
kind of typeless compilation otherwise it would not be possible to be
polymorphic. Tracetrees would then be able to runtime optimize
specific applications of this polymorphism and possibly do better than
a static compiler in this area. However, since OCaml is relying so
much on a predictable data structure layout I suspect it would be hard
work to seriously optimize. Javascript optimizers do tend to realize
that hash tables often behave as objects and can optimize this special
case though.

http://ejohn.org/blog/tracemonkey/
http://www.ics.uci.edu/%7Efranz/Site/pubs-pdf/ICS-TR-06-16.pdf

Mikkel