[Top][All Lists]

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

Re: [Lightning] About using lightning on a dynamically typed language

From: Paolo Bonzini
Subject: Re: [Lightning] About using lightning on a dynamically typed language
Date: Mon, 17 May 2010 08:04:56 +0200

>  I developed most of the code in an Amd Sempron, and noticed that
> the equivalent -O0 C code, eg, the above example with s/auto/long long/
> and calling test() from main(), the vm would run 6-8 times slower,
> but on a generic Athlon 64 the -O0 code would run 20 times faster.

That's expected.  The longlongs are approximately twice slower for the
VM on a 32-bit processor; but for C code, the added register pressure
(and the lower amount of registers on 32-bit processors) makes them
even worse.  Your experiments show that the penalty for 32- vs. 64-bit
is 6-8 times worse performance, wow.

>  Sorry for showing my ignorance, but what would be the best way to
> see the generated jit as assembly output? I think I would need that
> to better map "in my little mind" what code is being generated...

You can use gdb and its disass command, or embed a small disassembler
in your program.  See the programs in the tests directory.

>                jit_ldxi_i(JIT_R1, JIT_V1, (int)&((thread_t*)0)->bp);

Use offsetof here.

I haven't tested the program, but a first hint is to run disass in gdb
to see whether there is an obvious problem in the code.  Another way
is to add an IP to your thread state and write there the IP before
compiling each opcode (only in debugging mode of course).  Then it's
clear from the disass output what IP you were executing at the time of
the crash.


reply via email to

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