In general, all non-exceptional, unconditional branches in Java code are compiled down to goto
(or goto_w
). That includes break
statements, continue
statements, unconditional loops, and any number of control flow patterns. You will not be able to derive any simple mapping between break
statements in Java code to goto
opcodes. You can determine which jumps act like a switch break
by doing some control flow analysis, but it won't be perfect.
A good learning experience might be to pick apart the source code from a Java decompiler, as decompilers must reconstruct switch
statements and figure out how to represent the jumps as break
, continue
, etc. Procyon and Krakatau are both open source. I wrote the former, but the code base is large and daunting, so it may not be the best choice.