@@ -832,28 +832,6 @@ void JITRT_UnlinkFrame(PyThreadState* tstate) {
832832 cleanupFrameExecutable (frame);
833833}
834834
835- // Clean up the reifier and decref the executable for a lightweight frame.
836- // Shared by JITRT_UnlinkLightweightFrameFast and JITRT_UnlinkLeafFrame.
837- #ifdef ENABLE_LIGHTWEIGHT_FRAMES
838- static void cleanupLightweightFrameExecutable (
839- _PyInterpreterFrame* frame,
840- [[maybe_unused]] jit::FrameHeader* header) {
841- #if PY_VERSION_HEX >= 0x030E0000
842- PyStackRef_CLOSE (frame->f_executable );
843- #else
844- // Replace the reifier in f_funcobj with the actual function so that any
845- // escaped references to the frame see a valid function pointer, not a
846- // dangling reifier callback.
847- PyObject* func = jit::jitFrameGetFunction (frame);
848- frame->f_funcobj = func;
849- Py_XDECREF (func);
850- header->frame_status = JIT_FRAME_INITIALIZED ;
851-
852- Py_DECREF (frameExecutable (frame));
853- #endif
854- }
855- #endif
856-
857835void JITRT_UnlinkLightweightFrameFast (PyThreadState* tstate) {
858836 _PyInterpreterFrame* frame = currentFrame (tstate);
859837 setCurrentFrame (tstate, frame->previous );
@@ -878,22 +856,6 @@ void JITRT_UnlinkLightweightFrameFast(PyThreadState* tstate) {
878856 cleanupFrameExecutable (frame);
879857}
880858
881- void JITRT_UnlinkLeafFrame (PyThreadState* tstate) {
882- _PyInterpreterFrame* frame = currentFrame (tstate);
883- setCurrentFrame (tstate, frame->previous );
884-
885- // No deopts means the frame was never materialized — skip the
886- // materialization check and just close funcobj + executable directly.
887- Ci_STACK_CLOSE (frame->f_funcobj );
888-
889- #ifdef ENABLE_LIGHTWEIGHT_FRAMES
890- auto * header = reinterpret_cast <jit::FrameHeader*>(frame) - 1 ;
891- cleanupLightweightFrameExecutable (frame, header);
892- #else
893- cleanupFrameExecutable (frame);
894- #endif
895- }
896-
897859PyObject*
898860JITRT_LoadGlobal (PyObject* globals, PyObject* builtins, PyObject* name) {
899861 PyObject* result =
0 commit comments