8000 GH-111848: Convert remaining jumps to deopts into tier 2 code. by markshannon · Pull Request #112045 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-111848: Convert remaining jumps to deopts into tier 2 code. #112045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix refleak
  • Loading branch information
markshannon committed Nov 11, 2023
commit f36132831dc1d8696436ce107d6003c6514cd17d
14 changes: 12 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3985,18 +3985,28 @@ dummy_func(

op (_GUARD_IS_TRUE_POP, (flag -- )) {
DEOPT_IF(Py_IsFalse(flag));
assert(Py_IsTrue(flag));
}

op (_GUARD_IS_FALSE_POP, (flag -- )) {
DEOPT_IF(Py_IsTrue(flag));
assert(Py_IsFalse(flag));
}

op (_GUARD_IS_NONE_POP, (val -- )) {
DEOPT_IF(!Py_IsNone(val));
if (!Py_IsNone(val)) {
Py_DECREF(val);
DEOPT_IF(true);
}
}

op (_GUARD_IS_NOT_NONE_POP, (val -- )) {
DEOPT_IF(Py_IsNone(val));
if (Py_IsNone(val)) {
DEOPT_IF(true);
}
else {
Py_DECREF(val);
}
}

op(_JUMP_TO_TOP, (--)) {
Expand Down
14 changes: 12 additions & 2 deletions Python/executor_cases.c.h

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

2 changes: 1 addition & 1 deletion Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ translate_bytecode_to_trace(
#define BIT_IS_SET(array, bit) (array[(bit)>>5] & (1<<((bit)&31)))

static bool
is_branch(opcode) {
is_branch(int opcode) {
/* Currently there are no jumps in the buffer,
* but we expect the optimizer to add them
* in the future. */
Expand Down
0