Skip to content

Commit 5728410

Browse files
Add _STORE_ATTR_SLOT to optimizer bytecodes
1 parent e108619 commit 5728410

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ def testfunc(n):
25332533
self.assertIsNotNone(ex)
25342534
uops = get_opnames(ex)
25352535
self.assertIn("_STORE_ATTR_SLOT", uops)
2536-
self.assertIn("_POP_TOP", uops)
2536+
self.assertIn("_POP_TOP_NOP", uops)
25372537

25382538
def test_attr_promotion_failure(self):
25392539
# We're not testing for any specific uops here, just

Python/optimizer_bytecodes.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ dummy_func(void) {
109109
ss = sub_st;
110110
}
111111

112+
op(_STORE_ATTR_SLOT, (index/1, value, owner -- o)) {
113+
(void)index;
114+
(void)value;
115+
o = owner;
116+
}
117+
112118
op(_PUSH_NULL, (-- res)) {
113119
res = sym_new_null(ctx);
114120
}

Python/optimizer_cases.c.h

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)