@@ -95,6 +95,7 @@ ProcessingEnvironment getProcessingEnvironment() {
95
95
TypeMirror virtualFrameType ;
96
96
TypeMirror objectType ;
97
97
TypeMirror rubyNodeType ;
98
+ TypeMirror rubyBaseNodeType ;
98
99
99
100
@ Override
100
101
public SourceVersion getSupportedSourceVersion () {
@@ -115,6 +116,10 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
115
116
.getElementUtils ()
116
117
.getTypeElement ("org.truffleruby.language.RubyNode" )
117
118
.asType ();
119
+ rubyBaseNodeType = processingEnv
120
+ .getElementUtils ()
121
+ .getTypeElement ("org.truffleruby.language.RubyBaseNode" )
122
+ .asType ();
118
123
119
124
if (!annotations .isEmpty ()) {
120
125
for (Element element : roundEnvironment .getElementsAnnotatedWith (CoreModule .class )) {
@@ -403,7 +408,7 @@ private List<String> getArgumentNamesFromSpecializations(TypeElement klass, bool
403
408
List <VariableElement > argumentElements = new ArrayList <>();
404
409
405
410
TypeElement klassIt = klass ;
406
- while (true ) {
411
+ while (! isNodeBaseType ( klassIt ) ) {
407
412
for (Element el : klassIt .getEnclosedElements ()) {
408
413
if (!(el instanceof ExecutableElement )) {
409
414
continue ; // we are interested only in executable elements
@@ -462,14 +467,16 @@ private List<String> getArgumentNamesFromSpecializations(TypeElement klass, bool
462
467
}
463
468
464
469
klassIt = processingEnv .getElementUtils ().getTypeElement (klassIt .getSuperclass ().toString ());
465
- if (processingEnv .getTypeUtils ().isSameType (klassIt .asType (), rubyNodeType )) {
466
- break ;
467
- }
468
470
}
469
471
470
472
return argumentNames ;
471
473
}
472
474
475
+ public boolean isNodeBaseType (TypeElement typeElement ) {
476
+ return processingEnv .getTypeUtils ().isSameType (typeElement .asType (), rubyNodeType ) ||
477
+ processingEnv .getTypeUtils ().isSameType (typeElement .asType (), rubyBaseNodeType );
478
+ }
479
+
473
480
private boolean anyCoreMethod (List <? extends Element > enclosedElements ) {
474
481
for (Element e : enclosedElements ) {
475
482
if (e instanceof TypeElement && e .getAnnotation (CoreMethod .class ) != null ) {
0 commit comments