Skip to content

Commit

Permalink
GH-111485: Make BEFORE_WITH a uop (GH-111812)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored Nov 7, 2023
1 parent d4426e8 commit 3e99c9c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 7 deletions.
1 change: 1 addition & 0 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Python/abstract_interp_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2765,7 +2765,7 @@ dummy_func(
GOTO_ERROR(error);
}
DECREF_INPUTS();
res = _PyObject_CallNoArgs(enter);
res = _PyObject_CallNoArgsTstate(tstate, enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
Expand All @@ -2774,7 +2774,6 @@ dummy_func(
}

inst(BEFORE_WITH, (mgr -- exit, res)) {
TIER_ONE_ONLY
/* pop the context manager, push its __exit__ and the
* value returned from calling its __enter__
*/
Expand All @@ -2801,7 +2800,7 @@ dummy_func(
GOTO_ERROR(error);
}
DECREF_INPUTS();
res = _PyObject_CallNoArgs(enter);
res = _PyObject_CallNoArgsTstate(tstate, enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
Expand Down
45 changes: 44 additions & 1 deletion Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e99c9c

Please sign in to comment.