This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: CNI changes (Was: Binary Compatibility)
Tom Tromey writes:
> Andrew> Besides, I have some vague memory that Java semantics actually
> Andrew> require storing into an int field to be atomic. [Looks it
> Andrew> up.] Oh yes, according to Section 8.3 of the VMspec that
> Andrew> seems to be the case. But a method pointer might on some
> Andrew> machines be a long rather than an int, so synchronization may
> Andrew> be required. I get it now, I think.
>
> I've never even been certain that we correctly implement the java
> rules for atomicity of stores. These rules are a requirement on us to
> generate the correct code...
That's right. So why are we making so much fuss about this particular
instance? It's only going to be an issue on a machine that has
multi-word function pointers.
> Changing the lookup code will make things a little worse. We'll need
> an extra function call and a synchronization for every JNI method. It
> would be nice not to do this if possible. This is an area I really
> don't know much about. Can we tell gcc that we need a certain store
> to be atomic?
This is all rather system dependent AFAIK.
Andrew.