Skip to content

Commit 8e2529b

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Cleanup dead code
Summary: This got removed from usage when we switched to inlining the unlinking, let's delete it. Reviewed By: yoney Differential Revision: D106864641 fbshipit-source-id: 6a2f088fe1eb636eb37c244c825a9d015e1b1b04
1 parent aeabc7d commit 8e2529b

2 files changed

Lines changed: 0 additions & 43 deletions

File tree

cinderx/Jit/jit_rt.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
857835
void 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-
897859
PyObject*
898860
JITRT_LoadGlobal(PyObject* globals, PyObject* builtins, PyObject* name) {
899861
PyObject* result =

cinderx/Jit/jit_rt.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ void JITRT_UnlinkFrame(PyThreadState* tstate);
7171
// jitFrameClearExceptCode path.
7272
void JITRT_UnlinkLightweightFrameFast(PyThreadState* tstate);
7373

74-
// Specialized version for non-deopting leaf functions with lightweight frames.
75-
// Since no deopts can occur, the frame is guaranteed to never be materialized,
76-
// so we skip the materialization check entirely.
77-
void JITRT_UnlinkLeafFrame(PyThreadState* tstate);
78-
7974
/*
8075
* Handles a call that includes kw arguments where the target function has
8176
* *args, **kwargs, or keyword only args.

0 commit comments

Comments
 (0)