summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 13947849..182c9cf 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -3405,7 +3405,7 @@
}
OPCODE_DEFERRED_INC(CONTAINS_OP);
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
- #endif /* ENABLE_SPECIALIZATION */
+ #endif /* ENABLE_SPECIALIZATION_FT */
}
// _CONTAINS_OP
{
@@ -7994,7 +7994,7 @@
seq = stack_pointer[-1];
uint16_t counter = read_u16(&this_instr[1].cache);
(void)counter;
- #if ENABLE_SPECIALIZATION
+ #if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_PyFrame_SetStackPointer(frame, stack_pointer);
@@ -8004,7 +8004,7 @@
}
OPCODE_DEFERRED_INC(UNPACK_SEQUENCE);
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
- #endif /* ENABLE_SPECIALIZATION */
+ #endif /* ENABLE_SPECIALIZATION_FT */
(void)seq;
(void)counter;
}
@@ -8035,12 +8035,30 @@
values = &stack_pointer[-1];
PyObject *seq_o = PyStackRef_AsPyObjectBorrow(seq);
DEOPT_IF(!PyList_CheckExact(seq_o), UNPACK_SEQUENCE);
- DEOPT_IF(PyList_GET_SIZE(seq_o) != oparg, UNPACK_SEQUENCE);
+ #ifdef Py_GIL_DISABLED
+ PyCriticalSection cs;
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyCriticalSection_Begin(&cs, seq_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ #endif
+ if (PyList_GET_SIZE(seq_o) != oparg) {
+ #ifdef Py_GIL_DISABLED
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyCriticalSection_End(&cs);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ #endif
+ DEOPT_IF(true, UNPACK_SEQUENCE);
+ }
STAT_INC(UNPACK_SEQUENCE, hit);
PyObject **items = _PyList_ITEMS(seq_o);
for (int i = oparg; --i >= 0; ) {
*values++ = PyStackRef_FromPyObjectNew(items[i]);
}
+ #ifdef Py_GIL_DISABLED
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyCriticalSection_End(&cs);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ #endif
PyStackRef_CLOSE(seq);
stack_pointer += -1 + oparg;
assert(WITHIN_STACK_BOUNDS());