com.github.ferstl.jarscan.NextInstructionFreqMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
A Maven plugin that scans the project artifact and its dependencies for methods that cannot be inlined by the JIT
compiler. It uses the JarScan utility from the JITWatch project to do that.
See https://github.com/AdoptOpenJDK/jitwatch .
The newest version!
package com.github.ferstl.jarscan;
import org.adoptopenjdk.jitwatch.jarscan.IJarScanOperation;
import org.adoptopenjdk.jitwatch.jarscan.nextinstruction.NextInstructionOperation;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
* List the most popular next instruction for each bytecode instruction.
*
* @since 1.1
*/
@Mojo(
name = "nextInstructionFreq",
aggregator = false,
defaultPhase = LifecyclePhase.VERIFY,
requiresDependencyCollection = ResolutionScope.TEST,
requiresDependencyResolution = ResolutionScope.TEST,
requiresDirectInvocation = false,
threadSafe = true)
public class NextInstructionFreqMojo extends AbstractJarScanMojo {
/**
* Limit to top n results per instruction.
*
* @since 1.1
*/
@Parameter(property = "limit", defaultValue = "0")
private int limit;
@Override
protected String validateMojoParameters() {
if (this.limit < 0) {
return "limit must be >= 0.";
}
return null;
}
@Override
protected IJarScanOperation createOperation() {
return new NextInstructionOperation(this.limit);
}
}