Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeMethodParser.java @ 16820:0370880ac9ce
Truffle-DSL: better caching for type checks.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Aug 2014 18:06:26 +0200 |
parents | 23415229349b |
children | a665483c3881 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeMethodParser.java Wed Aug 13 18:06:18 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeMethodParser.java Wed Aug 13 18:06:26 2014 +0200 @@ -42,25 +42,21 @@ } protected ParameterSpec createValueParameterSpec(NodeExecutionData execution) { - ParameterSpec spec = new ParameterSpec(execution.getName(), nodeTypeMirrors(execution.getChild().getNodeData())); + ParameterSpec spec = new ParameterSpec(execution.getName(), nodeTypeMirrors(execution.getChild().getNodeData()), nodeTypeIdentifiers(execution.getChild().getNodeData())); spec.setExecution(execution); return spec; } protected List<TypeMirror> nodeTypeMirrors(NodeData nodeData) { - Set<TypeMirror> typeMirrors = new LinkedHashSet<>(); + return nodeData.getTypeSystem().getPrimitiveTypeMirrors(); + } - for (ExecutableTypeData typeData : nodeData.getExecutableTypes()) { - typeMirrors.add(typeData.getType().getPrimitiveType()); - } - - typeMirrors.add(nodeData.getTypeSystem().getGenericType()); - - return new ArrayList<>(typeMirrors); + protected Set<String> nodeTypeIdentifiers(NodeData nodeData) { + return nodeData.getTypeSystem().getTypeIdentifiers(); } protected ParameterSpec createReturnParameterSpec() { - ParameterSpec returnValue = new ParameterSpec("returnValue", nodeTypeMirrors(getNode())); + ParameterSpec returnValue = new ParameterSpec("returnValue", nodeTypeMirrors(getNode()), nodeTypeIdentifiers(getNode())); returnValue.setExecution(getNode().getThisExecution()); return returnValue; }