public class ProfilingInfoTest extends GraalCompilerTest
NOTE: These tests are actually not very robust. The problem is that only partial profiling
information may be gathered for any given method. For example, HotSpot's advanced compilation
policy can decide to only gather partial profiles in a first level compilation (see
AdvancedThresholdPolicy::common(...) in advancedThresholdPolicy.cpp). Because of this,
occasionally tests for ProfilingInfo.getNullSeen(int)
can fail since HotSpot only set's
the null_seen bit when doing full profiling.
GraalCompilerTest.ArgSupplier, GraalCompilerTest.Result
Modifier and Type | Field and Description |
---|---|
private static double |
DELTA |
private static int |
N |
lastCompiledGraph
Constructor and Description |
---|
ProfilingInfoTest() |
Modifier and Type | Method and Description |
---|---|
static int |
arrayIndexOutOfBoundsExceptionSnippet(int[] array) |
static int |
branchProbabilitySnippet(int value) |
static int |
checkCastExceptionSnippet(Object obj) |
static Serializable |
checkCastSnippet(Object obj) |
private void |
continueProfiling(int executions,
String methodName,
Object... args) |
private void |
continueProfiling(String methodName,
Object... args) |
static boolean |
instanceOfSnippet(Object obj) |
static int |
invokeInterfaceSnippet(CharSequence a) |
static int |
invokeVirtualSnippet(Object obj) |
static int |
invokeWithExceptionSnippet(boolean doThrow) |
static int |
nullPointerExceptionSnippet(Object obj) |
private jdk.internal.jvmci.meta.ProfilingInfo |
profile(boolean resetProfile,
int executions,
String methodName,
Object... args) |
private jdk.internal.jvmci.meta.ProfilingInfo |
profile(String methodName,
Object... args) |
private void |
resetProfile(String methodName) |
static int |
switchProbabilitySnippet(int value) |
void |
testBranchTakenProbability() |
void |
testExceptionSeen() |
void |
testNullSeen() |
private void |
testNullSeen(String snippet) |
void |
testProfileInvokeVirtual() |
void |
testSwitchProbabilities() |
private void |
testTypeProfile(String testSnippet,
int bci) |
void |
testTypeProfileCheckCast() |
void |
testTypeProfileInstanceOf() |
void |
testTypeProfileInvokeInterface() |
private static int |
throwException(boolean doThrow) |
addMethod, after, afterTest, applyArgSuppliers, argsWithReceiver, asResolvedJavaMethod, assertConstantReturn, assertEquals, assertEquals, assertEquals, before, beforeTest, branchProbability, breakpoint, breakpoint, checkArgs, checkHighTierGraph, checkLowTierGraph, checkMidTierGraph, compile, countUnusedConstants, createLIRSuites, createSuites, editGraphBuilderConfiguration, executeActual, executeActualCheckDeopt, executeExpected, getBackend, getCanonicalGraphString, getCode, getCode, getCode, getCodeCache, getConstantReflection, getCustomGraphBuilderSuite, getDefaultGraphBuilderPlugins, getDefaultGraphBuilderSuite, getDefaultHighTierContext, getLIRSuites, getLowerer, getMetaAccess, getNodeCountExcludingUnusedConstants, getProviders, getReplacements, getResolvedJavaMethod, getResolvedJavaMethod, getResolvedJavaMethod, getSnippetReflection, getSpeculationLog, getSuites, getTarget, initializeDebugging, invoke, isArchitecture, iterationCount, lookupMethod, parseDebug, parseEager, parseEager, parseForCompile, parseProfiled, parseProfiled, referenceInvoke, supply, test, test, testAgainstExpected, testAgainstExpected, testN
private static final int N
private static final double DELTA
public ProfilingInfoTest()
public void testBranchTakenProbability()
public static int branchProbabilitySnippet(int value)
public void testSwitchProbabilities()
public static int switchProbabilitySnippet(int value)
public void testProfileInvokeVirtual()
public static int invokeVirtualSnippet(Object obj)
public void testTypeProfileInvokeInterface()
public static int invokeInterfaceSnippet(CharSequence a)
public void testTypeProfileCheckCast()
public static Serializable checkCastSnippet(Object obj)
public void testTypeProfileInstanceOf()
public static boolean instanceOfSnippet(Object obj)
private void testTypeProfile(String testSnippet, int bci)
public void testExceptionSeen()
public static int nullPointerExceptionSnippet(Object obj)
public static int arrayIndexOutOfBoundsExceptionSnippet(int[] array)
public static int checkCastExceptionSnippet(Object obj)
public static int invokeWithExceptionSnippet(boolean doThrow)
private static int throwException(boolean doThrow)
public void testNullSeen()
private void testNullSeen(String snippet)
private void continueProfiling(String methodName, Object... args)
private void continueProfiling(int executions, String methodName, Object... args)
private jdk.internal.jvmci.meta.ProfilingInfo profile(boolean resetProfile, int executions, String methodName, Object... args)
private void resetProfile(String methodName)