From 76f7f4d979fcec9cff5175044f1c05123f0d7def Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 17 Jul 2011 22:49:50 -0500 Subject: excise the remains of STOP_CODE, which hasn't done anything useful for years --- Doc/library/dis.rst | 5 ----- Include/opcode.h | 1 - Lib/opcode.py | 1 - Lib/test/test_dis.py | 2 +- Python/ceval.c | 2 -- Python/makeopcodetargets.py | 3 --- 6 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 79cc583..cb429c8 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -171,11 +171,6 @@ The Python compiler currently generates the following bytecode instructions. **General instructions** -.. opcode:: STOP_CODE - - Indicates end-of-code to the compiler, not used by the interpreter. - - .. opcode:: NOP Do nothing code. Used as a placeholder by the bytecode optimizer. diff --git a/Include/opcode.h b/Include/opcode.h index 6b10944..ece713e 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -7,7 +7,6 @@ extern "C" { /* Instruction opcodes for compiled code */ -#define STOP_CODE 0 #define POP_TOP 1 #define ROT_TWO 2 #define ROT_THREE 3 diff --git a/Lib/opcode.py b/Lib/opcode.py index 8e15d13..b631b25 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -43,7 +43,6 @@ def jabs_op(name, op): # Instruction opcodes for compiled code # Blank lines correspond to available opcodes -def_op('STOP_CODE', 0) def_op('POP_TOP', 1) def_op('ROT_TWO', 2) def_op('ROT_THREE', 3) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 643e2e6..4b0b02a 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -200,7 +200,7 @@ class DisTests(unittest.TestCase): lines))) def test_opmap(self): - self.assertEqual(dis.opmap["STOP_CODE"], 0) + self.assertEqual(dis.opmap["NOP"], 9) self.assertIn(dis.opmap["LOAD_CONST"], dis.hasconst) self.assertIn(dis.opmap["STORE_NAME"], dis.hasname) diff --git a/Python/ceval.c b/Python/ceval.c index 6d49363..068da6f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1347,8 +1347,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) x to NULL, err to nonzero, or why to anything but WHY_NOT, and that no operation that succeeds does this! */ - /* case STOP_CODE: this is an error! */ - TARGET(NOP) FAST_DISPATCH(); diff --git a/Python/makeopcodetargets.py b/Python/makeopcodetargets.py index 5d8e5a9..d9a0855 100755 --- a/Python/makeopcodetargets.py +++ b/Python/makeopcodetargets.py @@ -23,9 +23,6 @@ def write_contents(f): opcode = find_module("opcode") targets = ['_unknown_opcode'] * 256 for opname, op in opcode.opmap.items(): - if opname == "STOP_CODE": - # XXX opcode not implemented - continue targets[op] = "TARGET_%s" % opname f.write("static void *opcode_targets[256] = {\n") f.write(",\n".join([" &&%s" % s for s in targets])) -- cgit v0.12