Skip to content

Commit fea8b70

Browse files
committed
GetFunctionCodeNode - fix assumptions in the cached case
1 parent d94c92b commit fea8b70

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PNodeWithContext.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
import com.oracle.graal.python.builtins.objects.exception.OSErrorEnum;
4747
import com.oracle.graal.python.builtins.objects.exception.PBaseException;
4848
import com.oracle.graal.python.builtins.objects.function.PKeyword;
49-
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
5049
import com.oracle.graal.python.builtins.objects.type.LazyPythonClass;
50+
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
5151
import com.oracle.graal.python.builtins.objects.type.PythonBuiltinClass;
5252
import com.oracle.graal.python.nodes.attributes.WriteAttributeToObjectNode;
5353
import com.oracle.graal.python.nodes.call.special.CallVarargsMethodNode;
@@ -64,7 +64,6 @@
6464
import com.oracle.truffle.api.TruffleLanguage.ContextReference;
6565
import com.oracle.truffle.api.frame.VirtualFrame;
6666
import com.oracle.truffle.api.nodes.Node;
67-
import com.oracle.truffle.api.nodes.RootNode;
6867
import com.oracle.truffle.api.profiles.ConditionProfile;
6968

7069
public abstract class PNodeWithContext extends Node {
@@ -175,16 +174,6 @@ public final PythonContext getContext() {
175174

176175
protected Assumption singleContextAssumption() {
177176
CompilerAsserts.neverPartOfCompilation("the singleContextAssumption should only be retrieved in the interpreter");
178-
PythonLanguage language = null;
179-
RootNode rootNode = getRootNode();
180-
if (rootNode != null) {
181-
language = rootNode.getLanguage(PythonLanguage.class);
182-
} else {
183-
throw new IllegalStateException("a python node was executed without being adopted!");
184-
}
185-
if (language == null) {
186-
language = PythonLanguage.getCurrent();
187-
}
188-
return language.singleContextAssumption;
177+
return PythonLanguage.getCurrent().singleContextAssumption;
189178
}
190179
}

0 commit comments

Comments
 (0)