@@ -326,7 +326,7 @@ public boolean isSingleContext() {
326
326
private Shape hpySymbolCache ;
327
327
328
328
/** For fast access to the PythonThreadState object by the owning thread. */
329
- private final ContextThreadLocal <PythonThreadState > threadState = createContextThreadLocal (PythonContext .PythonThreadState ::new );
329
+ private final ContextThreadLocal <PythonThreadState > threadState = locals . createContextThreadLocal (PythonContext .PythonThreadState ::new );
330
330
331
331
public final ConcurrentHashMap <String , HiddenKey > typeHiddenKeys = new ConcurrentHashMap <>(TypeBuiltins .INITIAL_HIDDEN_TYPE_KEYS );
332
332
@@ -548,7 +548,7 @@ public RootCallTarget compileForBytecodeInterpreter(PythonContext context, ModTy
548
548
}
549
549
550
550
@ TruffleBoundary
551
- public RootCallTarget compileForBytecodeInterpreter (PythonContext context , ModTy mod , Source source , boolean topLevel , int optimize , List <String > argumentNames ,
551
+ public RootCallTarget compileForBytecodeInterpreter (PythonContext context , ModTy modIn , Source source , boolean topLevel , int optimize , List <String > argumentNames ,
552
552
RaisePythonExceptionErrorCallback errorCallback , EnumSet <FutureFeature > futureFeatures ) {
553
553
RaisePythonExceptionErrorCallback errorCb = errorCallback ;
554
554
if (errorCb == null ) {
@@ -557,8 +557,11 @@ public RootCallTarget compileForBytecodeInterpreter(PythonContext context, ModTy
557
557
try {
558
558
Compiler compiler = new Compiler (errorCb );
559
559
boolean hasArguments = argumentNames != null && !argumentNames .isEmpty ();
560
+ final ModTy mod ;
560
561
if (hasArguments ) {
561
- mod = transformASTForExecutionWithArguments (argumentNames , mod );
562
+ mod = transformASTForExecutionWithArguments (argumentNames , modIn );
563
+ } else {
564
+ mod = modIn ;
562
565
}
563
566
CompilationUnit cu = compiler .compile (mod , EnumSet .noneOf (Compiler .Flags .class ), optimize , futureFeatures );
564
567
CodeUnit co = cu .assemble ();
@@ -657,8 +660,8 @@ public Object execute(VirtualFrame frame) {
657
660
Object [] arguments = PArguments .create ();
658
661
// escape?
659
662
PFrame pFrame = materializeFrameNode .execute (this , false , true , frame );
660
- Object locals = getFrameLocalsNode .execute (pFrame );
661
- PArguments .setSpecialArgument (arguments , locals );
663
+ Object pLocals = getFrameLocalsNode .execute (pFrame );
664
+ PArguments .setSpecialArgument (arguments , pLocals );
662
665
PArguments .setGlobals (arguments , PArguments .getGlobals (frame ));
663
666
boolean wasAcquired = gilNode .acquire ();
664
667
try {
0 commit comments