This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]