Skip to content

Commit 8cc15a0

Browse files
committed
Add missing TruffleBoundary
1 parent d93817f commit 8cc15a0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/AtexitModuleBuiltins.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import com.oracle.graal.python.runtime.exception.PException;
6464
import com.oracle.graal.python.util.PythonUtils;
6565
import com.oracle.truffle.api.CompilerDirectives;
66+
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
6667
import com.oracle.truffle.api.TruffleLanguage;
6768
import com.oracle.truffle.api.TruffleLanguage.ContextReference;
6869
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
@@ -106,18 +107,23 @@ public Object execute(VirtualFrame frame) {
106107
try {
107108
return callNode.execute(null, callable, arguments, keywords);
108109
} catch (PException e) {
109-
PBaseException pythonException = e.getEscapedException();
110-
PythonObjectLibrary lib = PythonObjectLibrary.getUncached();
111-
if (!IsBuiltinClassProfile.profileClassSlowPath(lib.getLazyPythonClass(pythonException), PythonBuiltinClassType.SystemExit)) {
112-
lib.lookupAndCallRegularMethod(context.getCore().getStderr(), null, "write", "Error in atexit._run_exitfuncs:\n");
113-
ExceptionUtils.printExceptionTraceback(context, pythonException);
114-
}
110+
handleException(context, e);
115111
throw e;
116112
} finally {
117113
context.popTopFrameInfo();
118114
context.setCaughtException(null);
119115
}
120116
}
117+
118+
@TruffleBoundary
119+
private static void handleException(PythonContext context, PException e) {
120+
PBaseException pythonException = e.getEscapedException();
121+
PythonObjectLibrary lib = PythonObjectLibrary.getUncached();
122+
if (!IsBuiltinClassProfile.profileClassSlowPath(lib.getLazyPythonClass(pythonException), PythonBuiltinClassType.SystemExit)) {
123+
lib.lookupAndCallRegularMethod(context.getCore().getStderr(), null, "write", "Error in atexit._run_exitfuncs:\n");
124+
ExceptionUtils.printExceptionTraceback(context, pythonException);
125+
}
126+
}
121127
}
122128

123129
@Specialization

0 commit comments

Comments
 (0)