Skip to content

Commit 92da407

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Fix the CinderX 3.15 build
Summary: Fixes up the CinderX build after the latest import. This brought in python/cpython#142911 which move somethings into ceval.h so that we can directly include it rather than borrowing those functions. We bring back `cinderx-only-headers` and now use them on 3.10 and 3.15+. There's also a fix related to python/cpython#143569 where we need to update the interpreter loop. Also python/cpython@bb25f72 seems to have refactored `_PyDict_LookupIndex` to use `_PyDict_LookupIndexAndValue`. There's some more work after this to further reduce our usage of `ceval_macros.h` but this just gets things working again. Reviewed By: itamaro Differential Revision: D91146024 fbshipit-source-id: 6da3ef18fe5fe5f79e29a71cdbe98491bbb45a9d
1 parent 38c06b1 commit 92da407

8 files changed

Lines changed: 23 additions & 705 deletions

File tree

cinderx/Interpreter/3.15/Includes/generated_cases.c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11914,7 +11914,7 @@
1191411914
if (gen == NULL) {
1191511915
JUMP_TO_LABEL(error);
1191611916
}
11917-
assert(STACK_LEVEL() == 0);
11917+
assert(STACK_LEVEL() <= 2);
1191811918
_PyFrame_SetStackPointer(frame, stack_pointer);
1191911919
_PyInterpreterFrame* gen_frame = &gen->gi_iframe;
1192011920
frame->instr_ptr++;

cinderx/Interpreter/3.15/borrowed-ceval.c.template

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,56 +21,6 @@
2121
#include "internal/pycore_tuple.h"
2222
#include "cinderx/Interpreter/3.15/Includes/ceval_macros.h"
2323

24-
#define _PyFunction_Vectorcall Ci_PyFunction_Vectorcall
25-
26-
/* TBD - what about other compilers? */
27-
#if defined(__GNUC__) || defined(__clang__)
28-
# pragma GCC diagnostic push
29-
# pragma GCC diagnostic ignored "-Wunused-label"
30-
#elif defined(_MSC_VER) /* MS_WINDOWS */
31-
# pragma warning(push)
32-
# pragma warning(disable:4102)
33-
#endif
34-
35-
// @Borrow typedef _PyEntryFrame from Python/ceval.c
36-
37-
// @Borrow var _Py_INTERPRETER_TRAMPOLINE_INSTRUCTIONS from Python/ceval.c
38-
39-
// @Borrow function do_raise from Python/ceval.c
40-
// @Borrow function dump_item from Python/ceval.c
41-
// @Borrow function dump_stack from Python/ceval.c
42-
// @Borrow function lltrace_instruction from Python/ceval.c
43-
// @Borrow function lltrace_resume_frame from Python/ceval.c
44-
45-
// @Borrow function maybe_lltrace_resume_frame from Python/ceval.c
46-
// @Borrow function do_monitor_exc from Python/ceval.c
47-
// @Borrow function no_tools_for_global_event from Python/ceval.c
48-
// @Borrow function no_tools_for_local_event from Python/ceval.c
49-
// @Borrow function _PyEval_MonitorRaise from Python/ceval.c
50-
// @Borrow function monitor_reraise from Python/ceval.c
51-
// @Borrow function monitor_stop_iteration from Python/ceval.c
52-
// @Borrow function monitor_unwind from Python/ceval.c
53-
// @Borrow function monitor_handled from Python/ceval.c
54-
// @Borrow function monitor_throw from Python/ceval.c
55-
// @Borrow function format_missing from Python/ceval.c
56-
// @Borrow function missing_arguments from Python/ceval.c
57-
// @Borrow function too_many_positional from Python/ceval.c
58-
// @Borrow function positional_only_passed_as_keyword from Python/ceval.c
59-
// @Borrow function scan_back_to_entry_start from Python/ceval.c
60-
// @Borrow function skip_to_next_entry from Python/ceval.c
61-
62-
#define MAX_LINEAR_SEARCH 40
63-
64-
65-
// @Borrow function get_exception_handler from Python/ceval.c
66-
// @Borrow function initialize_locals from Python/ceval.c
67-
// @Borrow function clear_thread_frame from Python/ceval.c
68-
// @Borrow function clear_gen_frame from Python/ceval.c
69-
// @Borrow function _PyEval_FrameClearAndPop from Python/ceval.c
70-
// @Borrow function _PyEvalFramePushAndInit from Python/ceval.c
71-
// @Borrow function _PyEvalFramePushAndInit_Ex from Python/ceval.c
72-
73-
// Cinder specific adapted functions
7424
#define _PyCoro_GetAwaitableIter JitCoro_GetAwaitableIter
7525
#define _PyEval_GetAwaitable Ci_PyEval_GetAwaitable
7626
#define _PyEval_GetANext Ci_PyEval_GetANext

0 commit comments

Comments
 (0)