patch to bring java vtables closer to g++ abi conformance

Daniel Jacobowitz drow@mvista.com
Thu Jan 24 22:24:00 GMT 2002


On Wed, Jan 23, 2002 at 05:35:40PM -0800, Per Bothner wrote:
> Bryce McKinlay wrote:
> 
> >Given:
> >
> >class A {}
> >class B extends A {}
> >
> >Then B would have a vtable which looks something like:
> 
> How about:
> 
> [-6] &Object.class
> [-5] &A.class
> [-4] &B.class
> [-3] -2 /* depth, negated */
> [-2] offset_to_top (always 0)
> [-1] type_info
> <-- vtable pointer points here
> [0] GC descriptor<-- vtable pointer points here
> [1] &java.lang.Object.hashCode()
> [2] ...etc
> >
> >"b instanceof A" then becomes something like

As far as this goes, do whatever you want - but put the symbol name for
the vtable where it would be if this were a C++ class.  Generally, two
words before the vtable pointer points.  Being careful of
integer/pointer sizes on various architectures, of course.

After that, I don't care :)

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer



More information about the Java mailing list