/* OpCode prediction macros
Some opcodes tend to come in pairs thus making it possible to
predict the second code when the first is run. For example,
- COMPARE_OP is often followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And,
- those opcodes are often followed by a POP_TOP.
+ COMPARE_OP is often followed by POP_JUMP_IF_FALSE or POP_JUMP_IF_TRUE.
Verifying the prediction costs a single high-speed test of a register
variable against a constant. If the pairing was good, then the
FAST_DISPATCH();
}
+ PREDICTED(LOAD_CONST);
TARGET(LOAD_CONST) {
PyObject *value = GETITEM(consts, oparg);
Py_INCREF(value);
}
SET_TOP(awaitable);
+ PREDICT(LOAD_CONST);
DISPATCH();
}
Py_DECREF(next_iter);
PUSH(awaitable);
+ PREDICT(LOAD_CONST);
DISPATCH();
}
+ PREDICTED(GET_AWAITABLE);
TARGET(GET_AWAITABLE) {
PyObject *iterable = TOP();
PyObject *iter = _PyCoro_GetAwaitableIter(iterable);
goto error;
}
+ PREDICT(LOAD_CONST);
DISPATCH();
}
DISPATCH();
}
+ PREDICTED(POP_BLOCK);
TARGET(POP_BLOCK) {
PyTryBlock *b = PyFrame_BlockPop(f);
UNWIND_BLOCK(b);
if (iter == NULL)
goto error;
PREDICT(FOR_ITER);
+ PREDICT(CALL_FUNCTION);
DISPATCH();
}
if (iter == NULL)
goto error;
}
+ PREDICT(LOAD_CONST);
DISPATCH();
}
STACKADJ(-1);
Py_DECREF(iter);
JUMPBY(oparg);
+ PREDICT(POP_BLOCK);
DISPATCH();
}
if (res == NULL)
goto error;
PUSH(res);
+ PREDICT(GET_AWAITABLE);
DISPATCH();
}
DISPATCH();
}
+ PREDICTED(CALL_FUNCTION);
TARGET(CALL_FUNCTION) {
PyObject **sp, *res;
PCALL(PCALL_ALL);