[Python-Dev] Optimization targets

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 16 02:00:12 EDT 2004


Jeremy Hylton wrote:
> I'm not sure what you mean by the changes over standard JIT.  Do you
> mean the difference between Hotspot and "standard JIT"?  Your
> descriptions sounds a bit like the Deutsch and Schiffman inline method
> cache, which doesn't inline the method body but does inline the method
> lookup.  Or does Hotspot actually inline methods?

I lost the link, but on some page describing it, they actually claimed
they do inline methods. They went on explaining that you need
"deoptimization" in case a different method should be called; I assume
they generate a type check just before the inlined method body. I might
be that they keep collecting statistics on how often the type guess
was wrong to discard the inlining, and come up with a new one.

Hotspot operates by only compiling functions selectively, which have
been invoked a number of times, and they claim they collect data on
where virtual calls go to. So when they eventually do generate machine
code, they have the data to do the inlining.

A "standard" JIT might chose to compile everything the first time it
is invoked, and would then just replace the virtual-call bytecode with
the necessary memory fetches and an indirect call.

Regards,
Martin




More information about the Python-Dev mailing list