From 1e197e63e21f77b102ff2601a549dda4b6439455 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Thu, 10 Nov 2022 04:34:57 -0800 Subject: GH-96421: Insert shim frame on entry to interpreter (GH-96319) * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames. --- Include/internal/pycore_code.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Include/internal/pycore_code.h') diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index b0703073f1..0af240ca36 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -456,6 +456,16 @@ _PyCode_LineNumberFromArray(PyCodeObject *co, int index) } } +typedef struct _PyShimCodeDef { + const uint8_t *code; + int codelen; + int stacksize; + const char *cname; +} _PyShimCodeDef; + +extern PyCodeObject * +_Py_MakeShimCode(const _PyShimCodeDef *code); + #ifdef __cplusplus } -- cgit v1.2.1