TARGET(BINARY_SUBSCR_GETITEM) {
PyObject *sub = PEEK(1);
PyObject *container = PEEK(2);
- uint32_t type_version = read_u32(next_instr + 1);
- uint16_t func_version = read_u16(next_instr + 3);
+ uint32_t type_version = read_u32(&next_instr[1].cache);
+ uint16_t func_version = read_u16(&next_instr[3].cache);
PyTypeObject *tp = Py_TYPE(container);
DEOPT_IF(tp->tp_version_tag != type_version, BINARY_SUBSCR);
assert(tp->tp_flags & Py_TPFLAGS_HEAPTYPE);
PyObject *sub = PEEK(1);
PyObject *container = PEEK(2);
PyObject *v = PEEK(3);
- uint16_t counter = read_u16(next_instr + 0);
+ uint16_t counter = read_u16(&next_instr[0].cache);
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
assert(cframe.use_tracing == 0);
next_instr--;
PREDICTED(STORE_ATTR);
PyObject *owner = PEEK(1);
PyObject *v = PEEK(2);
- uint16_t counter = read_u16(next_instr + 0);
+ uint16_t counter = read_u16(&next_instr[0].cache);
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
assert(cframe.use_tracing == 0);
PyObject *name = GETITEM(names, oparg);
TARGET(STORE_ATTR_INSTANCE_VALUE) {
PyObject *owner = PEEK(1);
PyObject *value = PEEK(2);
- uint32_t type_version = read_u32(next_instr + 1);
- uint16_t index = read_u16(next_instr + 3);
+ uint32_t type_version = read_u32(&next_instr[1].cache);
+ uint16_t index = read_u16(&next_instr[3].cache);
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
TARGET(STORE_ATTR_WITH_HINT) {
PyObject *owner = PEEK(1);
PyObject *value = PEEK(2);
- uint32_t type_version = read_u32(next_instr + 1);
- uint16_t hint = read_u16(next_instr + 3);
+ uint32_t type_version = read_u32(&next_instr[1].cache);
+ uint16_t hint = read_u16(&next_instr[3].cache);
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
TARGET(STORE_ATTR_SLOT) {
PyObject *owner = PEEK(1);
PyObject *value = PEEK(2);
- uint32_t type_version = read_u32(next_instr + 1);
- uint16_t index = read_u16(next_instr + 3);
+ uint32_t type_version = read_u32(&next_instr[1].cache);
+ uint16_t index = read_u16(&next_instr[3].cache);
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
PyObject *right = _tmp_1;
PyObject *left = _tmp_2;
size_t jump;
- uint16_t when_to_jump_mask = read_u16(next_instr + 1);
+ uint16_t when_to_jump_mask = read_u16(&next_instr[1].cache);
assert(cframe.use_tracing == 0);
// Combined: COMPARE_OP (float ? float) + POP_JUMP_IF_(true/false)
DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_OP);
PyObject *right = _tmp_1;
PyObject *left = _tmp_2;
size_t jump;
- uint16_t when_to_jump_mask = read_u16(next_instr + 1);
+ uint16_t when_to_jump_mask = read_u16(&next_instr[1].cache);
assert(cframe.use_tracing == 0);
// Combined: COMPARE_OP (int ? int) + POP_JUMP_IF_(true/false)
DEOPT_IF(!PyLong_CheckExact(left), COMPARE_OP);
PyObject *right = _tmp_1;
PyObject *left = _tmp_2;
size_t jump;
- uint16_t invert = read_u16(next_instr + 1);
+ uint16_t invert = read_u16(&next_instr[1].cache);
assert(cframe.use_tracing == 0);
// Combined: COMPARE_OP (str == str or str != str) + POP_JUMP_IF_(true/false)
DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_OP);
int opcode = _PyOpcode_Deopt[_Py_OPCODE(instructions[i])];
int caches = _PyOpcode_Caches[opcode];
if (caches) {
- instructions[i + 1] = adaptive_counter_warmup();
+ instructions[i + 1].cache = adaptive_counter_warmup();
previous_opcode = 0;
i += caches;
continue;
}
switch (previous_opcode << 8 | opcode) {
case LOAD_CONST << 8 | LOAD_FAST:
- _Py_SET_OPCODE(instructions[i - 1], LOAD_CONST__LOAD_FAST);
+ instructions[i - 1].opcode = LOAD_CONST__LOAD_FAST;
break;
case LOAD_FAST << 8 | LOAD_CONST:
- _Py_SET_OPCODE(instructions[i - 1], LOAD_FAST__LOAD_CONST);
+ instructions[i - 1].opcode = LOAD_FAST__LOAD_CONST;
break;
case LOAD_FAST << 8 | LOAD_FAST:
- _Py_SET_OPCODE(instructions[i - 1], LOAD_FAST__LOAD_FAST);
+ instructions[i - 1].opcode = LOAD_FAST__LOAD_FAST;
break;
case STORE_FAST << 8 | LOAD_FAST:
- _Py_SET_OPCODE(instructions[i - 1], STORE_FAST__LOAD_FAST);
+ instructions[i - 1].opcode = STORE_FAST__LOAD_FAST;
break;
case STORE_FAST << 8 | STORE_FAST:
- _Py_SET_OPCODE(instructions[i - 1], STORE_FAST__STORE_FAST);
+ instructions[i - 1].opcode = STORE_FAST__STORE_FAST;
break;
}
previous_opcode = opcode;
}
write_u32(cache->version, keys_version);
cache->index = (uint16_t)index;
- _Py_SET_OPCODE(*instr, opcode_module);
+ _py_set_opocde(instr, opcode_module);
return 0;
}
}
write_u32(cache->version, type->tp_version_tag);
cache->index = (uint16_t)index;
- _Py_SET_OPCODE(*instr, values_op);
+ _py_set_opocde(instr, values_op);
}
else {
PyDictObject *dict = (PyDictObject *)_PyDictOrValues_GetDict(dorv);
}
cache->index = (uint16_t)index;
write_u32(cache->version, type->tp_version_tag);
- _Py_SET_OPCODE(*instr, hint_op);
+ _py_set_opocde(instr, hint_op);
}
return 1;
}
write_u32(lm_cache->type_version, type->tp_version_tag);
/* borrowed */
write_obj(lm_cache->descr, fget);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_PROPERTY);
+ _py_set_opocde(instr, LOAD_ATTR_PROPERTY);
goto success;
}
case OBJECT_SLOT:
assert(offset > 0);
cache->index = (uint16_t)offset;
write_u32(cache->version, type->tp_version_tag);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_SLOT);
+ _py_set_opocde(instr, LOAD_ATTR_SLOT);
goto success;
}
case DUNDER_CLASS:
assert(offset == (uint16_t)offset);
cache->index = (uint16_t)offset;
write_u32(cache->version, type->tp_version_tag);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_SLOT);
+ _py_set_opocde(instr, LOAD_ATTR_SLOT);
goto success;
}
case OTHER_SLOT:
/* borrowed */
write_obj(lm_cache->descr, descr);
write_u32(lm_cache->type_version, type->tp_version_tag);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN);
+ _py_set_opocde(instr, LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN);
goto success;
}
case BUILTIN_CLASSMETHOD:
fail:
STAT_INC(LOAD_ATTR, failure);
assert(!PyErr_Occurred());
- _Py_SET_OPCODE(*instr, LOAD_ATTR);
+ _py_set_opocde(instr, LOAD_ATTR);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
assert(offset > 0);
cache->index = (uint16_t)offset;
write_u32(cache->version, type->tp_version_tag);
- _Py_SET_OPCODE(*instr, STORE_ATTR_SLOT);
+ _py_set_opocde(instr, STORE_ATTR_SLOT);
goto success;
}
case DUNDER_CLASS:
fail:
STAT_INC(STORE_ATTR, failure);
assert(!PyErr_Occurred());
- _Py_SET_OPCODE(*instr, STORE_ATTR);
+ _py_set_opocde(instr, STORE_ATTR);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
case NON_DESCRIPTOR:
write_u32(cache->type_version, ((PyTypeObject *)owner)->tp_version_tag);
write_obj(cache->descr, descr);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_CLASS);
+ _py_set_opocde(instr, LOAD_ATTR_CLASS);
return 0;
#ifdef Py_STATS
case ABSENT:
}
switch(dictkind) {
case NO_DICT:
- _Py_SET_OPCODE(*instr, LOAD_ATTR_METHOD_NO_DICT);
+ _py_set_opocde(instr, LOAD_ATTR_METHOD_NO_DICT);
break;
case MANAGED_VALUES:
- _Py_SET_OPCODE(*instr, LOAD_ATTR_METHOD_WITH_VALUES);
+ _py_set_opocde(instr, LOAD_ATTR_METHOD_WITH_VALUES);
break;
case MANAGED_DICT:
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_HAS_MANAGED_DICT);
goto fail;
case OFFSET_DICT:
assert(owner_cls->tp_dictoffset > 0 && owner_cls->tp_dictoffset <= INT16_MAX);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_METHOD_WITH_DICT);
+ _py_set_opocde(instr, LOAD_ATTR_METHOD_WITH_DICT);
break;
case LAZY_DICT:
assert(owner_cls->tp_dictoffset > 0 && owner_cls->tp_dictoffset <= INT16_MAX);
- _Py_SET_OPCODE(*instr, LOAD_ATTR_METHOD_LAZY_DICT);
+ _py_set_opocde(instr, LOAD_ATTR_METHOD_LAZY_DICT);
break;
}
/* `descr` is borrowed. This is safe for methods (even inherited ones from
}
cache->index = (uint16_t)index;
write_u32(cache->module_keys_version, keys_version);
- _Py_SET_OPCODE(*instr, LOAD_GLOBAL_MODULE);
+ _py_set_opocde(instr, LOAD_GLOBAL_MODULE);
goto success;
}
if (!PyDict_CheckExact(builtins)) {
cache->index = (uint16_t)index;
write_u32(cache->module_keys_version, globals_version);
cache->builtin_keys_version = (uint16_t)builtins_version;
- _Py_SET_OPCODE(*instr, LOAD_GLOBAL_BUILTIN);
+ _py_set_opocde(instr, LOAD_GLOBAL_BUILTIN);
goto success;
fail:
STAT_INC(LOAD_GLOBAL, failure);
assert(!PyErr_Occurred());
- _Py_SET_OPCODE(*instr, LOAD_GLOBAL);
+ _py_set_opocde(instr, LOAD_GLOBAL);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
PyTypeObject *container_type = Py_TYPE(container);
if (container_type == &PyList_Type) {
if (PyLong_CheckExact(sub)) {
- _Py_SET_OPCODE(*instr, BINARY_SUBSCR_LIST_INT);
+ _py_set_opocde(instr, BINARY_SUBSCR_LIST_INT);
goto success;
}
SPECIALIZATION_FAIL(BINARY_SUBSCR,
}
if (container_type == &PyTuple_Type) {
if (PyLong_CheckExact(sub)) {
- _Py_SET_OPCODE(*instr, BINARY_SUBSCR_TUPLE_INT);
+ _py_set_opocde(instr, BINARY_SUBSCR_TUPLE_INT);
goto success;
}
SPECIALIZATION_FAIL(BINARY_SUBSCR,
goto fail;
}
if (container_type == &PyDict_Type) {
- _Py_SET_OPCODE(*instr, BINARY_SUBSCR_DICT);
+ _py_set_opocde(instr, BINARY_SUBSCR_DICT);
goto success;
}
PyTypeObject *cls = Py_TYPE(container);
}
cache->func_version = version;
((PyHeapTypeObject *)container_type)->_spec_cache.getitem = descriptor;
- _Py_SET_OPCODE(*instr, BINARY_SUBSCR_GETITEM);
+ _py_set_opocde(instr, BINARY_SUBSCR_GETITEM);
goto success;
}
SPECIALIZATION_FAIL(BINARY_SUBSCR,
fail:
STAT_INC(BINARY_SUBSCR, failure);
assert(!PyErr_Occurred());
- _Py_SET_OPCODE(*instr, BINARY_SUBSCR);
+ _py_set_opocde(instr, BINARY_SUBSCR);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
if ((Py_SIZE(sub) == 0 || Py_SIZE(sub) == 1)
&& ((PyLongObject *)sub)->ob_digit[0] < (size_t)PyList_GET_SIZE(container))
{
- _Py_SET_OPCODE(*instr, STORE_SUBSCR_LIST_INT);
+ _py_set_opocde(instr, STORE_SUBSCR_LIST_INT);
goto success;
}
else {
}
}
if (container_type == &PyDict_Type) {
- _Py_SET_OPCODE(*instr, STORE_SUBSCR_DICT);
+ _py_set_opocde(instr, STORE_SUBSCR_DICT);
goto success;
}
#ifdef Py_STATS
fail:
STAT_INC(STORE_SUBSCR, failure);
assert(!PyErr_Occurred());
- _Py_SET_OPCODE(*instr, STORE_SUBSCR);
+ _py_set_opocde(instr, STORE_SUBSCR);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
int oparg = _Py_OPARG(*instr);
if (nargs == 1 && kwnames == NULL && oparg == 1) {
if (tp == &PyUnicode_Type) {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_STR_1);
+ _py_set_opocde(instr, CALL_NO_KW_STR_1);
return 0;
}
else if (tp == &PyType_Type) {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_TYPE_1);
+ _py_set_opocde(instr, CALL_NO_KW_TYPE_1);
return 0;
}
else if (tp == &PyTuple_Type) {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_TUPLE_1);
+ _py_set_opocde(instr, CALL_NO_KW_TUPLE_1);
return 0;
}
}
if (tp->tp_vectorcall != NULL) {
- _Py_SET_OPCODE(*instr, CALL_BUILTIN_CLASS);
+ _py_set_opocde(instr, CALL_BUILTIN_CLASS);
return 0;
}
SPECIALIZATION_FAIL(CALL, tp == &PyUnicode_Type ?
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_WRONG_NUMBER_ARGUMENTS);
return -1;
}
- _Py_SET_OPCODE(*instr, CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS);
+ _py_set_opocde(instr, CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS);
return 0;
}
case METH_O: {
bool pop = (_Py_OPCODE(next) == POP_TOP);
int oparg = _Py_OPARG(*instr);
if ((PyObject *)descr == list_append && oparg == 1 && pop) {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_LIST_APPEND);
+ _py_set_opocde(instr, CALL_NO_KW_LIST_APPEND);
return 0;
}
- _Py_SET_OPCODE(*instr, CALL_NO_KW_METHOD_DESCRIPTOR_O);
+ _py_set_opocde(instr, CALL_NO_KW_METHOD_DESCRIPTOR_O);
return 0;
}
case METH_FASTCALL: {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_METHOD_DESCRIPTOR_FAST);
+ _py_set_opocde(instr, CALL_NO_KW_METHOD_DESCRIPTOR_FAST);
return 0;
}
case METH_FASTCALL|METH_KEYWORDS: {
- _Py_SET_OPCODE(*instr, CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS);
+ _py_set_opocde(instr, CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS);
return 0;
}
}
write_u32(cache->func_version, version);
cache->min_args = min_args;
if (argcount == nargs) {
- _Py_SET_OPCODE(*instr, bound_method ? CALL_BOUND_METHOD_EXACT_ARGS : CALL_PY_EXACT_ARGS);
+ _py_set_opocde(instr, bound_method ? CALL_BOUND_METHOD_EXACT_ARGS : CALL_PY_EXACT_ARGS);
}
else if (bound_method) {
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_BOUND_METHOD);
return -1;
}
else {
- _Py_SET_OPCODE(*instr, CALL_PY_WITH_DEFAULTS);
+ _py_set_opocde(instr, CALL_PY_WITH_DEFAULTS);
}
return 0;
}
/* len(o) */
PyInterpreterState *interp = _PyInterpreterState_GET();
if (callable == interp->callable_cache.len) {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_LEN);
+ _py_set_opocde(instr, CALL_NO_KW_LEN);
return 0;
}
- _Py_SET_OPCODE(*instr, CALL_NO_KW_BUILTIN_O);
+ _py_set_opocde(instr, CALL_NO_KW_BUILTIN_O);
return 0;
}
case METH_FASTCALL: {
/* isinstance(o1, o2) */
PyInterpreterState *interp = _PyInterpreterState_GET();
if (callable == interp->callable_cache.isinstance) {
- _Py_SET_OPCODE(*instr, CALL_NO_KW_ISINSTANCE);
+ _py_set_opocde(instr, CALL_NO_KW_ISINSTANCE);
return 0;
}
}
- _Py_SET_OPCODE(*instr, CALL_NO_KW_BUILTIN_FAST);
+ _py_set_opocde(instr, CALL_NO_KW_BUILTIN_FAST);
return 0;
}
case METH_FASTCALL | METH_KEYWORDS: {
- _Py_SET_OPCODE(*instr, CALL_BUILTIN_FAST_WITH_KEYWORDS);
+ _py_set_opocde(instr, CALL_BUILTIN_FAST_WITH_KEYWORDS);
return 0;
}
default:
if (fail) {
STAT_INC(CALL, failure);
assert(!PyErr_Occurred());
- _Py_SET_OPCODE(*instr, CALL);
+ _py_set_opocde(instr, CALL);
cache->counter = adaptive_counter_backoff(cache->counter);
}
else {
bool to_store = (_Py_OPCODE(next) == STORE_FAST ||
_Py_OPCODE(next) == STORE_FAST__LOAD_FAST);
if (to_store && locals[_Py_OPARG(next)] == lhs) {
- _Py_SET_OPCODE(*instr, BINARY_OP_INPLACE_ADD_UNICODE);
+ _py_set_opocde(instr, BINARY_OP_INPLACE_ADD_UNICODE);
goto success;
}
- _Py_SET_OPCODE(*instr, BINARY_OP_ADD_UNICODE);
+ _py_set_opocde(instr, BINARY_OP_ADD_UNICODE);
goto success;
}
if (PyLong_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, BINARY_OP_ADD_INT);
+ _py_set_opocde(instr, BINARY_OP_ADD_INT);
goto success;
}
if (PyFloat_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, BINARY_OP_ADD_FLOAT);
+ _py_set_opocde(instr, BINARY_OP_ADD_FLOAT);
goto success;
}
break;
break;
}
if (PyLong_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, BINARY_OP_MULTIPLY_INT);
+ _py_set_opocde(instr, BINARY_OP_MULTIPLY_INT);
goto success;
}
if (PyFloat_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, BINARY_OP_MULTIPLY_FLOAT);
+ _py_set_opocde(instr, BINARY_OP_MULTIPLY_FLOAT);
goto success;
}
break;
break;
}
if (PyLong_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, BINARY_OP_SUBTRACT_INT);
+ _py_set_opocde(instr, BINARY_OP_SUBTRACT_INT);
goto success;
}
if (PyFloat_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, BINARY_OP_SUBTRACT_FLOAT);
+ _py_set_opocde(instr, BINARY_OP_SUBTRACT_FLOAT);
goto success;
}
break;
}
SPECIALIZATION_FAIL(BINARY_OP, binary_op_fail_kind(oparg, lhs, rhs));
STAT_INC(BINARY_OP, failure);
- _Py_SET_OPCODE(*instr, BINARY_OP);
+ _py_set_opocde(instr, BINARY_OP);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
goto failure;
}
if (PyFloat_CheckExact(lhs)) {
- _Py_SET_OPCODE(*instr, COMPARE_OP_FLOAT_JUMP);
+ _py_set_opocde(instr, COMPARE_OP_FLOAT_JUMP);
cache->mask = when_to_jump_mask;
goto success;
}
if (PyLong_CheckExact(lhs)) {
if (Py_ABS(Py_SIZE(lhs)) <= 1 && Py_ABS(Py_SIZE(rhs)) <= 1) {
- _Py_SET_OPCODE(*instr, COMPARE_OP_INT_JUMP);
+ _py_set_opocde(instr, COMPARE_OP_INT_JUMP);
cache->mask = when_to_jump_mask;
goto success;
}
goto failure;
}
else {
- _Py_SET_OPCODE(*instr, COMPARE_OP_STR_JUMP);
+ _py_set_opocde(instr, COMPARE_OP_STR_JUMP);
cache->mask = (when_to_jump_mask & 2) == 0;
goto success;
}
SPECIALIZATION_FAIL(COMPARE_OP, compare_op_fail_kind(lhs, rhs));
failure:
STAT_INC(COMPARE_OP, failure);
- _Py_SET_OPCODE(*instr, COMPARE_OP);
+ _py_set_opocde(instr, COMPARE_OP);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
goto failure;
}
if (PyTuple_GET_SIZE(seq) == 2) {
- _Py_SET_OPCODE(*instr, UNPACK_SEQUENCE_TWO_TUPLE);
+ _py_set_opocde(instr, UNPACK_SEQUENCE_TWO_TUPLE);
goto success;
}
- _Py_SET_OPCODE(*instr, UNPACK_SEQUENCE_TUPLE);
+ _py_set_opocde(instr, UNPACK_SEQUENCE_TUPLE);
goto success;
}
if (PyList_CheckExact(seq)) {
SPECIALIZATION_FAIL(UNPACK_SEQUENCE, SPEC_FAIL_EXPECTED_ERROR);
goto failure;
}
- _Py_SET_OPCODE(*instr, UNPACK_SEQUENCE_LIST);
+ _py_set_opocde(instr, UNPACK_SEQUENCE_LIST);
goto success;
}
SPECIALIZATION_FAIL(UNPACK_SEQUENCE, unpack_sequence_fail_kind(seq));
failure:
STAT_INC(UNPACK_SEQUENCE, failure);
- _Py_SET_OPCODE(*instr, UNPACK_SEQUENCE);
+ _py_set_opocde(instr, UNPACK_SEQUENCE);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success:
_Py_CODEUNIT next = instr[1+INLINE_CACHE_ENTRIES_FOR_ITER];
int next_op = _PyOpcode_Deopt[_Py_OPCODE(next)];
if (tp == &PyListIter_Type) {
- _Py_SET_OPCODE(*instr, FOR_ITER_LIST);
+ _py_set_opocde(instr, FOR_ITER_LIST);
goto success;
}
else if (tp == &PyTupleIter_Type) {
- _Py_SET_OPCODE(*instr, FOR_ITER_TUPLE);
+ _py_set_opocde(instr, FOR_ITER_TUPLE);
goto success;
}
else if (tp == &PyRangeIter_Type && next_op == STORE_FAST) {
- _Py_SET_OPCODE(*instr, FOR_ITER_RANGE);
+ _py_set_opocde(instr, FOR_ITER_RANGE);
goto success;
}
else if (tp == &PyGen_Type && oparg <= SHRT_MAX) {
assert(_Py_OPCODE(instr[oparg + INLINE_CACHE_ENTRIES_FOR_ITER + 1]) == END_FOR);
- _Py_SET_OPCODE(*instr, FOR_ITER_GEN);
+ _py_set_opocde(instr, FOR_ITER_GEN);
goto success;
}
SPECIALIZATION_FAIL(FOR_ITER,
_PySpecialization_ClassifyIterator(iter));
STAT_INC(FOR_ITER, failure);
- _Py_SET_OPCODE(*instr, FOR_ITER);
+ _py_set_opocde(instr, FOR_ITER);
cache->counter = adaptive_counter_backoff(cache->counter);
return;
success: