|
46 | 46 | import com.oracle.graal.python.builtins.objects.exception.OSErrorEnum;
|
47 | 47 | import com.oracle.graal.python.builtins.objects.exception.PBaseException;
|
48 | 48 | import com.oracle.graal.python.builtins.objects.function.PKeyword;
|
49 |
| -import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass; |
50 | 49 | import com.oracle.graal.python.builtins.objects.type.LazyPythonClass;
|
| 50 | +import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass; |
51 | 51 | import com.oracle.graal.python.builtins.objects.type.PythonBuiltinClass;
|
52 | 52 | import com.oracle.graal.python.nodes.attributes.WriteAttributeToObjectNode;
|
53 | 53 | import com.oracle.graal.python.nodes.call.special.CallVarargsMethodNode;
|
|
64 | 64 | import com.oracle.truffle.api.TruffleLanguage.ContextReference;
|
65 | 65 | import com.oracle.truffle.api.frame.VirtualFrame;
|
66 | 66 | import com.oracle.truffle.api.nodes.Node;
|
67 |
| -import com.oracle.truffle.api.nodes.RootNode; |
68 | 67 | import com.oracle.truffle.api.profiles.ConditionProfile;
|
69 | 68 |
|
70 | 69 | public abstract class PNodeWithContext extends Node {
|
@@ -175,16 +174,6 @@ public final PythonContext getContext() {
|
175 | 174 |
|
176 | 175 | protected Assumption singleContextAssumption() {
|
177 | 176 | 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; |
189 | 178 | }
|
190 | 179 | }
|
0 commit comments