unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: wip-rtl native closure creation
Date: Mon, 6 Aug 2012 19:46:34 +0200	[thread overview]
Message-ID: <CAGua6m1-YOQV1iy0trzyMo2bzTouwox+JMqwg9LCmqCqMvvrmA@mail.gmail.com> (raw)
In-Reply-To: <87ehnkqsbz.fsf@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

Hi,

When code is both VM and native it's nice to be able to have both code
blocks as a unit because then
we can freely compile a function without needing to do graph analysis. It
simply makes the life easier to maintain the two setups. And incrementally
compile to native on a per uses base and not in one go very much like JIT
ing. Also the overhead on the VM side is low but the native execution will
of cause be a
little bit slower because of an extra indirection. I don't expect the
slowdown to be too bad though. Perhaps we could mark the beginning of a
code block in a program as

0     -> the rest of the vector is VM code
1     -> the rest of the vector is Native code
addr -> there is native code at the addr indirection

Then we can skip the expensive extra inderection for native code when
suitable.
To note here I assume that picking a[0],a[1] is less expensive then
a[0],*a[0].

At some stage we may leave the VM and perhaps enter into a Native only
mode. Then we can restructure.

/Stefan

On Mon, Aug 6, 2012 at 11:32 AM, Andy Wingo <wingo@pobox.com> wrote:

> On Sun 05 Aug 2012 17:19, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > Probably it is best to have the first qword / dword in the code to be
> > 0 or the native adress e.g. I propose to add that feature to the
> > rtl-branch.
>
> Good question!  Given the different tradeoffs, that seems workable.
> Another possibility would be to use a different TC7 for native
> procedures.  After all, the only calls we need to make cheaply are
> native->native and bytecode->bytecode, and the rest can go through a
> general dispatch loop (possibly with inline caching).  WDYT?  (Also note
> that RTL words are 32 bits wide, which may or may not be sufficient for
> native code pointers.)
>
> Andy
> --
> http://wingolog.org/
>

[-- Attachment #2: Type: text/html, Size: 2381 bytes --]

      parent reply	other threads:[~2012-08-06 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 15:19 wip-rtl native closure creation Stefan Israelsson Tampe
2012-08-06  9:32 ` Andy Wingo
2012-08-06  9:39   ` Sjoerd van Leent Privé
2012-08-06 11:44     ` Noah Lavine
2012-08-06 13:01       ` Andy Wingo
2012-08-06 13:00     ` Andy Wingo
2012-08-06 17:46   ` Stefan Israelsson Tampe [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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=CAGua6m1-YOQV1iy0trzyMo2bzTouwox+JMqwg9LCmqCqMvvrmA@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.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 read-only IMAP folder(s) and NNTP newsgroup(s).