70
70
import com .oracle .truffle .api .CompilerDirectives .CompilationFinal ;
71
71
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
72
72
import com .oracle .truffle .api .RootCallTarget ;
73
- import com .oracle .truffle .api .Scope ;
74
73
import com .oracle .truffle .api .Truffle ;
75
74
import com .oracle .truffle .api .TruffleFile ;
76
75
import com .oracle .truffle .api .TruffleLanguage ;
@@ -469,14 +468,17 @@ protected boolean isVisible(PythonContext context, Object value) {
469
468
470
469
@ Override
471
470
@ TruffleBoundary
472
- protected Iterable <Scope > findLocalScopes (PythonContext context , Node node , Frame frame ) {
473
- ArrayList <Scope > scopes = new ArrayList <>();
474
- for (Scope s : super .findLocalScopes (context , node , frame )) {
471
+ // Remove in GR-26206
472
+ @ SuppressWarnings ("deprecation" )
473
+ protected Iterable <com .oracle .truffle .api .Scope > findLocalScopes (PythonContext context , Node node , Frame frame ) {
474
+ ArrayList <com .oracle .truffle .api .Scope > scopes = new ArrayList <>();
475
+ for (com .oracle .truffle .api .Scope s : super .findLocalScopes (context , node , frame )) {
475
476
if (frame == null ) {
476
477
PFunctionArgsFinder argsFinder = new PFunctionArgsFinder (node );
477
478
478
- Scope .Builder scopeBuilder = Scope .newBuilder (s .getName (), s .getVariables ()).node (s .getNode ()).receiver (s .getReceiverName (), s .getReceiver ()).rootInstance (
479
- s .getRootInstance ()).arguments (argsFinder .collectArgs ());
479
+ com .oracle .truffle .api .Scope .Builder scopeBuilder = com .oracle .truffle .api .Scope .newBuilder (s .getName (), s .getVariables ()).node (s .getNode ()).receiver (s .getReceiverName (),
480
+ s .getReceiver ()).rootInstance (
481
+ s .getRootInstance ()).arguments (argsFinder .collectArgs ());
480
482
481
483
scopes .add (scopeBuilder .build ());
482
484
} else {
@@ -487,11 +489,11 @@ protected Iterable<Scope> findLocalScopes(PythonContext context, Node node, Fram
487
489
if (frame != null ) {
488
490
PythonObject globals = PArguments .getGlobalsSafe (frame );
489
491
if (globals != null ) {
490
- scopes .add (Scope .newBuilder ("globals()" , scopeFromObject (globals )).build ());
492
+ scopes .add (com . oracle . truffle . api . Scope .newBuilder ("globals()" , scopeFromObject (globals )).build ());
491
493
}
492
494
Frame generatorFrame = PArguments .getGeneratorFrameSafe (frame );
493
495
if (generatorFrame != null ) {
494
- for (Scope s : super .findLocalScopes (context , node , generatorFrame )) {
496
+ for (com . oracle . truffle . api . Scope s : super .findLocalScopes (context , node , generatorFrame )) {
495
497
scopes .add (s );
496
498
}
497
499
}
@@ -508,12 +510,14 @@ private static InteropMap scopeFromObject(PythonObject globals) {
508
510
}
509
511
510
512
@ Override
511
- protected Iterable <Scope > findTopScopes (PythonContext context ) {
512
- ArrayList <Scope > scopes = new ArrayList <>();
513
+ // Remove in GR-26206
514
+ @ SuppressWarnings ("deprecation" )
515
+ protected Iterable <com .oracle .truffle .api .Scope > findTopScopes (PythonContext context ) {
516
+ ArrayList <com .oracle .truffle .api .Scope > scopes = new ArrayList <>();
513
517
if (context .getBuiltins () != null ) {
514
518
// false during initialization
515
- scopes .add (Scope .newBuilder (BuiltinNames .__MAIN__ , context .getMainModule ()).build ());
516
- scopes .add (Scope .newBuilder (BuiltinNames .BUILTINS , scopeFromObject (context .getBuiltins ())).build ());
519
+ scopes .add (com . oracle . truffle . api . Scope .newBuilder (BuiltinNames .__MAIN__ , context .getMainModule ()).build ());
520
+ scopes .add (com . oracle . truffle . api . Scope .newBuilder (BuiltinNames .BUILTINS , scopeFromObject (context .getBuiltins ())).build ());
517
521
}
518
522
return scopes ;
519
523
}
0 commit comments