gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)

This commit is contained in:
Irit Katriel 2023-06-11 22:31:59 +01:00 committed by GitHub
parent 20a56d8bec
commit 58f5227d7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 507 additions and 267 deletions

View file

@ -4,6 +4,7 @@
#include "pycore_code.h" // write_location_entry_start()
#include "pycore_compile.h"
#include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros
#include "opcode_metadata.h" // IS_PSEUDO_INSTR
#define DEFAULT_CODE_SIZE 128
@ -338,7 +339,8 @@ static void
write_instr(_Py_CODEUNIT *codestr, instruction *instr, int ilen)
{
int opcode = instr->i_opcode;
assert(!IS_PSEUDO_OPCODE(opcode));
assert(IS_PSEUDO_OPCODE(opcode) == IS_PSEUDO_INSTR(opcode));
assert(!IS_PSEUDO_INSTR(opcode));
int oparg = instr->i_oparg;
assert(HAS_ARG(opcode) || oparg == 0);
int caches = _PyOpcode_Caches[opcode];