From: Benjamin Peterson Date: Mon, 18 Jul 2011 03:49:50 +0000 (-0500) Subject: excise the remains of STOP_CODE, which hasn't done anything useful for years X-Git-Tag: v3.3.0a1~1882 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76f7f4d979fcec9cff5175044f1c05123f0d7def;p=thirdparty%2FPython%2Fcpython.git excise the remains of STOP_CODE, which hasn't done anything useful for years --- diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 79cc583b7544..cb429c880c16 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 6b1094449e96..ece713ee39d8 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 8e15d13e983c..b631b257c467 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 643e2e66ebe7..4b0b02af266d 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 6d493633a980..068da6f5f141 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 5d8e5a9a461c..d9a085552f7b 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]))