Class SecretGenerator.MethodHandleGenerator

java.lang.Object
io.perfmark.impl.Generator
io.perfmark.java7.SecretGenerator.MethodHandleGenerator
Enclosing class:
SecretGenerator

public static final class SecretGenerator.MethodHandleGenerator extends Generator
  • Field Details

    • currentGeneration

      private static final MutableCallSite currentGeneration
    • currentGenerations

      private static final MutableCallSite[] currentGenerations
    • currentGenerationGetter

      private static final MethodHandle currentGenerationGetter
  • Constructor Details

    • MethodHandleGenerator

      public MethodHandleGenerator()
  • Method Details

    • getGeneration

      public long getGeneration()
      Description copied from class: Generator
      Gets the current generation, shifted left by Generator.GEN_OFFSET. An odd number means the library is enabled, while an even number means the library is disabled.
      Overrides:
      getGeneration in class Generator
      Returns:
      the current generation or Generator.FAILURE.
    • setGeneration

      public void setGeneration(long generation)
      Description copied from class: Generator
      Sets the current generation count. This should be eventually noticeable for callers of Generator.getGeneration(). An odd number means the library is enabled, while an even number means the library is disabled.
      Overrides:
      setGeneration in class Generator
      Parameters:
      generation - the generation id, shifted left by Generator.GEN_OFFSET.
    • costOfGetNanos

      public long costOfGetNanos()
      Description copied from class: Generator
      Returns the approximate cost to read the generation.
      Overrides:
      costOfGetNanos in class Generator
      Returns:
      an approximate number of nanoseconds needed to read the generator value.
    • costOfSetNanos

      public long costOfSetNanos()
      Description copied from class: Generator
      Returns the approximate cost to change the generation.
      Overrides:
      costOfSetNanos in class Generator
      Returns:
      an approximate number of nanoseconds needed to change the generator value.