[gcjx] Patch: FYI: fix to method instantiation
Tom Tromey
tromey@redhat.com
Fri Oct 21 21:47:00 GMT 2005
I'm checking this in on the gcjx branch.
This fixes a small problem with method instantiation.
It is basically a hack -- we set descriptor for an instantiation of a
generic method to be the same as the signature of its parent. This
lets bytecode generation emit the correct descriptor.
A better fix will be to introduce explicit generic method
instantiations, along with pointers to parent methods, followed by
fixes in code generation. I'll do this at some later date.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* model/method.cc (model_method): Set 'descriptor'.
Index: model/method.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/method.cc,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 method.cc
--- model/method.cc 19 Oct 2005 01:15:26 -0000 1.1.2.9
+++ model/method.cc 21 Oct 2005 21:45:57 -0000
@@ -49,6 +49,13 @@
{
set_name (other->name);
+ // Set our descriptor to be the same as the descriptor of the
+ // instance from which we were created. FIXME: this is kind of a
+ // hack, we should perhaps instead just directly track our parent
+ // and let users get that information directly. In this case it
+ // would be preferable to make a new model_method_instance subclass.
+ descriptor = other->get_descriptor ();
+
// The method itself might be generic.
// FIXME can the type bounds be type variables from the class?
set_type_parameters (other->type_parameters);
More information about the Java-patches
mailing list