FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-131498: Cases generator: Parse down to C statement level. by markshannon · Pull Request #131948 · python/cpython · GitHub

Repository navigation

Merged
9 changes: 0 additions & 9 deletions Lib/test/test_generated_cases.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ def test_error_if_plain_with_comment(self):
if (cond) {
JUMP_TO_LABEL(label);
}
// Comment is ok
DISPATCH();
}
"""
Expand Down Expand Up @@ -586,7 +585,6 @@ def test_suppress_dispatch(self):

LABEL(somewhere)
{

}
"""
self.run_cases_test(input, output)
Expand Down Expand Up @@ -1351,7 +1349,6 @@ def test_pop_on_error_peeks(self):
}
// THIRD
{
// Mark j and k as used
if (cond) {
JUMP_TO_LABEL(pop_2_error);
}
Expand Down Expand Up @@ -1757,17 +1754,14 @@ def test_complex_label(self):
output = """
LABEL(other_label)
{

}

LABEL(other_label2)
{

}

LABEL(my_label)
{
// Comment
_PyFrame_SetStackPointer(frame, stack_pointer);
do_thing();
stack_pointer = _PyFrame_GetStackPointer(frame);
Expand Down Expand Up @@ -1795,7 +1789,6 @@ def test_spilled_label(self):
output = """
LABEL(one)
{
/* STACK SPILLED */
stack_pointer = _PyFrame_GetStackPointer(frame);
JUMP_TO_LABEL(two);
}
Expand Down Expand Up @@ -1851,7 +1844,6 @@ def test_multiple_labels(self):
output = """
LABEL(my_label_1)
{
// Comment
_PyFrame_SetStackPointer(frame, stack_pointer);
do_thing1();
stack_pointer = _PyFrame_GetStackPointer(frame);
Expand All @@ -1860,7 +1852,6 @@ def test_multiple_labels(self):

LABEL(my_label_2)
{
// Comment
_PyFrame_SetStackPointer(frame, stack_pointer);
do_thing2();
stack_pointer = _PyFrame_GetStackPointer(frame);
Expand Down
8 changes: 5 additions & 3 deletions Python/bytecodes.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ dummy_func(
op(_CHECK_PERIODIC_IF_NOT_YIELD_FROM, (--)) {
if ((oparg & RESUME_OPARG_LOCATION_MASK) < RESUME_AFTER_YIELD_FROM) {
_Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY();
QSBR_QUIESCENT_STATE(tstate); \
QSBR_QUIESCENT_STATE(tstate);
if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) {
int err = _Py_HandlePending(tstate);
ERROR_IF(err != 0, error);
Expand Down Expand Up @@ -2245,7 +2245,8 @@ dummy_func(
PyObject *attr_o = FT_ATOMIC_LOAD_PTR_ACQUIRE(*value_ptr);
DEOPT_IF(attr_o == NULL);
#ifdef Py_GIL_DISABLED
if (!_Py_TryIncrefCompareStackRef(value_ptr, attr_o, &attr)) {
int increfed = _Py_TryIncrefCompareStackRef(value_ptr, attr_o, &attr);
if (!increfed) {
DEOPT_IF(true);
}
#else
Expand Down Expand Up @@ -2322,7 +2323,8 @@ dummy_func(
}
STAT_INC(LOAD_ATTR, hit);
#ifdef Py_GIL_DISABLED
if (!_Py_TryIncrefCompareStackRef(&ep->me_value, attr_o, &attr)) {
int increfed = _Py_TryIncrefCompareStackRef(&ep->me_value, attr_o, &attr);
if (!increfed) {
DEOPT_IF(true);
}
#else
Expand Down
Loading

Back | FazBrowse Home | New Git URL