summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-08-24 00:32:09 (GMT)
committerFred Drake <fdrake@acm.org>2000-08-24 00:32:09 (GMT)
commitef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d (patch)
tree799778ef59de6c384636792eb8f1e2ddc1e918a8 /Python/ceval.c
parente266e42c9c1d20b24d18def1c4398e75fe1620f0 (diff)
downloadcpython-ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d.zip
cpython-ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d.tar.gz
cpython-ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d.tar.bz2
Charles G. Waldman <cgw@fnal.gov>:
Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit arguments to opcodes instead of being forced to stick to the 16-bit limit. This is especially useful for machine-generated code, which can be too long for the SET_LINENO parameter to fit into 16 bits. This closes the implementation portion of SourceForge patch #100893.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 23c477b..fb7b5bc 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -613,6 +613,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
opcode = NEXTOP();
if (HAS_ARG(opcode))
oparg = NEXTARG();
+ dispatch_opcode:
#ifdef DYNAMIC_EXECUTION_PROFILE
#ifdef DXPAIRS
dxpairs[lastopcode][opcode]++;
@@ -1750,6 +1751,11 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
if (x != NULL) continue;
break;
+ case EXTENDED_ARG:
+ opcode = NEXTOP();
+ oparg = oparg<<16 | NEXTARG();
+ goto dispatch_opcode;
+ break;
default:
fprintf(stderr,