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.