diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2024-04-04 15:47:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-04 15:47:26 (GMT) |
commit | 04697bcfaf5dd34c9312f4f405083b6d33b3511f (patch) | |
tree | 6a046068f8d90eaa725a52e116192edb7c47ff4f /Python/assemble.c | |
parent | 060a96f1a9a901b01ed304aa82b886d248ca1cb6 (diff) | |
download | cpython-04697bcfaf5dd34c9312f4f405083b6d33b3511f.zip cpython-04697bcfaf5dd34c9312f4f405083b6d33b3511f.tar.gz cpython-04697bcfaf5dd34c9312f4f405083b6d33b3511f.tar.bz2 |
gh-117494: extract the Instruction Sequence data structure into a separate file (#117496)
Diffstat (limited to 'Python/assemble.c')
-rw-r--r-- | Python/assemble.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/assemble.c b/Python/assemble.c index be3d9c1..945c8ac 100644 --- a/Python/assemble.c +++ b/Python/assemble.c @@ -3,6 +3,7 @@ #include "Python.h" #include "pycore_code.h" // write_location_entry_start() #include "pycore_compile.h" +#include "pycore_instruction_sequence.h" #include "pycore_opcode_utils.h" // IS_BACKWARDS_JUMP_OPCODE #include "pycore_opcode_metadata.h" // is_pseudo_target, _PyOpcode_Caches #include "pycore_symtable.h" // _Py_SourceLocation @@ -23,8 +24,8 @@ } typedef _Py_SourceLocation location; -typedef _PyCompile_Instruction instruction; -typedef _PyCompile_InstructionSequence instr_sequence; +typedef _PyInstruction instruction; +typedef _PyInstructionSequence instr_sequence; static inline bool same_location(location a, location b) @@ -132,7 +133,7 @@ assemble_emit_exception_table_item(struct assembler *a, int value, int msb) static int assemble_emit_exception_table_entry(struct assembler *a, int start, int end, int handler_offset, - _PyCompile_ExceptHandlerInfo *handler) + _PyExceptHandlerInfo *handler) { Py_ssize_t len = PyBytes_GET_SIZE(a->a_except_table); if (a->a_except_table_off + MAX_SIZE_OF_ENTRY >= len) { @@ -158,7 +159,7 @@ static int assemble_exception_table(struct assembler *a, instr_sequence *instrs) { int ioffset = 0; - _PyCompile_ExceptHandlerInfo handler; + _PyExceptHandlerInfo handler; handler.h_label = -1; handler.h_startdepth = -1; handler.h_preserve_lasti = -1; @@ -736,8 +737,7 @@ _PyAssemble_MakeCodeObject(_PyCompile_CodeUnitMetadata *umd, PyObject *const_cac PyObject *consts, int maxdepth, instr_sequence *instrs, int nlocalsplus, int code_flags, PyObject *filename) { - - if (_PyCompile_InstructionSequence_ApplyLabelMap(instrs) < 0) { + if (_PyInstructionSequence_ApplyLabelMap(instrs) < 0) { return NULL; } if (resolve_unconditional_jumps(instrs) < 0) { |