This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Dec 1, 2011, at 4:28 PM, Per Bothner wrote:
On 12/01/2011 01:21 PM, Jamison Hope wrote:It probably makes sense to generate the bridge methods at the same time as we check for missing implementations.
Where are they generated now?
My point is: they're not. That needs to be implemented.
At all? I thought you meant they weren't being generated here as a result of you commenting out the relevant part of ClassExp or because they don't yet work with this circular parameterization nonsense.
I just meant for the regular (non-parameterized) case. For instance, when javac compiles:
// A.java public class A { public A get() { return null; } }
// B.java public class B extends A { public B get() { return null; } }
B.class ends up with an extra method:
Compiled from "B.java"
public class B extends A{ public B(); public B get(); public A get(); }
The third method is marked SYNTHETIC|PUBLIC|BRIDGE (0x1041) and its implementation is
aload_0 invokevirtual 2 // call public B get() areturn
and it exists so that B actually overrides A's get() method with an identical signature.
But it turns out that when Kawa compiles the Scheme equivalent,
(define-simple-class A () ((get) ::A #!null))
(define-simple-class B (A) ((get) ::B #!null))
B.class doesn't get the extra method:
Compiled from "bridge.scm" public class bridge.B extends bridge.A{ public bridge.B get(); public bridge.B(); }
But maybe that's not what you're referring to as a bridge method.
public int compareTo(Foo o) { return x - o.x; }
public int compareTo(Object o) { return compareTo((Foo) o); } -- --Per Bothner per@bothner.com http://per.bothner.com/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |