comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SlowPathTest.java @ 12635:ba6593e52d22

Truffle-DSL: fixed additional wrong @SlowPath usage on generic. (GRAAL-490 #resolve)
author Christian Humer <christian.humer@gmail.com>
date Mon, 28 Oct 2013 11:06:51 +0100
parents 980db6c0bcd3
children
comparison
equal deleted inserted replaced
12613:595f01abb887 12635:ba6593e52d22
26 26
27 import com.oracle.truffle.api.CompilerDirectives.SlowPath; 27 import com.oracle.truffle.api.CompilerDirectives.SlowPath;
28 import com.oracle.truffle.api.dsl.*; 28 import com.oracle.truffle.api.dsl.*;
29 import com.oracle.truffle.api.dsl.test.SlowPathTestFactory.SlowPathOnGeneric0Factory; 29 import com.oracle.truffle.api.dsl.test.SlowPathTestFactory.SlowPathOnGeneric0Factory;
30 import com.oracle.truffle.api.dsl.test.SlowPathTestFactory.SlowPathOnGeneric1Factory; 30 import com.oracle.truffle.api.dsl.test.SlowPathTestFactory.SlowPathOnGeneric1Factory;
31 import com.oracle.truffle.api.dsl.test.SlowPathTestFactory.SlowPathOnGeneric2Factory;
31 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; 32 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode;
32 import com.oracle.truffle.api.frame.*; 33 import com.oracle.truffle.api.frame.*;
33 import com.oracle.truffle.api.nodes.*; 34 import com.oracle.truffle.api.nodes.*;
34 35
35 /** Tests the generated placement of {@link SlowPath} in generated methods. */ 36 /** Tests the generated placement of {@link SlowPath} in generated methods. */
67 throw new AssertionError(); 68 throw new AssertionError();
68 } 69 }
69 70
70 } 71 }
71 72
73 @Test
74 public void testSlowPathOnGeneric2() throws NoSuchMethodException, SecurityException {
75 Node node = SlowPathOnGeneric2Factory.create(null);
76 Assert.assertNull(node.getClass().getSuperclass().getDeclaredMethod("executeGeneric0", VirtualFrame.class, Object.class).getAnnotation(SlowPath.class));
77 }
78
79 @NodeChild
80 abstract static class SlowPathOnGeneric2 extends ValueNode {
81
82 @Specialization(order = 0)
83 @SuppressWarnings("unused")
84 Object doObject0(int value0) {
85 throw new AssertionError();
86 }
87
88 @Specialization(order = 1)
89 @SuppressWarnings("unused")
90 Object doObject1(VirtualFrame frame, String value0) {
91 throw new AssertionError();
92 }
93
94 }
95
72 } 96 }