caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Advices on JITting
@ 2018-04-26 12:22 pietro braione
  2018-04-26 17:11 ` Gerd Stolpmann
  0 siblings, 1 reply; 2+ messages in thread
From: pietro braione @ 2018-04-26 12:22 UTC (permalink / raw)
  To: caml-list

Dear all, 
I am building a toy implementation of a JIT compiler for the ocaml interpreter, but I am clueless about how to define the compilation units. The compiler is on the trivial-but-fast side (remember, it’s just a toy), so I would avoid the complexity of a tracing jit, at least by now. This means: statically divide the bytecode into chunks and profile/compile at the granularity of these chunks. The problem is, I have no idea what a decent criterion for chunking the bytecode could be. Does anyone have an idea at the regard?
Thank you
Pietro

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Advices on JITting
  2018-04-26 12:22 [Caml-list] Advices on JITting pietro braione
@ 2018-04-26 17:11 ` Gerd Stolpmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Stolpmann @ 2018-04-26 17:11 UTC (permalink / raw)
  To: pietro braione, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 1589 bytes --]

Dear Pietro,

as far as I remember the bytecode is on the outer level a sequence of
functions/definitions, and some of them can be recursive, as if the
whole program looked like a sequence

let rec f1 = ... and f2 = ... and f3 = ...

let rec g1 = ... and g2 = ... and g3 = ...

and so on. Closures are transformed into such functions, as well as
higher-level stuff like modules. You could take these let rec clusters
as your chunks.

For analyzing the structure of the bytecode, have also a look at the
js_of_ocaml sources, which is restoring the functional structure from
the bytecode.

Gerd


On 26.04.18 14:22, pietro braione wrote:
> Dear all, 
> I am building a toy implementation of a JIT compiler for the ocaml interpreter, but I am clueless about how to define the compilation units. The compiler is on the trivial-but-fast side (remember, it’s just a toy), so I would avoid the complexity of a tracing jit, at least by now. This means: statically divide the bytecode into chunks and profile/compile at the granularity of these chunks. The problem is, I have no idea what a decent criterion for chunking the bytecode could be. Does anyone have an idea at the regard?
> Thank you
> Pietro
>

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-26 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 12:22 [Caml-list] Advices on JITting pietro braione
2018-04-26 17:11 ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).