caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <fabrice.le_fessant@inria.fr>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Chris Hecker <checker@d6.com>, caml-list@inria.fr
Subject: Re: [Caml-list] calling native code from bytecode?
Date: Tue, 14 Aug 2001 09:34:50 -0400 (EDT)	[thread overview]
Message-ID: <15225.10490.155943.191262@kerne.inria.fr> (raw)
In-Reply-To: <20010808104615.A3590@pauillac.inria.fr>


A few years ago :), I implemented the mixing of bytecode and native
code in JoCaml. The bytecode interpreter included in native code
runtimes was modified so that bytecode functions were wrapped inside
native code functions, using a special tag. This tag was checked
before executing a closure, to either call a wrapper for real native
code functions, or to find the bytecode pointer in the closure for
bytecode functions. In native code, calling directly the wrapped
function started a new interpreter to execute its bytecode. 

For exceptions, a flag is used to know whether the first exception
handler is executing native code or bytecode. Depending on this flag,
the exception is raised in bytecode or native style.

I did not measure the cost of this, but I noticed a slowdown. I don't
know if there is a better solution. One of my (unfortunately long list
of) projects is to improve asmdynlink to produce JIT native code for
bytecode ... maybe next year !

- Fabrice

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      parent reply	other threads:[~2001-08-14  7:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-01 23:45 Chris Hecker
2001-08-03 12:03 ` Xavier Leroy
2001-08-03 14:31   ` Chris Hecker
2001-08-08  8:46     ` Xavier Leroy
2001-08-08 18:34       ` Chris Hecker
2001-08-09  6:57       ` Florian Hars
2001-08-14 13:34       ` Fabrice Le Fessant [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=15225.10490.155943.191262@kerne.inria.fr \
    --to=fabrice.le_fessant@inria.fr \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    /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).