Skip to content
Prev Previous commit
Next Next commit
breakpoints and prints
  • Loading branch information
dpdani committed May 20, 2024
commit ddbfd9443c4c39463f6bdbbbc000992b383e7f1a
2 changes: 2 additions & 0 deletions Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,8 @@ def thing(a):
class Foo:
attr = 1

breakpoint()

res, ex = self._run_with_optimizer(thing, Foo())
opnames = list(iter_opnames(ex))
for i in iter_opnames(ex):
Expand Down
2 changes: 2 additions & 0 deletions Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ dummy_func(void) {
}

op(_GUARD_TYPE_VERSION, (type_version/2, owner -- owner)) {
printf("%d %d %d\n", type_version, owner->typ_version, owner->typ_version_offset);
if (sym_matches_type_version(owner, type_version)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
Expand Down Expand Up @@ -711,6 +712,7 @@ dummy_func(void) {
}

op(_ITER_NEXT_RANGE, (iter -- iter, next)) {
printf("ciao");
next = sym_new_type(ctx, &PyLong_Type);
(void)iter;
}
Expand Down