Skip to content

Commit 12a588a

Browse files
refactor: use emit_i when required (python#22)
1 parent b398fab commit 12a588a

1 file changed

Lines changed: 8 additions & 24 deletions

File tree

Python/tier2.c

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,23 +1822,15 @@ _PyTier2_Code_DetectAndEmitBB(
18221822
}
18231823
else {
18241824
if (local == &PyFloat_Type) {
1825-
write_i->op.code = LOAD_FAST;
1826-
write_i->op.arg = oparg;
1827-
write_i++;
1825+
write_i = emit_i(write_i, LOAD_FAST, oparg);
18281826
type_propagate(LOAD_FAST,
18291827
oparg, starting_type_context, consts);
1830-
write_i->op.code = UNBOX_FLOAT;
1831-
write_i->op.arg = 0;
1832-
write_i++;
1828+
write_i = emit_i(write_i, UNBOX_FLOAT, 0);
18331829
type_propagate(UNBOX_FLOAT, 0, starting_type_context, consts);
1834-
write_i->op.code = STORE_FAST_UNBOXED_BOXED;
1835-
write_i->op.arg = oparg;
1836-
write_i++;
1830+
write_i = emit_i(write_i, STORE_FAST_UNBOXED_BOXED, oparg);
18371831
type_propagate(STORE_FAST_UNBOXED_BOXED,
18381832
oparg, starting_type_context, consts);
1839-
write_i->op.code = LOAD_FAST_NO_INCREF;
1840-
write_i->op.arg = oparg;
1841-
write_i++;
1833+
write_i = emit_i(write_i, LOAD_FAST_NO_INCREF, oparg);
18421834
type_propagate(LOAD_FAST_NO_INCREF,
18431835
oparg, starting_type_context, consts);
18441836
continue;
@@ -1858,23 +1850,15 @@ _PyTier2_Code_DetectAndEmitBB(
18581850
}
18591851
else {
18601852
if (local == &PyFloat_Type) {
1861-
write_i->op.code = LOAD_FAST;
1862-
write_i->op.arg = oparg;
1863-
write_i++;
1853+
write_i = emit_i(write_i, LOAD_FAST, oparg);
18641854
type_propagate(LOAD_FAST,
18651855
oparg, starting_type_context, consts);
1866-
write_i->op.code = UNBOX_FLOAT;
1867-
write_i->op.arg = 0;
1868-
write_i++;
1856+
write_i = emit_i(write_i, UNBOX_FLOAT, 0);
18691857
type_propagate(UNBOX_FLOAT, 0, starting_type_context, consts);
1870-
write_i->op.code = STORE_FAST_UNBOXED_BOXED;
1871-
write_i->op.arg = oparg;
1872-
write_i++;
1858+
write_i = emit_i(write_i, STORE_FAST_UNBOXED_BOXED, oparg);
18731859
type_propagate(STORE_FAST_UNBOXED_BOXED,
18741860
oparg, starting_type_context, consts);
1875-
write_i->op.code = LOAD_FAST_NO_INCREF;
1876-
write_i->op.arg = oparg;
1877-
write_i++;
1861+
write_i = emit_i(write_i, LOAD_FAST_NO_INCREF, oparg);
18781862
type_propagate(LOAD_FAST_NO_INCREF,
18791863
oparg, starting_type_context, consts);
18801864
continue;

0 commit comments

Comments
 (0)