This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: BC ABI: Don't initialize vtable pointer
- From: Andrew Haley <aph at redhat dot com>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Thu, 15 Jun 2006 19:25:50 +0100
- Subject: Re: BC ABI: Don't initialize vtable pointer
- References: <17553.34571.481134.686311@dell.pink> <44919D46.2020709@redhat.com>
Bryce McKinlay writes:
> Andrew Haley wrote:
> > + volatile jclass new_class
> > + = (jclass)_Jv_AllocObj (sizeof (java::lang::Class),
> > + &java::lang::Class::class$);
> > + const char *src = class_initializer + sizeof (void*);
> > + volatile char *dst = (volatile char*)new_class + sizeof (void*);
> >
> Why "volatile" ?
Aliasing. The same object is being accessed as java::lang::Class and
as void*.
It's not strictly necessary to make the char * volatile as well, but
it is harmless. It at least gives a warning that something "under the
hood" is going on.
Andrew.