|
182 | 182 | import com.oracle.graal.python.nodes.util.CastToJavaStringNode;
|
183 | 183 | import com.oracle.graal.python.runtime.ExecutionContext.IndirectCallContext;
|
184 | 184 | import com.oracle.graal.python.runtime.PythonContext;
|
| 185 | +import com.oracle.graal.python.runtime.PythonContext.PythonThreadState; |
185 | 186 | import com.oracle.graal.python.runtime.PythonCore;
|
186 | 187 | import com.oracle.graal.python.runtime.PythonOptions;
|
187 | 188 | import com.oracle.graal.python.runtime.PythonParser.ParserMode;
|
|
203 | 204 | import com.oracle.truffle.api.debug.Debugger;
|
204 | 205 | import com.oracle.truffle.api.dsl.Cached;
|
205 | 206 | import com.oracle.truffle.api.dsl.Cached.Shared;
|
| 207 | +import com.oracle.truffle.api.dsl.CachedLanguage; |
206 | 208 | import com.oracle.truffle.api.dsl.GenerateNodeFactory;
|
207 | 209 | import com.oracle.truffle.api.dsl.ImportStatic;
|
208 | 210 | import com.oracle.truffle.api.dsl.ReportPolymorphism;
|
@@ -1097,16 +1099,18 @@ final boolean doRecursiveWithNode(VirtualFrame frame, Object instance, PTuple cl
|
1097 | 1099 |
|
1098 | 1100 | @Specialization(guards = "depth >= getNodeRecursionLimit()")
|
1099 | 1101 | final boolean doRecursiveWithLoop(VirtualFrame frame, Object instance, PTuple clsTuple,
|
| 1102 | + @CachedLanguage PythonLanguage language, |
1100 | 1103 | @Cached("createNonRecursive()") RecursiveBinaryCheckBaseNode node) {
|
1101 |
| - Object state = IndirectCallContext.enter(frame, getContext(), this); |
| 1104 | + PythonThreadState threadState = getContext().getThreadState(language); |
| 1105 | + Object state = IndirectCallContext.enter(frame, threadState, this); |
1102 | 1106 | try {
|
1103 | 1107 | // Note: we need actual recursion to trigger the stack overflow error like CPython
|
1104 | 1108 | // Note: we need fresh RecursiveBinaryCheckBaseNode and cannot use "this", because
|
1105 | 1109 | // children of this executed by other specializations may assume they'll always get
|
1106 | 1110 | // non-null frame
|
1107 | 1111 | return callRecursiveWithNodeTruffleBoundary(instance, clsTuple, node);
|
1108 | 1112 | } finally {
|
1109 |
| - IndirectCallContext.exit(frame, getContext(), state); |
| 1113 | + IndirectCallContext.exit(frame, threadState, state); |
1110 | 1114 | }
|
1111 | 1115 | }
|
1112 | 1116 |
|
|
0 commit comments