Skip to content

Commit b116f11

Browse files
jbower-fbmeta-codesync[bot]
authored andcommitted
Add test for regenerated borrows
Summary: Check and remind people to rebuild the cached borrows output before landing. Includes latest generation. Reviewed By: martindemello Differential Revision: D86921928 fbshipit-source-id: 5d55fd6ec7c8f6830fdaf718a8c5014978b934e2
1 parent c216249 commit b116f11

2 files changed

Lines changed: 23 additions & 35 deletions

File tree

cinderx/Interpreter/3.14/ceval.h

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
#include "cinderx/Interpreter/3.14/Includes/ceval_macros.h"
6-
#include "cinderx/Jit/generators_core.h"
76
#include "internal/pycore_ceval.h"
87
#include "internal/pycore_stackref.h"
98
#include "internal/pycore_unicodeobject.h"
@@ -938,40 +937,6 @@ initialize_locals(PyThreadState *tstate, PyFunctionObject *func,
938937
fail_post_args:
939938
return -1;
940939
}
941-
const binaryfunc _PyEval_BinaryOps[] = {
942-
[NB_ADD] = PyNumber_Add,
943-
[NB_AND] = PyNumber_And,
944-
[NB_FLOOR_DIVIDE] = PyNumber_FloorDivide,
945-
[NB_LSHIFT] = PyNumber_Lshift,
946-
[NB_MATRIX_MULTIPLY] = PyNumber_MatrixMultiply,
947-
[NB_MULTIPLY] = PyNumber_Multiply,
948-
[NB_REMAINDER] = PyNumber_Remainder,
949-
[NB_OR] = PyNumber_Or,
950-
[NB_POWER] = _PyNumber_PowerNoMod,
951-
[NB_RSHIFT] = PyNumber_Rshift,
952-
[NB_SUBTRACT] = PyNumber_Subtract,
953-
[NB_TRUE_DIVIDE] = PyNumber_TrueDivide,
954-
[NB_XOR] = PyNumber_Xor,
955-
[NB_INPLACE_ADD] = PyNumber_InPlaceAdd,
956-
[NB_INPLACE_AND] = PyNumber_InPlaceAnd,
957-
[NB_INPLACE_FLOOR_DIVIDE] = PyNumber_InPlaceFloorDivide,
958-
[NB_INPLACE_LSHIFT] = PyNumber_InPlaceLshift,
959-
[NB_INPLACE_MATRIX_MULTIPLY] = PyNumber_InPlaceMatrixMultiply,
960-
[NB_INPLACE_MULTIPLY] = PyNumber_InPlaceMultiply,
961-
[NB_INPLACE_REMAINDER] = PyNumber_InPlaceRemainder,
962-
[NB_INPLACE_OR] = PyNumber_InPlaceOr,
963-
[NB_INPLACE_POWER] = _PyNumber_InPlacePowerNoMod,
964-
[NB_INPLACE_RSHIFT] = PyNumber_InPlaceRshift,
965-
[NB_INPLACE_SUBTRACT] = PyNumber_InPlaceSubtract,
966-
[NB_INPLACE_TRUE_DIVIDE] = PyNumber_InPlaceTrueDivide,
967-
[NB_INPLACE_XOR] = PyNumber_InPlaceXor,
968-
[NB_SUBSCR] = PyObject_GetItem,
969-
};
970-
const conversion_func _PyEval_ConversionFuncs[4] = {
971-
[FVC_STR] = PyObject_Str,
972-
[FVC_REPR] = PyObject_Repr,
973-
[FVC_ASCII] = PyObject_ASCII
974-
};
975940
static void
976941
clear_thread_frame(PyThreadState *tstate, _PyInterpreterFrame * frame)
977942
{
@@ -1105,6 +1070,8 @@ _PyEvalFramePushAndInit_Ex(PyThreadState *tstate, _PyStackRef func,
11051070
return NULL;
11061071
}
11071072

1073+
#ifdef ENABLE_JIT_GENERATORS
1074+
11081075
// Cinder specific adapted functions
11091076
static PyObject *
11101077
Ci_PyEval_GetANext(PyObject *aiter)
@@ -1171,6 +1138,13 @@ Ci_PyEval_GetAwaitable(PyObject *iterable, int oparg)
11711138
return iter;
11721139
}
11731140

1141+
#else
1142+
1143+
#define Ci_PyEval_GetANext _PyEval_GetANext
1144+
#define Ci_PyEval_GetAwaitable _PyEval_GetAwaitable
1145+
1146+
#endif
1147+
11741148
#if Py_TAIL_CALL_INTERP
11751149
#include "cinderx/Interpreter/cinderx_opcode_targets.h"
11761150
#include "cinderx/Interpreter/3.14/Includes/generated_cases.c.h"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
cd "$(dirname "$(readlink -f "$0")")"/../ || exit
6+
7+
Internal/regen-cached-borrow-files.sh
8+
if [ -n "$(sl st)" ]; then
9+
sl diff
10+
echo "Need to re-run fbcode/cinderx/Internal/regen-cached-borrow-files.sh"
11+
exit 1
12+
else
13+
exit 0
14+
fi

0 commit comments

Comments
 (0)