| OLD | NEW |
| 1 /* Definitions for bytecode */ | 1 /* Definitions for bytecode */ |
| 2 | 2 |
| 3 #ifndef Py_LIMITED_API | 3 #ifndef Py_LIMITED_API |
| 4 #ifndef Py_CODE_H | 4 #ifndef Py_CODE_H |
| 5 #define Py_CODE_H | 5 #define Py_CODE_H |
| 6 #ifdef __cplusplus | 6 #ifdef __cplusplus |
| 7 extern "C" { | 7 extern "C" { |
| 8 #endif | 8 #endif |
| 9 |
| 10 #include "pyconfig.h" |
| 9 | 11 |
| 10 /* Bytecode object */ | 12 /* Bytecode object */ |
| 11 typedef struct { | 13 typedef struct { |
| 12 PyObject_HEAD | 14 PyObject_HEAD |
| 13 int co_argcount; /* #arguments, except *args */ | 15 int co_argcount; /* #arguments, except *args */ |
| 14 int co_kwonlyargcount; /* #keyword only arguments */ | 16 int co_kwonlyargcount; /* #keyword only arguments */ |
| 15 int co_nlocals; /* #local variables */ | 17 int co_nlocals; /* #local variables */ |
| 16 int co_stacksize; /* #entries needed for evaluation stack */ | 18 int co_stacksize; /* #entries needed for evaluation stack */ |
| 17 int co_flags; /* CO_..., see below */ | 19 int co_flags; /* CO_..., see below */ |
| 18 PyObject *co_code; /* instruction opcodes */ | 20 PyObject *co_code; /* instruction opcodes */ |
| 19 PyObject *co_consts; /* list (constants used) */ | 21 PyObject *co_consts; /* list (constants used) */ |
| 20 PyObject *co_names; /* list of strings (names used) */ | 22 PyObject *co_names; /* list of strings (names used) */ |
| 21 PyObject *co_varnames; /* tuple of strings (local variable names) */ | 23 PyObject *co_varnames; /* tuple of strings (local variable names) */ |
| 22 PyObject *co_freevars; /* tuple of strings (free variable names) */ | 24 PyObject *co_freevars; /* tuple of strings (free variable names) */ |
| 23 PyObject *co_cellvars; /* tuple of strings (cell variable names) */ | 25 PyObject *co_cellvars; /* tuple of strings (cell variable names) */ |
| 24 /* The rest doesn't count for hash or comparisons */ | 26 /* The rest doesn't count for hash or comparisons */ |
| 25 unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */ | 27 unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */ |
| 26 PyObject *co_filename; /* unicode (where it was loaded from) */ | 28 PyObject *co_filename; /* unicode (where it was loaded from) */ |
| 27 PyObject *co_name; /* unicode (name, for reference) */ | 29 PyObject *co_name; /* unicode (name, for reference) */ |
| 28 int co_firstlineno; /* first source line number */ | 30 int co_firstlineno; /* first source line number */ |
| 29 PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See | 31 PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See |
| 30 Objects/lnotab_notes.txt for details. */ | 32 Objects/lnotab_notes.txt for details. */ |
| 33 #ifdef WITH_DTRACE |
| 34 unsigned short *co_linenos; /* dtrace stack helper */ |
| 35 #endif |
| 31 void *co_zombieframe; /* for optimization only (see frameobject.c) */ | 36 void *co_zombieframe; /* for optimization only (see frameobject.c) */ |
| 32 PyObject *co_weakreflist; /* to support weakrefs to code objects */ | 37 PyObject *co_weakreflist; /* to support weakrefs to code objects */ |
| 33 } PyCodeObject; | 38 } PyCodeObject; |
| 34 | 39 |
| 35 /* Masks for co_flags above */ | 40 /* Masks for co_flags above */ |
| 36 #define CO_OPTIMIZED 0x0001 | 41 #define CO_OPTIMIZED 0x0001 |
| 37 #define CO_NEWLOCALS 0x0002 | 42 #define CO_NEWLOCALS 0x0002 |
| 38 #define CO_VARARGS 0x0004 | 43 #define CO_VARARGS 0x0004 |
| 39 #define CO_VARKEYWORDS 0x0008 | 44 #define CO_VARKEYWORDS 0x0008 |
| 40 #define CO_NESTED 0x0010 | 45 #define CO_NESTED 0x0010 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 #endif | 111 #endif |
| 107 | 112 |
| 108 PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, | 113 PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, |
| 109 PyObject *names, PyObject *lineno_obj); | 114 PyObject *names, PyObject *lineno_obj); |
| 110 | 115 |
| 111 #ifdef __cplusplus | 116 #ifdef __cplusplus |
| 112 } | 117 } |
| 113 #endif | 118 #endif |
| 114 #endif /* !Py_CODE_H */ | 119 #endif /* !Py_CODE_H */ |
| 115 #endif /* Py_LIMITED_API */ | 120 #endif /* Py_LIMITED_API */ |
| OLD | NEW |