This is the mail archive of the java-patches@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]

Re: BC ABI: Don't initialize vtable pointer


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.


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