Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java @ 18761:a665483c3881
Truffle-DSL: new node layout implementation.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:54 +0100 |
parents | 59bf50cc5a32 |
children | c0fb70634640 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java Mon Dec 29 23:38:50 2014 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java Mon Dec 29 23:38:54 2014 +0100 @@ -56,7 +56,7 @@ public NodeData(ProcessorContext context, TypeElement type, String shortName, TypeSystemData typeSystem, List<NodeChildData> children, List<NodeExecutionData> executions, List<NodeFieldData> fields, List<String> assumptions, boolean generateFactory) { - super(context, type, null, null); + super(context, type, null); this.nodeId = type.getSimpleName().toString(); this.shortName = shortName; this.typeSystem = typeSystem; @@ -98,6 +98,35 @@ return childExecutions; } + public Set<TypeData> findSpecializedTypes(NodeExecutionData execution) { + Set<TypeData> types = new HashSet<>(); + for (SpecializationData specialization : getSpecializations()) { + if (!specialization.isSpecialized()) { + continue; + } + List<Parameter> parameters = specialization.findByExecutionData(execution); + for (Parameter parameter : parameters) { + TypeData type = parameter.getTypeSystemType(); + if (type == null) { + throw new AssertionError(); + } + types.add(type); + } + } + return types; + } + + public Collection<TypeData> findSpecializedReturnTypes() { + Set<TypeData> types = new HashSet<>(); + for (SpecializationData specialization : getSpecializations()) { + if (!specialization.isSpecialized()) { + continue; + } + types.add(specialization.getReturnType().getTypeSystemType()); + } + return types; + } + public int getSignatureSize() { if (getSpecializations() != null && !getSpecializations().isEmpty()) { return getSpecializations().get(0).getSignatureSize(); @@ -353,7 +382,7 @@ public SpecializationData getGenericSpecialization() { for (SpecializationData specialization : specializations) { - if (specialization.isGeneric()) { + if (specialization.isFallback()) { return specialization; } }