Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeData.java @ 10446:746fa60be266
Implemented CreateCast annotation for easier insertion of casts.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 20 Jun 2013 19:10:09 +0200 |
parents | 0e4db5ee0695 |
children | 3cc5fb59916e |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeData.java Tue Jun 18 10:12:27 2013 +0200 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeData.java Thu Jun 20 19:10:09 2013 +0200 @@ -50,6 +50,7 @@ private Map<Integer, List<ExecutableTypeData>> executableTypes; private List<ShortCircuitData> shortCircuits; private List<String> assumptions; + private List<CreateCastData> casts; private String shortName; @@ -74,6 +75,14 @@ this.assumptions = splitSource.assumptions; } + public List<CreateCastData> getCasts() { + return casts; + } + + void setCasts(List<CreateCastData> casts) { + this.casts = casts; + } + void setShortName(String shortName) { this.shortName = shortName; } @@ -133,6 +142,9 @@ if (fields != null) { containerChildren.addAll(fields); } + if (casts != null) { + containerChildren.addAll(casts); + } return containerChildren; } @@ -230,6 +242,9 @@ methods.addAll(getSpecializationListeners()); methods.addAll(getExecutableTypes()); methods.addAll(getShortCircuits()); + if (getCasts() != null) { + methods.addAll(getCasts()); + } return methods; } @@ -367,6 +382,7 @@ dumpProperty(builder, indent, "executableTypes", getExecutableTypes()); dumpProperty(builder, indent, "specializations", getSpecializations()); dumpProperty(builder, indent, "assumptions", getAssumptions()); + dumpProperty(builder, indent, "casts", getCasts()); dumpProperty(builder, indent, "messages", collectMessages()); if (getDeclaredNodes().size() > 0) { builder.append(String.format("\n%s children = [", indent)); @@ -489,4 +505,15 @@ return getClass().getSimpleName() + "[" + getNodeId() + "]"; } + public CreateCastData findCast(String name) { + if (getCasts() != null) { + for (CreateCastData cast : getCasts()) { + if (cast.getChildNames().contains(name)) { + return cast; + } + } + } + return null; + } + }