File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 55
55
import static com .oracle .graal .python .util .PythonUtils .TS_ENCODING ;
56
56
import static com .oracle .graal .python .util .PythonUtils .toTruffleStringUncached ;
57
57
import static com .oracle .graal .python .util .PythonUtils .tsLiteral ;
58
- import static com .oracle .truffle .api .CompilerDirectives .transferToInterpreterAndInvalidate ;
59
58
60
59
import java .io .IOException ;
61
60
import java .io .InputStream ;
@@ -237,8 +236,11 @@ public static final class PythonThreadState {
237
236
*/
238
237
PThreadState nativeWrapper ;
239
238
239
+ /* Assume that no trace function was ever set. */
240
+ public Assumption noTracingInThread = Assumption .create ("noTracingInThread" );
241
+
240
242
/* The global tracing function, set by sys.settrace and returned by sys.gettrace. */
241
- @ CompilationFinal Object traceFun ;
243
+ Object traceFun ;
242
244
243
245
/* Keep track of execution to avoid tracing code inside the tracing function. */
244
246
boolean tracing ;
@@ -343,12 +345,12 @@ public void dispose() {
343
345
}
344
346
345
347
public Object getTraceFun () {
346
- return traceFun ;
348
+ return noTracingInThread . isValid () ? null : traceFun ;
347
349
}
348
350
349
351
public void setTraceFun (Object traceFun ) {
350
352
if (this .traceFun != traceFun ) {
351
- transferToInterpreterAndInvalidate ();
353
+ noTracingInThread . invalidate ();
352
354
this .traceFun = traceFun ;
353
355
}
354
356
}
You can’t perform that action at this time.
0 commit comments