From: | "Oliver Wong" <owong@castortech.com> |
Newsgroups: | comp.compilers |
Date: | 28 Jan 2006 15:18:17 -0500 |
Organization: | GlobeTrotter |
References: | 06-01-037 06-01-055 06-01-079 |
Keywords: | analysis |
Posted-Date: | 28 Jan 2006 15:18:17 EST |
"A Pietu Pohjalainen" <pohjalai@cc.helsinki.fi> wrote
> paolo.bonzini@gmail.com wrote:
>>> In the statement:
>>> z = y = x;
>>> Which of the following outputs would be more "correct"?
>>>
>>> * There is a read from x, which leads to a write to y.
>>> * There is a write to y.
>>> * There is a read from y, which leads to a write to z.
>>> * There is a write to z.
>
>> This one, according to the JLS.
>
> JLS = Java Language Specification ?
>
> Java compiler does to bytecode level:
> read x;
> duplicate;
> write y;
> write z;
>
> There is no read from y.
Note sure about the bytecode, but from the JLS 3rd edition:
http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.26
<quote>
a=b=c means a=(b=c), which assigns the value of c to b and then assigns the
value of b to a.
</quote>
Probably my original terminology or phrasing "there is a read etc." was
flawed, which may have caused some confusion.
- Oliver
Return to the
comp.compilers page.
Search the
comp.compilers archives again.