Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/CreateCastParser.java @ 13527:25ecb47a6d0e
Truffle-DSL: Added support for references to child arrays in @ShortCircuit;
Introduced new layer NodeExecutionData to the implementation model which is in between NodeChildData and the actual parameters..
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 07 Jan 2014 12:22:47 +0100 |
parents | 43eab069ca9b |
children | b466199f19e1 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/CreateCastParser.java Thu Dec 26 12:37:28 2013 -0800 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/CreateCastParser.java Tue Jan 07 12:22:47 2014 +0100 @@ -46,17 +46,21 @@ @Override public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { List<String> childNames = Utils.getAnnotationValueList(String.class, mirror, "value"); - TypeMirror baseType = getContext().getTruffleTypes().getNode(); + NodeChildData foundChild = null; for (String childName : childNames) { - NodeChildData child = getNode().findChild(childName); - if (child != null) { - baseType = child.getOriginalType(); + foundChild = getNode().findChild(childName); + if (foundChild != null) { break; } } + TypeMirror baseType = getContext().getTruffleTypes().getNode(); + if (foundChild != null) { + baseType = foundChild.getOriginalType(); + } + MethodSpec spec = new MethodSpec(new InheritsParameterSpec(getContext(), "child", baseType)); addDefaultFieldMethodSpec(spec); - spec.addRequired(new ParameterSpec("castedChild", baseType)).setSignature(true); + spec.addRequired(new ParameterSpec("castedChild", baseType)); return spec; }