use of com.oracle.truffle.api.dsl.UnsupportedSpecializationException in project graal by oracle.
the class LimitTest method testLocalLimit.
@Test
public void testLocalLimit() {
CallTarget root = TestHelper.createCallTarget(LocalLimitTestFactory.getInstance());
assertEquals(42, root.call(42));
assertEquals(43, root.call(43));
try {
root.call(44);
fail();
} catch (UnsupportedSpecializationException e) {
}
}
use of com.oracle.truffle.api.dsl.UnsupportedSpecializationException in project graal by oracle.
the class AssumptionsTest method testMethod.
@Test
public void testMethod() {
CallTarget root = createCallTarget(MethodTestFactory.getInstance());
MethodTest node = getNode(root);
assertEquals(42, root.call(42));
assertEquals(42, root.call(42));
node.hiddenAssumption.invalidate();
try {
root.call(45);
fail();
} catch (UnsupportedSpecializationException e) {
}
}
use of com.oracle.truffle.api.dsl.UnsupportedSpecializationException in project graal by oracle.
the class LimitTest method testConstantLimit.
@Test
public void testConstantLimit() {
CallTarget root = TestHelper.createCallTarget(ConstantLimitTestFactory.getInstance());
assertEquals(42, root.call(42));
assertEquals(43, root.call(43));
try {
root.call(44);
fail();
} catch (UnsupportedSpecializationException e) {
}
}
use of com.oracle.truffle.api.dsl.UnsupportedSpecializationException in project graal by oracle.
the class LimitTest method testMethodLimit.
@Test
public void testMethodLimit() {
MethodLimitTest.invocations = 0;
CallTarget root = TestHelper.createCallTarget(MethodLimitTestFactory.getInstance());
assertEquals(42, root.call(42));
assertEquals(43, root.call(43));
try {
root.call(44);
fail();
} catch (UnsupportedSpecializationException e) {
}
Assert.assertTrue(MethodLimitTest.invocations >= 3);
}
use of com.oracle.truffle.api.dsl.UnsupportedSpecializationException in project graal by oracle.
the class AssumptionsTest method testNodeField.
@Test
public void testNodeField() {
Assumption assumption = Truffle.getRuntime().createAssumption();
CallTarget root = createCallTarget(NodeFieldTest2Factory.getInstance(), assumption);
assertEquals(42, root.call(42));
assertEquals(42, root.call(42));
assumption.invalidate();
try {
root.call(45);
fail();
} catch (UnsupportedSpecializationException e) {
}
}
Aggregations