Lines Matching defs:consts
7844 PyObject *consts, *k, *v;
7847 consts = PyList_New(size); /* PyCode_Optimize() requires a list */
7848 if (consts == NULL)
7861 PyList_SET_ITEM(consts, i, k);
7863 return consts;
7985 PyObject *consts = NULL;
8002 consts = PyList_AsTuple(constslist); /* PyCode_New requires a tuple */
8003 if (consts == NULL) {
8006 if (!merge_const_one(c, &consts)) {
8038 .consts = consts,
8069 Py_XDECREF(consts);
8115 optimize_cfg(struct compiler *c, struct assembler *a, PyObject *consts);
8118 trim_unused_consts(struct compiler *c, struct assembler *a, PyObject *consts);
8352 PyObject *consts = NULL;
8425 consts = consts_dict_keys_inorder(c->u->u_consts);
8426 if (consts == NULL) {
8430 if (optimize_cfg(c, &a, consts)) {
8436 if (trim_unused_consts(c, &a, consts)) {
8500 co = makecode(c, &a, consts, maxdepth, nlocalsplus);
8502 Py_XDECREF(consts);
8530 The consts table must still be in list form so that the
8537 int n, PyObject *consts)
8540 assert(PyList_CheckExact(consts));
8558 PyObject *constant = get_const_value(op, arg, consts);
8570 for (index = 0; index < PyList_GET_SIZE(consts); index++) {
8571 if (PyList_GET_ITEM(consts, index) == newconst) {
8575 if (index == PyList_GET_SIZE(consts)) {
8581 if (PyList_Append(consts, newconst)) {
8807 optimize_basic_block(struct compiler *c, basicblock *bb, PyObject *consts)
8809 assert(PyList_CheckExact(consts));
8839 cnt = get_const_value(inst->i_opcode, oparg, consts);
8860 cnt = get_const_value(inst->i_opcode, oparg, consts);
8880 cnt = get_const_value(inst->i_opcode, oparg, consts);
8917 if (fold_tuple_on_constants(c, inst-oparg, oparg, consts)) {
9287 The consts object should still be in list form to allow new constants
9296 optimize_cfg(struct compiler *c, struct assembler *a, PyObject *consts)
9299 if (optimize_basic_block(c, b, consts)) {
9353 trim_unused_consts(struct compiler *c, struct assembler *a, PyObject *consts)
9355 assert(PyList_CheckExact(consts));
9368 if (max_const_index+1 < PyList_GET_SIZE(consts)) {
9369 //fprintf(stderr, "removing trailing consts: max=%d, size=%d\n",
9370 // max_const_index, (int)PyList_GET_SIZE(consts));
9371 if (PyList_SetSlice(consts, max_const_index+1,
9372 PyList_GET_SIZE(consts), NULL) < 0) {
9447 PyCode_Optimize(PyObject *code, PyObject* Py_UNUSED(consts),