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 4848import com .oracle .graal .python .builtins .objects .method .PMethod ;
4949import com .oracle .graal .python .builtins .objects .module .PythonModule ;
5050import 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 ;
5252import com .oracle .graal .python .nodes .BuiltinNames ;
5353import com .oracle .graal .python .nodes .NodeFactory ;
5454import com .oracle .graal .python .nodes .PNode ;
@@ -386,10 +386,20 @@ protected Iterable<Scope> findTopScopes(PythonContext context) {
386386 }
387387
388388 @ Override
389+ @ TruffleBoundary
389390 protected SourceSection findSourceLocation (PythonContext context , Object value ) {
390391 if (value instanceof PFunction || value instanceof PMethod ) {
391392 PythonCallable callable = (PythonCallable ) value ;
392393 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+ }
393403 }
394404 return null ;
395405 }
You can’t perform that action at this time.
0 commit comments