• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /openjdk9/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/

Lines Matching defs:element

45 import javax.lang.model.element.AnnotationMirror;
46 import javax.lang.model.element.AnnotationValue;
47 import javax.lang.model.element.Element;
48 import javax.lang.model.element.ElementKind;
49 import javax.lang.model.element.ExecutableElement;
50 import javax.lang.model.element.Modifier;
51 import javax.lang.model.element.Name;
52 import javax.lang.model.element.PackageElement;
53 import javax.lang.model.element.TypeElement;
54 import javax.lang.model.element.VariableElement;
308 private void reportExceptionThrow(Element element, Throwable t) {
309 if (element != null) {
310 logMessage("throw for %s:\n", element);
313 errorMessage(element, "Exception throw during processing: %s %s", t, Arrays.toString(Arrays.copyOf(t.getStackTrace(), 4)));
381 private void declareType(TypeMirror mirror, String shortName, String nodeClass, String nodePackage, String[] inputs, boolean commutative, boolean shareable, Element element) {
383 descriptor.originatingElements.add(element);
496 private String fullClassName(Element element) {
497 assert element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE : element;
498 String pkg = findPackage(element);
499 return ((TypeElement) element).getQualifiedName().toString().substring(pkg.length() + 1);
685 private static TypeElement topDeclaringType(Element element) {
686 Element enclosing = element.getEnclosingElement();
688 assert element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE;
689 return (TypeElement) element;
694 private AnnotationMirror findAnnotationMirror(Element element, TypeMirror typeMirror) {
695 for (AnnotationMirror mirror : element.getAnnotationMirrors()) {
718 for (Element element : roundEnv.getElementsAnnotatedWith(MatchableNode.class)) {
719 logMessage("%s\n", element);
720 processMatchableNode(element);
722 for (Element element : roundEnv.getElementsAnnotatedWith(MatchableNodes.class)) {
723 logMessage("%s\n", element);
724 processMatchableNode(element);
733 for (Element element : roundEnv.getElementsAnnotatedWith(MatchRule.class)) {
734 currentElement = element;
735 processMatchRule(map, element, findAnnotationMirror(element, matchRuleTypeMirror));
737 for (Element element : roundEnv.getElementsAnnotatedWith(MatchRules.class)) {
738 currentElement = element;
739 processMatchRule(map, element, findAnnotationMirror(element, matchRulesTypeMirror));
757 private void processMatchableNode(Element element) {
758 if (!processedMatchableNode.contains(element)) {
760 processedMatchableNode.add(element);
762 AnnotationMirror mirror = findAnnotationMirror(element, matchableNodesTypeMirror);
764 mirror = findAnnotationMirror(element, matchableNodeTypeMirror);
769 TypeElement topDeclaringType = topDeclaringType(element);
776 for (MatchableNode matchableNode : element.getAnnotationsByType(MatchableNode.class)) {
777 processMatchableNode(element, topDeclaringType, matchableNode, mirrors != null ? mirrors.get(i++) : mirror);
780 reportExceptionThrow(element, t);
785 private void processMatchableNode(Element element, TypeElement topDeclaringType, MatchableNode matchable, AnnotationMirror mirror) throws GraalError {
786 logMessage("processMatchableNode %s %s %s\n", topDeclaringType, element, matchable);
796 throw new GraalError("Can't get mirror for node class %s", element);
805 errorMessage(element, mirror, "Class \"%s\" cannot be resolved to a type", nodeClass);
830 errorMessage(element, mirror, "Input named \"%s\" doesn't exist in %s", input, nodeClassElement.getSimpleName());
834 declareType(nodeClassMirror, shortName, nodeClass, nodePackage, matchable.inputs(), matchable.commutative(), matchable.shareable(), element);
837 private void processMatchRule(Map<TypeElement, MatchRuleDescriptor> map, Element element, AnnotationMirror mirror) {
838 if (!processedMatchRule.contains(element)) {
840 processedMatchRule.add(element);
842 // The annotation element type should ensure this is true.
843 assert element instanceof ExecutableElement;
845 findMatchableNodes(element);
847 TypeElement topDeclaringType = topDeclaringType(element);
859 for (MatchRule matchRule : element.getAnnotationsByType(MatchRule.class)) {
860 processMethodMatchRule((ExecutableElement) element, info, matchRule, mirrors != null ? mirrors.get(i++) : mirror);
863 reportExceptionThrow(element, t);
869 * Search the super types of element for MatchableNode definitions. Any superclass or super
872 * @param element
874 private void findMatchableNodes(Element element) {
875 processMatchableNode(element);
876 Element enclosing = element.getEnclosingElement();
996 private void errorMessage(Element element, String format, Object... args) {
997 processingEnv.getMessager().printMessage(Kind.ERROR, String.format(format, args), element);
1000 private void errorMessage(Element element, AnnotationMirror mirror, String format, Object... args) {
1001 processingEnv.getMessager().printMessage(Kind.ERROR, String.format(format, args), element, mirror);