Skip to content

Commit 76f7f4d

Browse files
committed
excise the remains of STOP_CODE, which hasn't done anything useful for years
1 parent 42d1320 commit 76f7f4d

File tree

6 files changed

+1
-13
lines changed

6 files changed

+1
-13
lines changed

Doc/library/dis.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@ The Python compiler currently generates the following bytecode instructions.
171171

172172
**General instructions**
173173

174-
.. opcode:: STOP_CODE
175-
176-
Indicates end-of-code to the compiler, not used by the interpreter.
177-
178-
179174
.. opcode:: NOP
180175

181176
Do nothing code. Used as a placeholder by the bytecode optimizer.

Include/opcode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ extern "C" {
77

88
/* Instruction opcodes for compiled code */
99

10-
#define STOP_CODE 0
1110
#define POP_TOP 1
1211
#define ROT_TWO 2
1312
#define ROT_THREE 3

Lib/opcode.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def jabs_op(name, op):
4343
# Instruction opcodes for compiled code
4444
# Blank lines correspond to available opcodes
4545

46-
def_op('STOP_CODE', 0)
4746
def_op('POP_TOP', 1)
4847
def_op('ROT_TWO', 2)
4948
def_op('ROT_THREE', 3)

Lib/test/test_dis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def do_disassembly_test(self, func, expected):
200200
lines)))
201201

202202
def test_opmap(self):
203-
self.assertEqual(dis.opmap["STOP_CODE"], 0)
203+
self.assertEqual(dis.opmap["NOP"], 9)
204204
self.assertIn(dis.opmap["LOAD_CONST"], dis.hasconst)
205205
self.assertIn(dis.opmap["STORE_NAME"], dis.hasname)
206206

Python/ceval.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
13471347
x to NULL, err to nonzero, or why to anything but WHY_NOT,
13481348
and that no operation that succeeds does this! */
13491349

1350-
/* case STOP_CODE: this is an error! */
1351-
13521350
TARGET(NOP)
13531351
FAST_DISPATCH();
13541352

Python/makeopcodetargets.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ def write_contents(f):
2323
opcode = find_module("opcode")
2424
targets = ['_unknown_opcode'] * 256
2525
for opname, op in opcode.opmap.items():
26-
if opname == "STOP_CODE":
27-
# XXX opcode not implemented
28-
continue
2926
targets[op] = "TARGET_%s" % opname
3027
f.write("static void *opcode_targets[256] = {\n")
3128
f.write(",\n".join([" &&%s" % s for s in targets]))

0 commit comments

Comments
 (0)