Mercurial > hg > truffle
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeParser.java @ 8243:d81ff782fa1a
Removed @SpecializationThrows from codegen API. Replaced it by a simplier version in @Specialization.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 04 Mar 2013 17:20:26 +0100 |
parents | ac4e8c16ffdf |
children | 703c09f8640c |
comparison
equal
deleted
inserted
replaced
8242:ac4e8c16ffdf | 8243:d81ff782fa1a |
---|---|
39 import com.oracle.truffle.codegen.processor.template.*; | 39 import com.oracle.truffle.codegen.processor.template.*; |
40 import com.oracle.truffle.codegen.processor.typesystem.*; | 40 import com.oracle.truffle.codegen.processor.typesystem.*; |
41 | 41 |
42 public class NodeParser extends TemplateParser<NodeData> { | 42 public class NodeParser extends TemplateParser<NodeData> { |
43 | 43 |
44 public static final List<Class<? extends Annotation>> ANNOTATIONS = Arrays.asList(Generic.class, TypeSystemReference.class, ShortCircuit.class, Specialization.class, SpecializationListener.class, | 44 public static final List<Class<? extends Annotation>> ANNOTATIONS = Arrays.asList(Generic.class, TypeSystemReference.class, ShortCircuit.class, Specialization.class, SpecializationListener.class); |
45 SpecializationThrows.class); | |
46 | 45 |
47 private Map<String, NodeData> parsedNodes; | 46 private Map<String, NodeData> parsedNodes; |
48 private TypeElement originalType; | 47 private TypeElement originalType; |
49 | 48 |
50 public NodeParser(ProcessorContext c) { | 49 public NodeParser(ProcessorContext c) { |
779 } | 778 } |
780 boolean valid = true; | 779 boolean valid = true; |
781 for (SpecializationData sourceSpecialization : node.getSpecializations()) { | 780 for (SpecializationData sourceSpecialization : node.getSpecializations()) { |
782 if (sourceSpecialization.getExceptions() != null) { | 781 if (sourceSpecialization.getExceptions() != null) { |
783 for (SpecializationThrowsData throwsData : sourceSpecialization.getExceptions()) { | 782 for (SpecializationThrowsData throwsData : sourceSpecialization.getExceptions()) { |
784 SpecializationData targetSpecialization = specializationMap.get(throwsData.getTransitionToName()); | |
785 AnnotationValue value = Utils.getAnnotationValue(throwsData.getAnnotationMirror(), "transitionTo"); | |
786 | |
787 if (targetSpecialization == null) { | |
788 log.error(throwsData.getSpecialization().getMethod(), throwsData.getAnnotationMirror(), value, "Specialization with name '%s' not found.", throwsData.getTransitionToName()); | |
789 valid = false; | |
790 } else if (compareSpecialization(typeSystem, sourceSpecialization, targetSpecialization) >= 0) { | |
791 log.error(throwsData.getSpecialization().getMethod(), throwsData.getAnnotationMirror(), value, | |
792 "The order of the target specializalization must be higher than the source specialization.", throwsData.getTransitionToName()); | |
793 valid = false; | |
794 } | |
795 | |
796 for (SpecializationThrowsData otherThrowsData : sourceSpecialization.getExceptions()) { | 783 for (SpecializationThrowsData otherThrowsData : sourceSpecialization.getExceptions()) { |
797 if (otherThrowsData != throwsData && Utils.typeEquals(otherThrowsData.getJavaClass(), throwsData.getJavaClass())) { | 784 if (otherThrowsData != throwsData && Utils.typeEquals(otherThrowsData.getJavaClass(), throwsData.getJavaClass())) { |
798 AnnotationValue javaClassValue = Utils.getAnnotationValue(throwsData.getAnnotationMirror(), "javaClass"); | 785 AnnotationValue javaClassValue = Utils.getAnnotationValue(throwsData.getAnnotationMirror(), "rewriteOn"); |
799 log.error(throwsData.getSpecialization().getMethod(), throwsData.getAnnotationMirror(), javaClassValue, "Duplicate exception type.", throwsData.getTransitionToName()); | 786 log.error(throwsData.getSpecialization().getMethod(), throwsData.getAnnotationMirror(), javaClassValue, "Duplicate exception type."); |
800 valid = false; | 787 valid = false; |
801 } | 788 } |
802 } | 789 } |
803 } | 790 } |
804 } | 791 } |