Search in sources :

Example 1 with BranchProfile

use of com.oracle.truffle.api.profiles.BranchProfile in project graal by oracle.

the class BranchProfileTest method testToString.

@Test
public void testToString() {
    BranchProfile profile = (BranchProfile) invokeStatic(loadRelative(CountingConditionProfileTest.class, "BranchProfile$Enabled"), "create0");
    assertTrue(profile.toString().contains(BranchProfile.class.getSimpleName()));
    assertTrue(profile.toString().contains("UNINITIALIZED"));
    assertTrue(profile.toString().contains(Integer.toHexString(profile.hashCode())));
    profile.enter();
    assertTrue(profile.toString().contains(BranchProfile.class.getSimpleName()));
    assertTrue(profile.toString().contains("VISITED"));
    assertTrue(profile.toString().contains(Integer.toHexString(profile.hashCode())));
}
Also used : BranchProfile(com.oracle.truffle.api.profiles.BranchProfile) Test(org.junit.Test)

Example 2 with BranchProfile

use of com.oracle.truffle.api.profiles.BranchProfile in project graal by oracle.

the class BranchProfileTest method testEnter.

@Test
public void testEnter() {
    BranchProfile profile = (BranchProfile) invokeStatic(loadRelative(CountingConditionProfileTest.class, "BranchProfile$Enabled"), "create0");
    profile.enter();
    profile.enter();
}
Also used : BranchProfile(com.oracle.truffle.api.profiles.BranchProfile) Test(org.junit.Test)

Aggregations

BranchProfile (com.oracle.truffle.api.profiles.BranchProfile)2 Test (org.junit.Test)2