File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 48
48
import com .oracle .graal .python .builtins .objects .method .PMethod ;
49
49
import com .oracle .graal .python .builtins .objects .module .PythonModule ;
50
50
import com .oracle .graal .python .builtins .objects .object .PythonObject ;
51
- import com .oracle .graal .python .builtins .objects .type .PythonBuiltinClass ;
51
+ import com .oracle .graal .python .builtins .objects .type .PythonClass ;
52
52
import com .oracle .graal .python .nodes .BuiltinNames ;
53
53
import com .oracle .graal .python .nodes .NodeFactory ;
54
54
import com .oracle .graal .python .nodes .PNode ;
@@ -386,10 +386,20 @@ protected Iterable<Scope> findTopScopes(PythonContext context) {
386
386
}
387
387
388
388
@ Override
389
+ @ TruffleBoundary
389
390
protected SourceSection findSourceLocation (PythonContext context , Object value ) {
390
391
if (value instanceof PFunction || value instanceof PMethod ) {
391
392
PythonCallable callable = (PythonCallable ) value ;
392
393
return callable .getCallTarget ().getRootNode ().getSourceSection ();
394
+ } else if (value instanceof PCode ) {
395
+ return ((PCode ) value ).getRootNode ().getSourceSection ();
396
+ } else if (value instanceof PythonClass ) {
397
+ for (String k : ((PythonClass ) value ).getAttributeNames ()) {
398
+ SourceSection attrSourceLocation = findSourceLocation (context , ((PythonClass ) value ).getAttribute (k ));
399
+ if (attrSourceLocation != null ) {
400
+ return attrSourceLocation ;
401
+ }
402
+ }
393
403
}
394
404
return null ;
395
405
}
You can’t perform that action at this time.
0 commit comments