qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/8] tcg/interpreter: Add TCG + interpreter for


From: David Gilbert
Subject: Re: [Qemu-devel] [PATCH 0/8] tcg/interpreter: Add TCG + interpreter for bytecode (virtual machine)
Date: Mon, 19 Sep 2011 11:27:19 +0100

On 19 September 2011 11:20, Stefan Hajnoczi <address@hidden> wrote:
> On Mon, Sep 19, 2011 at 9:40 AM, David Gilbert <address@hidden> wrote:

<snip>

>> Is it possible to dynamically switch between the two?
>>
>> The two cases I'm thinking of are:
>>  1) Using the interpreter to execute one or two instructions in an exception
>> handling case
>>  2) Avoiding TCG code generation on the first few runs of a piece of
>> code that might only be init code, and only bothering with TCG for hotter
>> code.
>
> The tricky thing with using the interpeter for lesser run code is that
> it has a bunch of machinery in front of it which probably makes it
> relatively similar to actually emitting native code.  The interesting
> benchmark would be to translate blocks but never cache them for future
> executions - compare this with TCI to see how much difference there is
> between executing with interpretation vs translation.  If the
> interpreter is almost as expensive as the translator then it's not
> worth it.

Right; the trick is if you have a passably fast interpreter you can afford
to do some more expensive optimisations in the code generator which would
be interesting.  It's not unusual to find an awful lot of executed once-or-twice
code.

Dave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]