Package io.perfmark.java7
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 Summary
Fields Modifier and Type Field Description private static java.lang.invoke.MutableCallSitecurrentGenerationprivate static java.lang.invoke.MethodHandlecurrentGenerationGetterprivate static java.lang.invoke.MutableCallSite[]currentGenerations-
Fields inherited from class io.perfmark.impl.Generator
FAILURE, GEN_OFFSET
-
-
Constructor Summary
Constructors Constructor Description MethodHandleGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcostOfGetNanos()Returns the approximate cost to read the generation.longcostOfSetNanos()Returns the approximate cost to change the generation.longgetGeneration()Gets the current generation, shifted left byGenerator.GEN_OFFSET.voidsetGeneration(long generation)Sets the current generation count.
-
-
-
Method Detail
-
getGeneration
public long getGeneration()
Description copied from class:GeneratorGets the current generation, shifted left byGenerator.GEN_OFFSET. An odd number means the library is enabled, while an even number means the library is disabled.- Overrides:
getGenerationin classGenerator- Returns:
- the current generation or
Generator.FAILURE.
-
setGeneration
public void setGeneration(long generation)
Description copied from class:GeneratorSets the current generation count. This should be eventually noticeable for callers ofGenerator.getGeneration(). An odd number means the library is enabled, while an even number means the library is disabled.- Overrides:
setGenerationin classGenerator- Parameters:
generation- the generation id, shifted left byGenerator.GEN_OFFSET.
-
costOfGetNanos
public long costOfGetNanos()
Description copied from class:GeneratorReturns the approximate cost to read the generation.- Overrides:
costOfGetNanosin classGenerator- Returns:
- an approximate number of nanoseconds needed to read the generator value.
-
costOfSetNanos
public long costOfSetNanos()
Description copied from class:GeneratorReturns the approximate cost to change the generation.- Overrides:
costOfSetNanosin classGenerator- Returns:
- an approximate number of nanoseconds needed to change the generator value.
-
-