comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/PolymorphicTest2.java @ 14641:f0bb82ebe30c

Truffle-DSL: some fixes and optimizations to the generated code. Fixed polymorphic specialization nodes could still reference children in some cases. Removed generation of getCost methods since they were very expensive to call. Removed generation of copyPolymorphic, setNext0. Made generated executeGeneric0 and executeAndSpecialize0 final.
author Christian Humer <christian.humer@gmail.com>
date Thu, 20 Mar 2014 17:50:41 +0100
parents 5d1308c78ddc
children 5148aab962af
comparison
equal deleted inserted replaced
14638:b2e2132c0eff 14641:f0bb82ebe30c
40 /* Tests the unexpected polymorphic case. */ 40 /* Tests the unexpected polymorphic case. */
41 TestRootNode<Node1> node = TestHelper.createRoot(Node1Factory.getInstance()); 41 TestRootNode<Node1> node = TestHelper.createRoot(Node1Factory.getInstance());
42 assertEquals(21, executeWith(node, false, false)); 42 assertEquals(21, executeWith(node, false, false));
43 assertEquals(42, executeWith(node, 21, 21)); 43 assertEquals(42, executeWith(node, 21, 21));
44 assertEquals("(boolean,int)", executeWith(node, false, 42)); 44 assertEquals("(boolean,int)", executeWith(node, false, 42));
45 assertEquals(NodeCost.NONE, node.getNode().getCost()); 45 assertEquals(NodeCost.POLYMORPHIC, node.getNode().getCost());
46 } 46 }
47 47
48 @SuppressWarnings("unused") 48 @SuppressWarnings("unused")
49 @PolymorphicLimit(3) 49 @PolymorphicLimit(3)
50 abstract static class Node1 extends BinaryNode { 50 abstract static class Node1 extends BinaryNode {