Skip to content

Commit 5993d03

Browse files
committed
fix a few warnings in PythonLanguage
1 parent f3fc6e4 commit 5993d03

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public boolean isSingleContext() {
326326
private Shape hpySymbolCache;
327327

328328
/** 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);
330330

331331
public final ConcurrentHashMap<String, HiddenKey> typeHiddenKeys = new ConcurrentHashMap<>(TypeBuiltins.INITIAL_HIDDEN_TYPE_KEYS);
332332

@@ -548,7 +548,7 @@ public RootCallTarget compileForBytecodeInterpreter(PythonContext context, ModTy
548548
}
549549

550550
@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,
552552
RaisePythonExceptionErrorCallback errorCallback, EnumSet<FutureFeature> futureFeatures) {
553553
RaisePythonExceptionErrorCallback errorCb = errorCallback;
554554
if (errorCb == null) {
@@ -557,8 +557,11 @@ public RootCallTarget compileForBytecodeInterpreter(PythonContext context, ModTy
557557
try {
558558
Compiler compiler = new Compiler(errorCb);
559559
boolean hasArguments = argumentNames != null && !argumentNames.isEmpty();
560+
final ModTy mod;
560561
if (hasArguments) {
561-
mod = transformASTForExecutionWithArguments(argumentNames, mod);
562+
mod = transformASTForExecutionWithArguments(argumentNames, modIn);
563+
} else {
564+
mod = modIn;
562565
}
563566
CompilationUnit cu = compiler.compile(mod, EnumSet.noneOf(Compiler.Flags.class), optimize, futureFeatures);
564567
CodeUnit co = cu.assemble();
@@ -657,8 +660,8 @@ public Object execute(VirtualFrame frame) {
657660
Object[] arguments = PArguments.create();
658661
// escape?
659662
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);
662665
PArguments.setGlobals(arguments, PArguments.getGlobals(frame));
663666
boolean wasAcquired = gilNode.acquire();
664667
try {

0 commit comments

Comments
 (0)