Is there a limit to the size of a Python module?
It seems to me that the Python bytecode instruction POP_JUMP_IF_FALSE
takes a 1-byte operand, telling it the instruction index to jump to.
Quoting some of the relevant CPython code from ceval.c
(comment mine):
case TARGET(POP_JUMP_IF_FALSE): {
PREDICTED(POP_JUMP_IF_FALSE);
PyObject *cond = POP();
int err;
if (cond == Py_True) {
Py_DECREF(cond);
FAST_DISPATCH();
}
if (cond == Py_False) {
Py_DECREF(cond);
JUMPTO(oparg); # <--- this
FAST_DISPATCH();
}
Does this mean a Python module cannot contain more than 255 bytecode instructions? What am I missing here?