# LIRFrameStates

Deneau, Tom tom.deneau at amd.com
Tue Dec 24 10:31:50 PST 2013

```In the compilation of our Mandelbrot method test case (java code shown below), I noticed that besides the LIRFrameState for bci=0, there was also one created
* the beginning of the while loop
* the beginning of the first statement after the while loop

so an exception detected at the final statement would use the LIRFrameState for the beginning of the first statement after the while loop.

>From my reading of the http://design.cs.iastate.edu/vmil/2013/papers/p04-Duboscq.pdf paper, I would have thought that new LIRFrameStates are needed only when there is a bytecode with side effects, and I don't see any side effects until we get to the final java line.  So just curious why were the two other LIRFrameStates created?

-- Tom

=============================
public static void run(int[] rgb, int[] pallette, float xoffset, float yoffset, float scale, int gid) {
final int width = initWidth;
final int height = initHeight;
float lx = (((gid % width * scale) - ((scale / 2) * width)) / width) + xoffset;
float ly = (((gid / width * scale) - ((scale / 2) * height)) / height) + yoffset;
int count = 0;
float zx = lx;
float zy = ly;
float newzx = 0f;

// Iterate until the algorithm converges or until maxIterations are reached.
while (count < maxIterations && zx * zx + zy * zy < 8) {
newzx = zx * zx - zy * zy + lx;
zy = 2 * zx * zy + ly;
zx = newzx;
count++;
}
rgb[gid + 1] = pallette[count];   // will cause exception on last of range
}

```