This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: class initialization check overhead
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- To: "'Jeff Sturm '" <jsturm at one-point dot com>, "'Kresten Krab Thorup '" <krab at trifork dot com>
- Cc: "'java at gcc dot gnu dot org '" <java at gcc dot gnu dot org>
- Date: Thu, 24 Oct 2002 21:19:36 -0700
- Subject: RE: class initialization check overhead
We need to be careful about memory ordering issues in this code. On current X86 processors it's probably OK. On Itanium the test needs to involve an aquire load. On some some other architectures a barrier is needed to ensure that loads following the test really can't see the preinitialization values.
Hans
--------------------------------
From: Jeff Sturm
To: Kresten Krab Thorup
Cc: java@gcc.gnu.org
Sent: 10/24/02 9:06 PM
Subject: Re: class initialization check overhead
On Thu, 24 Oct 2002, Kresten Krab Thorup wrote:
> if (!_initialized_org_gnu_foo_MyClass) {
> _Jv_InitClass(&_gnu_foo_MyClass, &_init_gnu_foo_MyClass;);
> }
Sure. It would improve on the current init check. But even
this adds quite a bit of complexity to small static methods (e.g.
leaf functions).