2015-02-23 14:05 GMT+01:00 Thierry Goubier <thierry.goub...@gmail.com>:

> Hi All,
>

Hello,

>
> anybody knows how to check if a method is jitted or not?
>

I don't think there's a way to do that.

>
> I remember (maybe wrongly) that the Jit in Cog has a configurable limit on
> the number of bytecodes for a method to be jitted or not; I'm looking into
> the performance of generated code where I can, more or less, control the
> length of methods (SmaCC) and I'd like to find the optimum point.
>
> Any method is jitted if when activated it's already in the global lookup
cache and it's not already jitted (so mostly on second calls).

The only limit is on the number of literals. A method with more than a
certain number of literals (by default, 64) is not jitted. You can change
this limit by starting the VM with a specific command line argument (I
don't remember, something like --maxNumLiterals, you will find it when
pressing --help I don't have access to a VM right now). Basically the limit
is to 64 because the GC consume a lot of time in the machine code zone.
Each literals require specific care because their addresses are directly in
the generated code (Has the literal moved in memory, ...).

There's a few other things, such as a method with unknown bytecodes will
not be jitted (so you can rely for example on the respondsToUnknownBytecode
hook with interpreted methods), but I don't think it matters for you.

> Thanks,
>
> Thierry
>

Reply via email to