diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-04-29 12:06:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 12:06:04 +0100 |
commit | fbf3596c3edadd03b5a8c659e9f27a09e5d1a051 (patch) | |
tree | 80af952c9f42e6552669ba6a342fa041570d638c /Include/internal/pycore_compile.h | |
parent | 84e7d0f0c7f9a44d81be2d705ed4d401a6505356 (diff) | |
download | cpython-git-fbf3596c3edadd03b5a8c659e9f27a09e5d1a051.tar.gz |
gh-87092: change assembler to use instruction sequence instead of CFG (#103933)
Diffstat (limited to 'Include/internal/pycore_compile.h')
-rw-r--r-- | Include/internal/pycore_compile.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Include/internal/pycore_compile.h b/Include/internal/pycore_compile.h index f85240c48a..1a032f652d 100644 --- a/Include/internal/pycore_compile.h +++ b/Include/internal/pycore_compile.h @@ -19,6 +19,7 @@ PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( int optimize, struct _arena *arena); +static const _PyCompilerSrcLocation NO_LOCATION = {-1, -1, -1, -1}; typedef struct { int optimize; @@ -33,15 +34,21 @@ extern int _PyAST_Optimize( struct _arena *arena, _PyASTOptimizeState *state); +typedef struct { + int h_offset; + int h_startdepth; + int h_preserve_lasti; +} _PyCompile_ExceptHandlerInfo; typedef struct { int i_opcode; int i_oparg; _PyCompilerSrcLocation i_loc; -} _PyCompilerInstruction; + _PyCompile_ExceptHandlerInfo i_except_handler_info; +} _PyCompile_Instruction; typedef struct { - _PyCompilerInstruction *s_instrs; + _PyCompile_Instruction *s_instrs; int s_allocated; int s_used; @@ -82,6 +89,8 @@ int _PyCompile_EnsureArrayLargeEnough( int _PyCompile_ConstCacheMergeOne(PyObject *const_cache, PyObject **obj); +int _PyCompile_InstrSize(int opcode, int oparg); + /* Access compiler internals for unit testing */ PyAPI_FUNC(PyObject*) _PyCompile_CodeGen( |