mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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
This commit is contained in:
parent
c00faf7943
commit
a99eb5cd99
13 changed files with 200 additions and 184 deletions
|
@ -274,31 +274,31 @@ write_instr(_Py_CODEUNIT *codestr, struct instr *instruction, int ilen)
|
|||
int caches = _PyOpcode_Caches[opcode];
|
||||
switch (ilen - caches) {
|
||||
case 4:
|
||||
codestr->opcode = EXTENDED_ARG;
|
||||
codestr->oparg = (oparg >> 24) & 0xFF;
|
||||
codestr->op.code = EXTENDED_ARG;
|
||||
codestr->op.arg = (oparg >> 24) & 0xFF;
|
||||
codestr++;
|
||||
/* fall through */
|
||||
case 3:
|
||||
codestr->opcode = EXTENDED_ARG;
|
||||
codestr->oparg = (oparg >> 16) & 0xFF;
|
||||
codestr->op.code = EXTENDED_ARG;
|
||||
codestr->op.arg = (oparg >> 16) & 0xFF;
|
||||
codestr++;
|
||||
/* fall through */
|
||||
case 2:
|
||||
codestr->opcode = EXTENDED_ARG;
|
||||
codestr->oparg = (oparg >> 8) & 0xFF;
|
||||
codestr->op.code = EXTENDED_ARG;
|
||||
codestr->op.arg = (oparg >> 8) & 0xFF;
|
||||
codestr++;
|
||||
/* fall through */
|
||||
case 1:
|
||||
codestr->opcode = opcode;
|
||||
codestr->oparg = oparg & 0xFF;
|
||||
codestr->op.code = opcode;
|
||||
codestr->op.arg = oparg & 0xFF;
|
||||
codestr++;
|
||||
break;
|
||||
default:
|
||||
Py_UNREACHABLE();
|
||||
}
|
||||
while (caches--) {
|
||||
codestr->opcode = CACHE;
|
||||
codestr->oparg = 0;
|
||||
codestr->op.code = CACHE;
|
||||
codestr->op.arg = 0;
|
||||
codestr++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue