JavaMemoryModel: Array

From: Jean-Philippe Lesot (Jean-Philippe.Lesot@irisa.fr)
Date: Mon Dec 10 2001 - 09:22:13 EST


Hello,

Sorry if my question is out of topic in this mailing list.

I know quite well mechanismes inside a JVM but I don't know what a java
compiler is allowed to do to optimize Java _bytecode_. Because array
elements can't be volatile, it is not clear for me what is possible: (i) Is
it possible for a java compiler to optimize two consecutive writes (e.g.
IASTORE) at the same index in only one? (ii) It is possible for a java
compiler to reorder writes in two different arrays? I need a way to prevent
such optimizations without using method call but using classic array access.

Is it possible in the present Java Memory Model? And in your proposition?

Thanks you for your help, and sorry for my English.

Bye,
Jp.

--
 -----------------------------------------------------------------
  INRIA Rennes (IRISA)        Email: Jean-Philippe.Lesot@irisa.fr
              Web: http://www.irisa.fr/solidor/work/scratchy.html

------------------------------- JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:36 EDT