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
Andrew Haley writes:
> 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*.
I take that back. I'm thinking about an earlier version of this code
that actually had an aliasing issue. I rewrote it to make the
aliasing go away, but I left in the volatile. I'l fix it before I
check it in.
Andrew.