comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java @ 18605:58eb9bbb60c4

Truffle-DSL: fixed several bugs when using arrays as type. added arrays test.
author Christian Humer <christian.humer@gmail.com>
date Wed, 03 Dec 2014 21:02:27 +0100
parents c88ab4f1f04a
children 1acaa69ff61b
comparison
equal deleted inserted replaced
18604:39441c10d314 18605:58eb9bbb60c4
320 } 320 }
321 321
322 /** 322 /**
323 * <pre> 323 * <pre>
324 * variant1 $condition != null 324 * variant1 $condition != null
325 * 325 *
326 * $type $name = defaultValue($type); 326 * $type $name = defaultValue($type);
327 * if ($condition) { 327 * if ($condition) {
328 * $name = $value; 328 * $name = $value;
329 * } 329 * }
330 * 330 *
331 * variant2 $condition != null 331 * variant2 $condition != null
332 * $type $name = $value; 332 * $type $name = $value;
333 * </pre> 333 * </pre>
334 * 334 *
335 * . 335 * .
1991 if (sourceTypes.size() <= 1) { 1991 if (sourceTypes.size() <= 1) {
1992 return null; 1992 return null;
1993 } 1993 }
1994 String prefix = expect ? "expect" : "execute"; 1994 String prefix = expect ? "expect" : "execute";
1995 String suffix = execution.getIndex() > -1 ? String.valueOf(execution.getIndex()) : ""; 1995 String suffix = execution.getIndex() > -1 ? String.valueOf(execution.getIndex()) : "";
1996 return prefix + ElementUtils.firstLetterUpperCase(child.getName()) + ElementUtils.firstLetterUpperCase(ElementUtils.getSimpleName(param.getType())) + suffix; 1996 return prefix + ElementUtils.firstLetterUpperCase(child.getName()) + ElementUtils.firstLetterUpperCase(ElementUtils.getTypeId(param.getType())) + suffix;
1997 } 1997 }
1998 1998
1999 private List<CodeExecutableElement> createExecuteChilds(Parameter param, Set<TypeData> expectTypes) { 1999 private List<CodeExecutableElement> createExecuteChilds(Parameter param, Set<TypeData> expectTypes) {
2000 CodeExecutableElement executeMethod = createExecuteChild(param, null); 2000 CodeExecutableElement executeMethod = createExecuteChild(param, null);
2001 if (executeMethod == null) { 2001 if (executeMethod == null) {