--On Samstag, 13. März 2004 01:57 +0100 Jeroen Frijters <[EMAIL PROTECTED]> wrote:
David Holmes wrote:
> Since I seem to be the only one that actually wants a VMClass
> instance, maybe we can agree on a slightly different interface.
> How about keep a reference to a VMClass instance in Class, but
> not calling any instance methods on VMClass, but using static
> methods instead (always passing the Class reference along).

I don't understand the purpose of holding a reference to an
instance of a class that only has static methods invoked on it.

The reference implementation of VMClass will not have any instance members, but VMs might choose to add instance state. However, after thinking about it some more, I think it would be better to just add an instance member to Class, called vmState (or whatever) of type Object. That is more flexible (at the cost of additional downcasts).

The only overhead for you is the unused vmState reference field in each
Class instance.


This seems a sound idea to me.

I think the downcasts are not a big problem, as those calls are mostly used by the reflection, thus not time-critical.


-Patrik



_______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to