Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/TestHelper.java @ 9223:5f7f0d3e3638
Updated codegen tests to new codegen API.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 20 Apr 2013 12:17:47 +0200 |
parents | 6ef9fc7375c7 |
children | 8e3a1635cc9e |
comparison
equal
deleted
inserted
replaced
9222:aa9ffb3a715e | 9223:5f7f0d3e3638 |
---|---|
24 | 24 |
25 import java.util.*; | 25 import java.util.*; |
26 | 26 |
27 import com.oracle.truffle.api.*; | 27 import com.oracle.truffle.api.*; |
28 import com.oracle.truffle.api.codegen.*; | 28 import com.oracle.truffle.api.codegen.*; |
29 import com.oracle.truffle.api.codegen.test.BuiltinTest.*; | |
29 import com.oracle.truffle.api.codegen.test.TypeSystemTest.*; | 30 import com.oracle.truffle.api.codegen.test.TypeSystemTest.*; |
30 | 31 |
31 /** | 32 /** |
32 * Utility class to provide some test helper functions. | 33 * Utility class to provide some test helper functions. |
33 */ | 34 */ |
44 static <E extends ValueNode> TestRootNode<E> create(NodeFactory<E> factory, Object... constants) { | 45 static <E extends ValueNode> TestRootNode<E> create(NodeFactory<E> factory, Object... constants) { |
45 ArgumentNode[] argumentNodes = arguments(factory.getExecutionSignature().size()); | 46 ArgumentNode[] argumentNodes = arguments(factory.getExecutionSignature().size()); |
46 | 47 |
47 List<Object> argumentList = new ArrayList<>(); | 48 List<Object> argumentList = new ArrayList<>(); |
48 argumentList.addAll(Arrays.asList(constants)); | 49 argumentList.addAll(Arrays.asList(constants)); |
49 if (ChildrenNode.class.isAssignableFrom(factory.getNodeClass())) { | 50 if (ChildrenNode.class.isAssignableFrom(factory.getNodeClass()) || BuiltinNode.class.isAssignableFrom(factory.getNodeClass())) { |
50 argumentList.add(argumentNodes); | 51 argumentList.add(argumentNodes); |
51 } else { | 52 } else { |
52 argumentList.addAll(Arrays.asList(argumentNodes)); | 53 argumentList.addAll(Arrays.asList(argumentNodes)); |
53 } | 54 } |
54 return new TestRootNode<>(factory.createNode(argumentList.toArray(new Object[argumentList.size()]))); | 55 return new TestRootNode<>(factory.createNode(argumentList.toArray(new Object[argumentList.size()]))); |