Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java @ 15459:0dae565d9289
fixed code that ecj had a problem compiling
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 01 May 2014 18:26:25 +0200 |
parents | 2a4b6003ef03 |
children | 42f4d703bf0b |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java Thu May 01 17:05:24 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java Thu May 01 18:26:25 2014 +0200 @@ -317,16 +317,16 @@ /** * <pre> * variant1 $condition != null - * + * * $type $name = defaultValue($type); * if ($condition) { * $name = $value; * } - * + * * variant2 $condition != null * $type $name = $value; * </pre> - * + * * . */ private static CodeTree createLazyAssignment(CodeTreeBuilder parent, String name, TypeMirror type, CodeTree condition, CodeTree value) { @@ -978,9 +978,8 @@ private List<CodeExecutableElement> createImplicitChildrenAccessors() { NodeData node = getModel().getNode(); - // Map<NodeChildData, Set<TypeData>> expectTypes = new HashMap<>(); - @SuppressWarnings("unchecked") - List<Set<TypeData>> expectTypes = Arrays.<Set<TypeData>> asList(new Set[node.getGenericSpecialization().getParameters().size()]); + List<Set<TypeData>> prototype = Collections.nCopies(node.getGenericSpecialization().getParameters().size(), null); + List<Set<TypeData>> expectTypes = new ArrayList<>(prototype); for (ExecutableTypeData executableType : node.getExecutableTypes()) { for (int i = 0; i < executableType.getEvaluatedCount(); i++) { @@ -998,8 +997,7 @@ } List<CodeExecutableElement> methods = new ArrayList<>(); - @SuppressWarnings("unchecked") - List<Set<TypeData>> visitedList = Arrays.<Set<TypeData>> asList(new Set[node.getGenericSpecialization().getParameters().size()]); + List<Set<TypeData>> visitedList = new ArrayList<>(prototype); for (SpecializationData spec : node.getSpecializations()) { int signatureIndex = -1; for (ActualParameter param : spec.getParameters()) {