GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen … · wrongnull/cpython@55815a6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib/test
    • test_compiler_codegen.py
    • test_dis.py
    • test_peepholer.py
  • Programs
    • test_frozenmain.h
  • Python
    • codegen.c
    • flowgraph.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/test/test_compiler_codegen.py‎

Copy file name to clipboardExpand all lines: Lib/test/test_compiler_codegen.py
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def test_if_expression(self):
2929
('LOAD_CONST', 0, 1),
3030
('TO_BOOL', 0, 1),
3131
('POP_JUMP_IF_FALSE', false_lbl := self.Label(), 1),
32-
('LOAD_SMALL_INT', 42, 1),
32+
('LOAD_CONST', 1, 1), # 42
3333
('JUMP_NO_INTERRUPT', exit_lbl := self.Label()),
3434
false_lbl,
35-
('LOAD_SMALL_INT', 24, 1),
35+
('LOAD_CONST', 2, 1), # 24
3636
exit_lbl,
3737
('POP_TOP', None),
3838
('LOAD_CONST', 1),
@@ -82,7 +82,7 @@ def f(x):
8282
# Function body
8383
('RESUME', 0),
8484
('LOAD_FAST', 0),
85-
('LOAD_SMALL_INT', 42),
85+
('LOAD_CONST', 42),
8686
('BINARY_OP', 0),
8787
('RETURN_VALUE', None),
8888
('LOAD_CONST', 0),
@@ -125,23 +125,23 @@ def g():
125125
[
126126
('RESUME', 0),
127127
('NOP', None),
128-
('LOAD_SMALL_INT', 12),
128+
('LOAD_CONST', 12),
129129
('RETURN_VALUE', None),
130130
('LOAD_CONST', 1),
131131
('RETURN_VALUE', None),
132132
],
133133
[
134134
('RESUME', 0),
135-
('LOAD_SMALL_INT', 1),
135+
('LOAD_CONST', 1),
136136
('STORE_FAST', 0),
137-
('LOAD_SMALL_INT', 2),
137+
('LOAD_CONST', 2),
138138
('STORE_FAST', 1),
139-
('LOAD_SMALL_INT', 3),
139+
('LOAD_CONST', 3),
140140
('STORE_FAST', 2),
141-
('LOAD_SMALL_INT', 4),
141+
('LOAD_CONST', 4),
142142
('STORE_FAST', 3),
143143
('NOP', None),
144-
('LOAD_SMALL_INT', 42),
144+
('LOAD_CONST', 42),
145145
('RETURN_VALUE', None),
146146
('LOAD_CONST', 0),
147147
('RETURN_VALUE', None),

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.