]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
excise the remains of STOP_CODE, which hasn't done anything useful for years
authorBenjamin Peterson <benjamin@python.org>
Mon, 18 Jul 2011 03:49:50 +0000 (22:49 -0500)
committerBenjamin Peterson <benjamin@python.org>
Mon, 18 Jul 2011 03:49:50 +0000 (22:49 -0500)
Doc/library/dis.rst
Include/opcode.h
Lib/opcode.py
Lib/test/test_dis.py
Python/ceval.c
Python/makeopcodetargets.py

index 79cc583b75440c3ebe5aa0b9c171075ce6edc9ba..cb429c880c161d72c712e5af701748dfc9207f23 100644 (file)
@@ -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.
index 6b1094449e96f5308136dba94aa1e6730a9e5a59..ece713ee39d8ef839917a79423732408c0605899 100644 (file)
@@ -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
index 8e15d13e983c1fa6846f1050500e1a56ad75875e..b631b257c467319b908a3a46275b52ed42383ea8 100644 (file)
@@ -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)
index 643e2e66ebe788cad1f27ae174db3b6da0221d95..4b0b02af266db368e4720ed1ce521228910a0e24 100644 (file)
@@ -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)
 
index 6d493633a980e80b263694b77ff237989ca0bbad..068da6f5f14190a5ddaa8da0388345f666e161e5 100644 (file)
@@ -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();
 
index 5d8e5a9a461c3d9006734af9fbc0bc14cc204c52..d9a085552f7b257e3ff4653990d192abd8b9da9a 100755 (executable)
@@ -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]))