Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java @ 10859:7a0ba9b20fec
Truffle-DSL: fixed bug in rewriting of child arrays.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 23 Jul 2013 17:47:56 +0200 |
parents | 00a9dbcbe431 |
children | a9cb98ff8fd9 |
comparison
equal
deleted
inserted
replaced
10838:02a5f5abd842 | 10859:7a0ba9b20fec |
---|---|
1372 String varName = var.getSimpleName().toString(); | 1372 String varName = var.getSimpleName().toString(); |
1373 builder.string("this.").string(varName); | 1373 builder.string("this.").string(varName); |
1374 if (Utils.isAssignable(getContext(), var.asType(), getContext().getTruffleTypes().getNode())) { | 1374 if (Utils.isAssignable(getContext(), var.asType(), getContext().getTruffleTypes().getNode())) { |
1375 builder.string(" = adoptChild(copy.").string(varName).string(")"); | 1375 builder.string(" = adoptChild(copy.").string(varName).string(")"); |
1376 } else if (Utils.isAssignable(getContext(), var.asType(), getContext().getTruffleTypes().getNodeArray())) { | 1376 } else if (Utils.isAssignable(getContext(), var.asType(), getContext().getTruffleTypes().getNodeArray())) { |
1377 builder.string(" = adoptChildren(copy.").string(varName).string(")"); | 1377 NodeData node = getModel().getNode(); |
1378 NodeChildData child = node.findChild(varName); | |
1379 if (child != null) { | |
1380 builder.string(" = adoptChildren("); | |
1381 builder.string("new ").type((child.getNodeType())).string(" {"); | |
1382 builder.startCommaGroup(); | |
1383 for (ActualParameter parameter : getModel().getParameters()) { | |
1384 NodeChildData foundChild = node.findChild(parameter.getSpecification().getName()); | |
1385 if (foundChild == child) { | |
1386 builder.startGroup(); | |
1387 builder.string("copy.").string(varName).string("[").string(String.valueOf(parameter.getIndex())).string("]"); | |
1388 builder.end(); | |
1389 } | |
1390 } | |
1391 | |
1392 builder.end().string("})"); | |
1393 } else { | |
1394 builder.string(" = adoptChildren(copy.").string(varName).string(")"); | |
1395 } | |
1378 } else { | 1396 } else { |
1379 builder.string(" = copy.").string(varName); | 1397 builder.string(" = copy.").string(varName); |
1380 } | 1398 } |
1381 builder.end(); | 1399 builder.end(); |
1382 } | 1400 } |