Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/SpecializationData.java @ 8252:0905d796944a
Refactored codegen error model to make error redirection a lot easier.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Mar 2013 19:58:28 +0100 |
parents | cb70ed101b5f |
children | 4dc7034317ec |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/SpecializationData.java Wed Mar 13 11:32:43 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/SpecializationData.java Wed Mar 13 19:58:28 2013 +0100 @@ -34,8 +34,8 @@ private final boolean generic; private final boolean uninitialized; private final List<SpecializationThrowsData> exceptions; - private SpecializationGuardData[] guards; - private ShortCircuitData[] shortCircuits; + private List<SpecializationGuardData> guards; + private List<ShortCircuitData> shortCircuits; private boolean useSpecializationsForGeneric = true; private NodeData node; @@ -60,15 +60,27 @@ this.generic = generic; this.uninitialized = uninitialized; this.exceptions = Collections.emptyList(); - this.guards = new SpecializationGuardData[0]; + this.guards = new ArrayList<>(); this.synthetic = synthetic; } + @Override + protected List<MessageContainer> findChildContainers() { + List<MessageContainer> sinks = new ArrayList<>(); + if (exceptions != null) { + sinks.addAll(exceptions); + } + if (guards != null) { + sinks.addAll(guards); + } + return sinks; + } + public boolean hasRewrite(ProcessorContext context) { - if (getExceptions().size() > 0) { + if (!getExceptions().isEmpty()) { return true; } - if (getGuards().length > 0) { + if (!getGuards().isEmpty()) { return true; } for (ActualParameter parameter : getParameters()) { @@ -92,7 +104,7 @@ this.node = node; } - public void setGuards(SpecializationGuardData[] guards) { + public void setGuards(List<SpecializationGuardData> guards) { this.guards = guards; } @@ -116,15 +128,15 @@ return exceptions; } - public SpecializationGuardData[] getGuards() { + public List<SpecializationGuardData> getGuards() { return guards; } - public void setShortCircuits(ShortCircuitData[] shortCircuits) { + public void setShortCircuits(List<ShortCircuitData> shortCircuits) { this.shortCircuits = shortCircuits; } - public ShortCircuitData[] getShortCircuits() { + public List<ShortCircuitData> getShortCircuits() { return shortCircuits; }