On 03/03/2008, Andrew John Hughes <[EMAIL PROTECTED]> wrote: > On 03/03/2008, Dalibor Topic <[EMAIL PROTECTED]> wrote: > > Christian Thalinger wrote: > > > On Sun, 2008-03-02 at 02:08 +0000, Andrew John Hughes wrote: > > >> This patch separates out common methods from the reflection VM > > >> interfaces (Field, Constructor, Method) so that they are provided > > >> in Classpath itself, and only native methods now appear in > > >> new VMField, VMMethod and VMConstructor classes in the VM interface. > > >> There is a lot of duplicate code in these classes that is currently > > >> left to the VM to maintain, resulting in large parts of these files > > >> in the VM being verbatim copies of the reference implementation and > > >> dependent on package-private Classpath methods. > > >> > > >> Comments please. > > > > > > I think that is a very good idea, as these reflection class were the > > > only ones without a VM-interface class. I'd like to have that in. > > > > > > > > > Yes, please. > > > > cheers, > > > > dalibor topic > > > > > Committed. Thanks everyone. > > -- > Andrew :-) > > Document Freedom Day - March 26th > http://documentfreedom.org > > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net >
I'm in the process of adding a further change to this, which hopefully won't be too controversial. Basically, I'm switching the paradigm from calling static methods of a VM interface to having a VM instance for each main instance (same style as VMThread). This allows the VM to store whatever data it needs for invocation and value retrieval, rather than restricting it to a Class instance and an integer slot (which are now simply parts of the reference VM instance). I changed this on realising that JikesRVM uses its own VM_Method and VM_Field instances rather than Class and slot. This change allows this and any other alternative a VM may think of, while still making it simple for VMs like CACAO to just implement the required native methods. Patch to follow. -- Andrew :-) Document Freedom Day - March 26th http://documentfreedom.org Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net
