This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: class initialization check overhead
- From: Adam Megacz <adam at megacz dot com>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Adam Megacz <adam at megacz dot com>, java at gcc dot gnu dot org
- Date: 23 Oct 2002 17:19:51 -0700
- Subject: Re: class initialization check overhead
- Organization: Myself
- References: <Pine.LNX.4.44.0210231903100.4446-100000@ops2.one-point.com>
Jeff Sturm <jsturm@one-point.com> writes:
> Or are you suggesting something like PROT_NONE, as in a guard page?
Whoops, yes, that's what I meant. Would this work?
Is ensuring that you never have two classes on the same page difficult
or too memory-consuming?
> This writes NOP instructions over the original call.
Wow, that's cool, but still kinda scary. Self-modifying code... =)
Could _Jv_InitClass be re-jiggered to perform all the register saves
itself (rather than asking the caller to do it)? In other words, put
a PUSHALL at the beginning and a POPALL at the end?
> If the frontend knows that a class invokes no <clinit> method
> (directly or in a superclass), could the _Jv_InitClass be dropped
> entirely?
Or perhaps give gcj a list of classes that you know will be referenced
eventually, and have it run those <clinit>s immediately upon startup.
You'd have to have a way to figure out the dependency tree... is there
enough information at runtime to do this? If not, this would either
require modifications to the linker, which is probably a bad idea.
- a
--
"Through your rags I see your vanity" -- Socrates