Use fast_next_opcode shortcut for forward jump opcodes (it's safe and

gives a small speedup).
This commit is contained in:
Neil Schemenauer 2003-06-01 19:21:12 +00:00
parent 5ddef75fcf
commit c4b570f218

View file

@ -2001,18 +2001,18 @@ eval_frame(PyFrameObject *f)
case JUMP_FORWARD: case JUMP_FORWARD:
JUMPBY(oparg); JUMPBY(oparg);
continue; goto fast_next_opcode;
PREDICTED_WITH_ARG(JUMP_IF_FALSE); PREDICTED_WITH_ARG(JUMP_IF_FALSE);
case JUMP_IF_FALSE: case JUMP_IF_FALSE:
w = TOP(); w = TOP();
if (w == Py_True) { if (w == Py_True) {
PREDICT(POP_TOP); PREDICT(POP_TOP);
continue; goto fast_next_opcode;
} }
if (w == Py_False) { if (w == Py_False) {
JUMPBY(oparg); JUMPBY(oparg);
continue; goto fast_next_opcode;
} }
err = PyObject_IsTrue(w); err = PyObject_IsTrue(w);
if (err > 0) if (err > 0)
@ -2028,11 +2028,11 @@ eval_frame(PyFrameObject *f)
w = TOP(); w = TOP();
if (w == Py_False) { if (w == Py_False) {
PREDICT(POP_TOP); PREDICT(POP_TOP);
continue; goto fast_next_opcode;
} }
if (w == Py_True) { if (w == Py_True) {
JUMPBY(oparg); JUMPBY(oparg);
continue; goto fast_next_opcode;
} }
err = PyObject_IsTrue(w); err = PyObject_IsTrue(w);
if (err > 0) { if (err > 0) {