This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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]

question about vtable-gc



Does this require special communication between the linker and
compiler?

As far as I can tell, a virtual method invocation is just a pointer
dereference (plus an offset) and a call. And since the pointer is part
of the object on which the method is being invoked, and the offset is
known at compile time (before link time), the generated .o isn't going
to even need the symbol name for the method -- hence there's no way
for the linker to tell the difference between a virtual method
invocation and, say, "some_function_array[14]()".

Is this a correct assessment of why vtable-gc isn't as simple as the
linker dropping unreferenced symbols? The only thing that confuses me
is that I see symbols for method names in A.java showing up in B.o (B
invokes A's methods) -- but this shouldn't be the case, should it?

I'm trying to figure out some sort of hack to get a similar effect to
vtable-gc.. I don't have time to implement the real thing. Right now
my plan is to just forcibly remove classes that never get loaded and
have ld to ignore the unresolved symbols; I'll still have a lot of
never-called methods hanging around, though...

  - a


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]