direct threaded interpreter

Tom Tromey tromey@redhat.com
Thu May 9 18:07:00 GMT 2002


I'd like to check in my direct threaded interpreter patch sometime
soon.
Overall I think this patch has a positive effect. It speeds up the
interpreter quite a bit, at least in most cases. In my measurements
(this is based on my notes, since I did this a while ago), one of the
benchmarks slowed down slightly. On the other hand, some benchmarks
sped up hugely; calling a virtual function in a loop sped up 25%.
One drawback of the patch is that the "compiled" form of the bytecode
requires more memory at runtime. For a given method, the new form
uses about 4 bytes (8 bytes on 64-bit architectures) per original byte
of bytecode.
So, this may not be the best fit for all environments. How big a
problem would this be for people? I could probably modify the patch
to make direct threading a configure-time option. (I'm guessing that
making it a runtime option may defeat the purpose of making it
faster.)
This patch also cleans up some old ugliness by removing the
_Jv_InterpMethodInvocation structure. That code predate the ability to
catch a java exception from C++.
Anyway, before I go ahead and do this I want to make sure it won't
cause undue problems. If nobody much cares about the memory use, then
I'll just check it in. We can always add the configure-time option
later on if it is needed.
Tom


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /