wiki:JooPo usage

Version 1 (modified by schuhmac, 9 years ago) (diff)


JooPo usage

Bytecode recognition is based on the second edition of the java virtual machine specification.

As of now, there are various restraints to the loop code recognized. Our method recognizes cleanly block structured code

  • with exits terminating some blocks,
  • breaks (exits from infinite loops on top scope),
  • and, within certain limits, collapses (blocks need not be terminated by a uniting instruction).

It relies on switch bytecode not being induced by cycles.

Block structure as required by joopo is usually output by the java compiler, if you do not use continue nor break statements in loops, use break in all switch statements, and if there is at least one instruction after the last inner block to any loop, which hinders the optimizer from streamlining the jumps.

In any unforseeable case anything still should not work, be sure to write at least one instruction before the end of any block in order to confound the optimizer.

Count loop detection is done purely syntactically, i.e. only checking for a certain fixed scheme, that one which is exerted by the standard java compiler.