[Mono-list] ikvm and Mono 0.20

Philippe Lavoie philippe.lavoie@cactus.ca
Wed, 26 Feb 2003 14:19:22 -0500


(Beware, a possibly stupid suggestion follows)

Why not tag the class with an attribute?

[InitStaticOnFirstUseOnly]
public static class Bob {
}

The InitStaticOnFirstUseOnly would just mean that the compiler needs to
create a transparent singleton static proxy for that class.

This way, current implementation stays the same and the programmer is
(or might be) aware that relying on InitStaticOnFirstUseOnly will come
with a slight performance hit.

Unless ECMA states when static is created. Personally, I though it was
always at start-up time. I didn't know MS.NET did it on 'first use'.

Phil


-----Original Message-----
From: dietmar [mailto:dietmar@ximian.com]=20
Sent: Wednesday, February 26, 2003 12:43 PM
To: Paolo Molaro
Cc: mono-list
Subject: Re: [Mono-list] ikvm and Mono 0.20

On Wed, 2003-02-26 at 17:16, Paolo Molaro wrote:
> On 02/26/03 Varga Zoltan wrote:
> > The problem is with the if (!cfg->share_code) statements in
> > the JIT,
> > which create some vtables at JIT compile time, instead of
> > creating it
> > the first time a static variable/method is accessed.=20
>=20
> Oh, ok, I guess we'll have to add calls to init the vtable
> any time a static variable is used, possibly doing some of the same
> tricks we use with method calls to reduce to the minimum the overhead
> after the first call. I'll have to think about how best to integrate
> this in the JIT, since I'd like to have an optimization pass remove
the
> calls if they are redundand.

Is that really needed? I thought a program should not depend on such
things.

- Dietmar

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list