
Translating JVM Code to MIPS Code 215
4: i f _ i c m ple 17
7: iload_1
8: iload_0
9: iinc 0 , -1
12: imul
13: i s t o r e _ 1
14: goto 2
17: iload_1
18: ireturn
We have inserted line breaks to delineate basic blocks. The entry point is the iconst_1
instruction at location 0 so that begins a basic block; let us call it B1. The iload_0 at
location 2 is the target of the goto instruction (at 14) so that also must start a basic block;
we call it B2. B2 extends through the if_icmple instruction; the block must end there
because it is a branch. The next basic block (B3) begins at location 7 and extends to the
goto at location 14. Finally, the iload_1 at location ...