diff options
author | Steve Dower <steve.dower@python.org> | 2023-02-20 14:56:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-20 14:56:48 (GMT) |
commit | a99eb5cd9947629a6745a4ad99cb07af1c287b5d (patch) | |
tree | 2d2b82cef5aa1c514eda32eaca115e2723fd7f1c /Python/ceval_macros.h | |
parent | c00faf79438cc7f0d98af2679c695f747e4369a3 (diff) | |
download | cpython-a99eb5cd9947629a6745a4ad99cb07af1c287b5d.zip cpython-a99eb5cd9947629a6745a4ad99cb07af1c287b5d.tar.gz cpython-a99eb5cd9947629a6745a4ad99cb07af1c287b5d.tar.bz2 |
gh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (GH-101912)
* gh-101907: Removes use of non-standard C++ extension from Include/cpython/code.h
* Make cases_generator correct on Windows
Diffstat (limited to 'Python/ceval_macros.h')
-rw-r--r-- | Python/ceval_macros.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index 691bf8e..ac1fec7 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -100,7 +100,7 @@ #define DISPATCH_SAME_OPARG() \ { \ - opcode = _Py_OPCODE(*next_instr); \ + opcode = next_instr->op.code; \ PRE_DISPATCH_GOTO(); \ opcode |= cframe.use_tracing OR_DTRACE_LINE; \ DISPATCH_GOTO(); \ @@ -143,8 +143,8 @@ GETITEM(PyObject *v, Py_ssize_t i) { #define INSTR_OFFSET() ((int)(next_instr - _PyCode_CODE(frame->f_code))) #define NEXTOPARG() do { \ _Py_CODEUNIT word = *next_instr; \ - opcode = _Py_OPCODE(word); \ - oparg = _Py_OPARG(word); \ + opcode = word.op.code; \ + oparg = word.op.arg; \ } while (0) #define JUMPTO(x) (next_instr = _PyCode_CODE(frame->f_code) + (x)) #define JUMPBY(x) (next_instr += (x)) @@ -180,14 +180,14 @@ GETITEM(PyObject *v, Py_ssize_t i) { #if USE_COMPUTED_GOTOS #define PREDICT(op) if (0) goto PREDICT_ID(op) #else -#define PREDICT(op) \ +#define PREDICT(next_op) \ do { \ _Py_CODEUNIT word = *next_instr; \ - opcode = _Py_OPCODE(word) | cframe.use_tracing OR_DTRACE_LINE; \ - if (opcode == op) { \ - oparg = _Py_OPARG(word); \ - INSTRUCTION_START(op); \ - goto PREDICT_ID(op); \ + opcode = word.op.code | cframe.use_tracing OR_DTRACE_LINE; \ + if (opcode == next_op) { \ + oparg = word.op.arg; \ + INSTRUCTION_START(next_op); \ + goto PREDICT_ID(next_op); \ } \ } while(0) #endif |