caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: pietro braione <pietro.braione@unimib.it>, caml-list@inria.fr
Subject: Re: [Caml-list] Advices on JITting
Date: Thu, 26 Apr 2018 19:11:18 +0200	[thread overview]
Message-ID: <fb691cb1-61db-6c60-d9cf-94eec13d8fbc@gerd-stolpmann.de> (raw)
In-Reply-To: <25566A29-68D9-4A7D-B855-D33A54024DD4@unimib.it>


[-- 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 --]

      reply	other threads:[~2018-04-26 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 12:22 pietro braione
2018-04-26 17:11 ` Gerd Stolpmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb691cb1-61db-6c60-d9cf-94eec13d8fbc@gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=pietro.braione@unimib.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).