
196 An Introduction to Compiler Construction in a Java World
if ( x < 0 || y > 0) {
x = y;
}
to produce
58: iload_1
59: iflt 66
62: iload_2
63: ifle 68
66: iload_2
67: i s t o r e _ 1
68: ...
Exercise 5.13. Write tests that involve conditional branches on nested Boolean expressions
that involve the, !, && and (if you have implemented it) || operator to insure that the
compiler is not generating branches to branches.
Exercise 5.14. Add the switch-statement to j--, adding it to your compiler and testing it
thoroughly.
The switch-statement is more involved than other control constructs. Fortunately, the
JVM provides special support for it. Code generation for