why hotspot will optimize the following using hoisting?
<p>Reading Effective Java, the author mentioned that</p>

<pre><code>while(!done) i++;
</code></pre>

<p>can be optimized by hotspot into </p>

<pre><code>if (!done) {
    while(true) i++
}
</code></pre>

<p>I am very confused about it. done is usally not a const, why can compiler optimze that way?</p>
