Mercurial > hg > truffle
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java @ 20984:6361fa2e3321
Truffle-DSL: further fixes for polymorphic execute signatures.
author | Christian Humer <christian.humer@oracle.com> |
---|---|
date | Wed, 15 Apr 2015 21:13:43 +0200 |
parents | 05a2b72c071f |
children | 8e5f9310f3aa |
comparison
equal
deleted
inserted
replaced
20983:b99da6d86cfe | 20984:6361fa2e3321 |
---|---|
132 types.add(specialization.getReturnType().getType()); | 132 types.add(specialization.getReturnType().getType()); |
133 } | 133 } |
134 return types; | 134 return types; |
135 } | 135 } |
136 | 136 |
137 public int getExecutionCount() { | |
138 return getChildExecutions().size(); | |
139 } | |
140 | |
137 public int getSignatureSize() { | 141 public int getSignatureSize() { |
138 return getChildExecutions().size(); | 142 int count = 0; |
143 for (NodeExecutionData execution : getChildExecutions()) { | |
144 if (execution.isShortCircuit()) { | |
145 count++; | |
146 } | |
147 count++; | |
148 } | |
149 return count; | |
139 } | 150 } |
140 | 151 |
141 public boolean isFrameUsedByAnyGuard() { | 152 public boolean isFrameUsedByAnyGuard() { |
142 for (SpecializationData specialization : specializations) { | 153 for (SpecializationData specialization : specializations) { |
143 if (!specialization.isReachable()) { | 154 if (!specialization.isReachable()) { |
565 if (execution.getChild() != null) { | 576 if (execution.getChild() != null) { |
566 for (ExecutableTypeData executable : execution.getChild().getNodeData().getExecutableTypes()) { | 577 for (ExecutableTypeData executable : execution.getChild().getNodeData().getExecutableTypes()) { |
567 if (executable.hasUnexpectedValue(getContext())) { | 578 if (executable.hasUnexpectedValue(getContext())) { |
568 continue; | 579 continue; |
569 } | 580 } |
570 if (!typeSystem.hasImplicitSourceTypes(executable.getReturnType())) { | 581 types.add(executable.getReturnType()); |
571 types.add(executable.getReturnType()); | |
572 } | |
573 } | 582 } |
574 } | 583 } |
575 | 584 |
576 int executionIndex = execution.getIndex(); | 585 int executionIndex = execution.getIndex(); |
577 if (executionIndex >= 0) { | 586 if (executionIndex >= 0) { |
578 for (ExecutableTypeData typeData : getExecutableTypes()) { | 587 for (ExecutableTypeData typeData : getExecutableTypes()) { |
579 if (executionIndex < typeData.getEvaluatedCount()) { | 588 List<TypeMirror> signatureParameters = typeData.getSignatureParameters(); |
580 TypeMirror genericType = typeData.getEvaluatedParameters().get(executionIndex); | 589 if (executionIndex < signatureParameters.size()) { |
581 if (!typeSystem.hasImplicitSourceTypes(genericType)) { | 590 TypeMirror genericType = signatureParameters.get(executionIndex); |
582 types.add(genericType); | 591 types.add(genericType); |
583 } | |
584 } | 592 } |
585 } | 593 } |
586 } | 594 } |
587 | 595 |
588 return ElementUtils.uniqueSortedTypes(types); | 596 return ElementUtils.uniqueSortedTypes(types); |