@@ -259,9 +259,35 @@ PyAPI_FUNC(PyCodeObject *) _PyCode_New(struct _PyCodeConstructor *);
259259/* Private API */
260260
261261/* Getters for internal PyCodeObject data. */
262- PyAPI_FUNC (PyObject * ) _PyCode_GetVarnames (PyCodeObject * );
263- PyAPI_FUNC (PyObject * ) _PyCode_GetCellvars (PyCodeObject * );
264- PyAPI_FUNC (PyObject * ) _PyCode_GetFreevars (PyCodeObject * );
262+ extern PyObject * _PyCode_GetVarnames (PyCodeObject * );
263+ extern PyObject * _PyCode_GetCellvars (PyCodeObject * );
264+ extern PyObject * _PyCode_GetFreevars (PyCodeObject * );
265+
266+ /* Return the ending source code line number from a bytecode index. */
267+ extern int _PyCode_Addr2EndLine (PyCodeObject * , int );
268+
269+ /* Return the ending source code line number from a bytecode index. */
270+ extern int _PyCode_Addr2EndLine (PyCodeObject * , int );
271+ /* Return the starting source code column offset from a bytecode index. */
272+ extern int _PyCode_Addr2Offset (PyCodeObject * , int );
273+ /* Return the ending source code column offset from a bytecode index. */
274+ extern int _PyCode_Addr2EndOffset (PyCodeObject * , int );
275+
276+ /** API for initializing the line number tables. */
277+ extern int _PyCode_InitAddressRange (PyCodeObject * co , PyCodeAddressRange * bounds );
278+ extern int _PyCode_InitEndAddressRange (PyCodeObject * co , PyCodeAddressRange * bounds );
279+
280+ /** Out of process API for initializing the line number table. */
281+ extern void _PyLineTable_InitAddressRange (
282+ const char * linetable ,
283+ Py_ssize_t length ,
284+ int firstlineno ,
285+ PyCodeAddressRange * range );
286+
287+ /** API for traversing the line number table. */
288+ extern int _PyLineTable_NextAddressRange (PyCodeAddressRange * range );
289+ extern int _PyLineTable_PreviousAddressRange (PyCodeAddressRange * range );
290+
265291
266292#define ADAPTIVE_CACHE_BACKOFF 64
267293
@@ -272,26 +298,26 @@ cache_backoff(_PyAdaptiveEntry *entry) {
272298
273299/* Specialization functions */
274300
275- int _Py_Specialize_LoadAttr (PyObject * owner , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
276- int _Py_Specialize_StoreAttr (PyObject * owner , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
277- int _Py_Specialize_LoadGlobal (PyObject * globals , PyObject * builtins , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
278- int _Py_Specialize_LoadMethod (PyObject * owner , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
279- int _Py_Specialize_BinarySubscr (PyObject * sub , PyObject * container , _Py_CODEUNIT * instr , SpecializedCacheEntry * cache );
280- int _Py_Specialize_StoreSubscr (PyObject * container , PyObject * sub , _Py_CODEUNIT * instr );
281- int _Py_Specialize_Call (PyObject * callable , _Py_CODEUNIT * instr , int nargs ,
301+ extern int _Py_Specialize_LoadAttr (PyObject * owner , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
302+ extern int _Py_Specialize_StoreAttr (PyObject * owner , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
303+ extern int _Py_Specialize_LoadGlobal (PyObject * globals , PyObject * builtins , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
304+ extern int _Py_Specialize_LoadMethod (PyObject * owner , _Py_CODEUNIT * instr , PyObject * name , SpecializedCacheEntry * cache );
305+ extern int _Py_Specialize_BinarySubscr (PyObject * sub , PyObject * container , _Py_CODEUNIT * instr , SpecializedCacheEntry * cache );
306+ extern int _Py_Specialize_StoreSubscr (PyObject * container , PyObject * sub , _Py_CODEUNIT * instr );
307+ extern int _Py_Specialize_Call (PyObject * callable , _Py_CODEUNIT * instr , int nargs ,
282308 PyObject * kwnames , SpecializedCacheEntry * cache );
283- int _Py_Specialize_Precall (PyObject * callable , _Py_CODEUNIT * instr , int nargs ,
309+ extern int _Py_Specialize_Precall (PyObject * callable , _Py_CODEUNIT * instr , int nargs ,
284310 PyObject * kwnames , SpecializedCacheEntry * cache , PyObject * builtins );
285- void _Py_Specialize_BinaryOp (PyObject * lhs , PyObject * rhs , _Py_CODEUNIT * instr ,
311+ extern void _Py_Specialize_BinaryOp (PyObject * lhs , PyObject * rhs , _Py_CODEUNIT * instr ,
286312 int oparg );
287- void _Py_Specialize_CompareOp (PyObject * lhs , PyObject * rhs , _Py_CODEUNIT * instr , SpecializedCacheEntry * cache );
288- void _Py_Specialize_UnpackSequence (PyObject * seq , _Py_CODEUNIT * instr ,
313+ extern void _Py_Specialize_CompareOp (PyObject * lhs , PyObject * rhs , _Py_CODEUNIT * instr , SpecializedCacheEntry * cache );
314+ extern void _Py_Specialize_UnpackSequence (PyObject * seq , _Py_CODEUNIT * instr ,
289315 SpecializedCacheEntry * cache );
290316
291317/* Deallocator function for static codeobjects used in deepfreeze.py */
292- void _PyStaticCode_Dealloc (PyCodeObject * co );
318+ extern void _PyStaticCode_Dealloc (PyCodeObject * co );
293319/* Function to intern strings of codeobjects */
294- void _PyStaticCode_InternStrings (PyCodeObject * co );
320+ extern void _PyStaticCode_InternStrings (PyCodeObject * co );
295321
296322#ifdef Py_STATS
297323
@@ -343,9 +369,9 @@ extern PyStats _py_stats;
343369#define CALL_STAT_INC (name ) _py_stats.call_stats.name++
344370#define OBJECT_STAT_INC (name ) _py_stats.object_stats.name++
345371
346- void _Py_PrintSpecializationStats (int to_file );
372+ extern void _Py_PrintSpecializationStats (int to_file );
347373
348- PyAPI_FUNC ( PyObject * ) _Py_GetSpecializationStats (void );
374+ extern PyObject * _Py_GetSpecializationStats (void );
349375
350376#else
351377#define STAT_INC (opname , name ) ((void)0)
0 commit comments