Mercurial > hg > truffle
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java @ 14599:fdabadc7980d
Truffle-DSL: fixed wrong generation of costs for polymorphic nodes.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 18 Mar 2014 20:35:55 +0100 |
parents | 40eedef0a586 |
children | a08b8694f556 |
comparison
equal
deleted
inserted
replaced
14598:40eedef0a586 | 14599:fdabadc7980d |
---|---|
969 TypeMirror nodeInfoKind = context.getTruffleTypes().getNodeCost(); | 969 TypeMirror nodeInfoKind = context.getTruffleTypes().getNodeCost(); |
970 | 970 |
971 CodeTreeBuilder builder = method.createBuilder(); | 971 CodeTreeBuilder builder = method.createBuilder(); |
972 if (node.isPolymorphic() && specialization == null) { | 972 if (node.isPolymorphic() && specialization == null) { |
973 // assume next0 exists | 973 // assume next0 exists |
974 builder.startIf().string("next0 != null && next0.getCost() == ").staticReference(nodeInfoKind, "MONOMORPHIC").end(); | 974 builder.startIf().string("next0 != null && next0.getCost() != ").staticReference(nodeInfoKind, "UNINITIALIZED").end(); |
975 builder.startBlock(); | 975 builder.startBlock(); |
976 builder.startReturn().staticReference(nodeInfoKind, "POLYMORPHIC").end(); | 976 builder.startReturn().staticReference(nodeInfoKind, "POLYMORPHIC").end(); |
977 builder.end(); | 977 builder.end(); |
978 } | 978 } |
979 | 979 |