Enum Class TruffleCompilerRuntime.LoopExplosionKind

java.lang.Object
java.lang.Enum<TruffleCompilerRuntime.LoopExplosionKind>
com.oracle.truffle.compiler.TruffleCompilerRuntime.LoopExplosionKind
All Implemented Interfaces:
Serializable, Comparable<TruffleCompilerRuntime.LoopExplosionKind>, Constable
Enclosing interface:
TruffleCompilerRuntime

public static enum TruffleCompilerRuntime.LoopExplosionKind extends Enum<TruffleCompilerRuntime.LoopExplosionKind>
Controls behavior of ExplodeLoop annotation.
  • Enum Constant Details

    • NONE

      public static final TruffleCompilerRuntime.LoopExplosionKind NONE
      No loop explosion.
    • FULL_UNROLL

      public static final TruffleCompilerRuntime.LoopExplosionKind FULL_UNROLL
      Fully unroll all loops. The loops must have a known finite number of iterations. If a loop has multiple loop ends, they are merged so that the subsequent loop iteration is processed only once. For example, a loop with 4 iterations and 2 loop ends leads to 1+1+1+1 = 4 copies of the loop body.
      Since:
      0.15
    • FULL_UNROLL_UNTIL_RETURN

      public static final TruffleCompilerRuntime.LoopExplosionKind FULL_UNROLL_UNTIL_RETURN
      Like FULL_UNROLL, but in addition loop unrolling duplicates loop exits in every iteration instead of merging them. Code after a loop exit is duplicated for every loop exit and every loop iteration. For example, a loop with 4 iterations and 2 loop exits (exit1 and exit2, where exit1 is an early return inside a loop) leads to 4 copies of the loop body and 4 copies of exit1 and 1 copy if exit2. After each exit all code until a return is duplicated per iteration. Beware of break statements inside loops since they cause additional loop exits leading to code duplication along exit2.
    • FULL_EXPLODE

      public static final TruffleCompilerRuntime.LoopExplosionKind FULL_EXPLODE
      Fully explode all loops. The loops must have a known finite number of iterations. If a loop has multiple loop ends, they are not merged so that subsequent loop iterations are processed multiple times. For example, a loop with 4 iterations and 2 loop ends leads to 1+2+4+8 = 15 copies of the loop body.
      Since:
      0.15
    • FULL_EXPLODE_UNTIL_RETURN

      public static final TruffleCompilerRuntime.LoopExplosionKind FULL_EXPLODE_UNTIL_RETURN
      Like FULL_EXPLODE, but in addition explosion does not stop at loop exits. Code after the loop is duplicated for every loop exit of every loop iteration. For example, a loop with 4 iterations and 2 loop exits leads to 4 * 2 = 8 copies of the code after the loop.
      Since:
      0.15
    • MERGE_EXPLODE

      public static final TruffleCompilerRuntime.LoopExplosionKind MERGE_EXPLODE
      like FULL_EXPLODE, but copies of the loop body that have the exact same state (all local variables have the same value) are merged. This reduces the number of copies necessary, but can introduce loops again. This kind is useful for bytecode interpreter loops.
      Since:
      0.15
  • Method Details

    • values

      public static TruffleCompilerRuntime.LoopExplosionKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TruffleCompilerRuntime.LoopExplosionKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null