8000 gh-109979: Auto-generate the target for DEOPT_IF() by gvanrossum · Pull Request #110193 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109979: Auto-generate the target for DEOPT_IF() #110193

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 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to lo 8000 ad comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests and fix bug they found
  • Loading branch information
gvanrossum committed Oct 1, 2023
commit 3428c84056d2b16f064a9684f4e7c95237c96d4f
11 changes: 9 additions & 2 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,22 @@ def test_overlap(self):

def test_predictions_and_eval_breaker(self):
input = """
inst(OP1, (--)) {
inst(OP1, (arg -- rest)) {
}
inst(OP3, (arg -- res)) {
DEOPT_IF(xxx, OP1);
DEOPT_IF(xxx);
CHECK_EVAL_BREAKER();
}
family(OP1, INLINE_CACHE_ENTRIES_OP1) = { OP3 };
"""
output = """
TARGET(OP1) {
PREDICTED(OP1);
static_assert(INLINE_CACHE_ENTRIES_OP1 == 0, "incorrect cache size");
PyObject *arg;
PyObject *rest;
arg = stack_pointer[-1];
stack_pointer[-1] = rest;
DISPATCH();
}

Expand Down Expand Up @@ -371,6 +377,7 @@ def test_macro_instruction(self):
}

TARGET(OP) {
PREDICTED(OP);
static_assert(INLINE_CACHE_ENTRIES_OP == 5, "incorrect cache size");
PyObject *right;
PyObject *left;
Expand Down
Loading
0