about non-compatible optimization (was: Re: patch to bring java vtables closer to g++ abi conformance)

shudo@computer.org shudo@computer.org
Wed Jan 30 21:19:00 GMT 2002


Bryce McKinlay wrote:
> >> invokevirtual: 234 (faster than invokestatic)
> >> invokespecial: 68

> However the real reason static is so
> much slower here is due to GCJ adding a class initialization check to
> the start of every static method.

I could confirm it by disassembling the generated code.
> I think we can do better by putting
> this check at the call site rather than in the method.

Interesting.
I doubt whether moving the check to the call site can
reduce the number of runtime checks. If GCJ can hoist
the check code out of a loop or a hot-spot, the number
of the checks can be reduced. But I guess such hoisting
is hard to do because of Java's strict nature.
Some JIT compilers do code patching to suppress the
second and later invocation of a class initilizer check.
How do you think about it?
 Kazuyuki Shudo	shudo@computer.org	http://www.shudo.net/


More information about the Java mailing list

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