Search in sources :

Example 16 with Assumption

use of com.oracle.truffle.api.Assumption in project graal by oracle.

the class UnionAssumptionTest method testCheck.

@Test
public void testCheck() throws InvalidAssumptionException {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    union.check();
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Example 17 with Assumption

use of com.oracle.truffle.api.Assumption in project graal by oracle.

the class UnionAssumptionTest method testFirstInvalidateIsValid.

@Test
public void testFirstInvalidateIsValid() {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    first.invalidate();
    assertFalse(union.isValid());
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Example 18 with Assumption

use of com.oracle.truffle.api.Assumption in project graal by oracle.

the class UnionAssumptionTest method testSecondInvalidateCheck.

@Test(expected = InvalidAssumptionException.class)
public void testSecondInvalidateCheck() throws InvalidAssumptionException {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    second.invalidate();
    union.check();
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Example 19 with Assumption

use of com.oracle.truffle.api.Assumption in project graal by oracle.

the class UnionAssumptionTest method testFirstInvalidateCheck.

@Test(expected = InvalidAssumptionException.class)
public void testFirstInvalidateCheck() throws InvalidAssumptionException {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    first.invalidate();
    union.check();
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Example 20 with Assumption

use of com.oracle.truffle.api.Assumption in project graal by oracle.

the class UnionAssumptionTest method testSecondInvalidateIsValid.

@Test
public void testSecondInvalidateIsValid() {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    second.invalidate();
    assertFalse(union.isValid());
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Aggregations

Assumption (com.oracle.truffle.api.Assumption)42 Test (org.junit.Test)25 UnionAssumption (com.oracle.truffle.api.utilities.UnionAssumption)8 CallTarget (com.oracle.truffle.api.CallTarget)5 FrameDescriptor (com.oracle.truffle.api.frame.FrameDescriptor)5 TestHelper.createCallTarget (com.oracle.truffle.api.dsl.test.TestHelper.createCallTarget)3 Field (java.lang.reflect.Field)3 OptimizedCallTarget (org.graalvm.compiler.truffle.runtime.OptimizedCallTarget)3 RootTestNode (org.graalvm.compiler.truffle.test.nodes.RootTestNode)3 CompilationFinal (com.oracle.truffle.api.CompilerDirectives.CompilationFinal)2 NodeField (com.oracle.truffle.api.dsl.NodeField)2 ExplodeLoop (com.oracle.truffle.api.nodes.ExplodeLoop)2 Node (com.oracle.truffle.api.nodes.Node)2 CodeExecutableElement (com.oracle.truffle.dsl.processor.java.model.CodeExecutableElement)2 CodeVariableElement (com.oracle.truffle.dsl.processor.java.model.CodeVariableElement)2 CompilerDirectives (com.oracle.truffle.api.CompilerDirectives)1 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)1 Truffle (com.oracle.truffle.api.Truffle)1 TruffleRuntime (com.oracle.truffle.api.TruffleRuntime)1 Cached (com.oracle.truffle.api.dsl.Cached)1