Skip to content

Commit 8887d67

Browse files
committed
Update Python inlined files: 3.8.1
1 parent 7dd08ed commit 8887d67

File tree

816 files changed

+89074
-67635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

816 files changed

+89074
-67635
lines changed

graalpython/com.oracle.graal.python.cext/include/abstract.h

Lines changed: 21 additions & 286 deletions
Large diffs are not rendered by default.

graalpython/com.oracle.graal.python.cext/include/ceval.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
3333
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
3434
PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(int new_depth);
3535
PyAPI_FUNC(int) _PyEval_GetCoroutineOriginTrackingDepth(void);
36-
PyAPI_FUNC(void) _PyEval_SetCoroutineWrapper(PyObject *);
37-
PyAPI_FUNC(PyObject *) _PyEval_GetCoroutineWrapper(void);
3836
PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *);
3937
PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void);
4038
PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *);
@@ -58,7 +56,6 @@ PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
5856
#endif
5957

6058
PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
61-
PyAPI_FUNC(void) _PyEval_SignalReceived(void);
6259
PyAPI_FUNC(int) Py_MakePendingCalls(void);
6360

6461
/* Protection against deeply nested recursive calls
@@ -192,14 +189,10 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
192189

193190
PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
194191
PyAPI_FUNC(void) PyEval_InitThreads(void);
195-
#ifndef Py_LIMITED_API
196-
PyAPI_FUNC(void) _PyEval_FiniThreads(void);
197-
#endif /* !Py_LIMITED_API */
198-
PyAPI_FUNC(void) PyEval_AcquireLock(void) Py_DEPRECATED(3.2);
199-
PyAPI_FUNC(void) PyEval_ReleaseLock(void) /* Py_DEPRECATED(3.2) */;
192+
Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_AcquireLock(void);
193+
/* Py_DEPRECATED(3.2) */ PyAPI_FUNC(void) PyEval_ReleaseLock(void);
200194
PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
201195
PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
202-
PyAPI_FUNC(void) PyEval_ReInitThreads(void);
203196

204197
#ifndef Py_LIMITED_API
205198
PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
@@ -221,7 +214,6 @@ PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
221214
#ifndef Py_LIMITED_API
222215
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
223216
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
224-
PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void);
225217
#endif
226218

227219
/* Masks and values used by FORMAT_VALUE opcode. */

graalpython/com.oracle.graal.python.cext/include/classobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ typedef struct {
1414
PyObject *im_func; /* The callable object implementing the method */
1515
PyObject *im_self; /* The instance it is bound to */
1616
PyObject *im_weakreflist; /* List of weak references */
17+
vectorcallfunc vectorcall;
1718
} PyMethodObject;
1819

1920
PyAPI_DATA(PyTypeObject) PyMethod_Type;

graalpython/com.oracle.graal.python.cext/include/code.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ typedef uint16_t _Py_CODEUNIT;
1717
# define _Py_OPARG(word) ((word) >> 8)
1818
#endif
1919

20+
typedef struct _PyOpcache _PyOpcache;
21+
2022
/* Bytecode object */
2123
typedef struct {
2224
PyObject_HEAD
2325
int co_argcount; /* #arguments, except *args */
26+
int co_posonlyargcount; /* #positional only arguments */
2427
int co_kwonlyargcount; /* #keyword only arguments */
2528
int co_nlocals; /* #local variables */
2629
int co_stacksize; /* #entries needed for evaluation stack */
@@ -48,6 +51,21 @@ typedef struct {
4851
Type is a void* to keep the format private in codeobject.c to force
4952
people to go through the proper APIs. */
5053
void *co_extra;
54+
55+
/* Per opcodes just-in-time cache
56+
*
57+
* To reduce cache size, we use indirect mapping from opcode index to
58+
* cache object:
59+
* cache = co_opcache[co_opcache_map[next_instr - first_instr] - 1]
60+
*/
61+
62+
// co_opcache_map is indexed by (next_instr - first_instr).
63+
// * 0 means there is no cache for this opcode.
64+
// * n > 0 means there is cache in co_opcache[n-1].
65+
unsigned char *co_opcache_map;
66+
_PyOpcache *co_opcache;
67+
int co_opcache_flag; // used to determine when create a cache.
68+
unsigned char co_opcache_size; // length of co_opcache.
5169
} PyCodeObject;
5270

5371
/* Masks for co_flags above */
@@ -105,6 +123,11 @@ PyAPI_FUNC(PyCodeObject *) PyCode_New(
105123
int, int, int, int, int, PyObject *, PyObject *,
106124
PyObject *, PyObject *, PyObject *, PyObject *,
107125
PyObject *, PyObject *, int, PyObject *);
126+
127+
PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs(
128+
int, int, int, int, int, int, PyObject *, PyObject *,
129+
PyObject *, PyObject *, PyObject *, PyObject *,
130+
PyObject *, PyObject *, int, PyObject *);
108131
/* same as struct above */
109132

110133
/* Creates a new empty code object with the specified source location. */

graalpython/com.oracle.graal.python.cext/include/compile.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
2222
#define PyCF_DONT_IMPLY_DEDENT 0x0200
2323
#define PyCF_ONLY_AST 0x0400
2424
#define PyCF_IGNORE_COOKIE 0x0800
25+
#define PyCF_TYPE_COMMENTS 0x1000
26+
#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000
2527

2628
#ifndef Py_LIMITED_API
2729
typedef struct {
2830
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
31+
int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */
2932
} PyCompilerFlags;
33+
34+
#define _PyCompilerFlags_INIT \
35+
(PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION}
3036
#endif
3137

3238
/* Future feature support */
@@ -75,6 +81,7 @@ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
7581

7682
#define PY_INVALID_STACK_EFFECT INT_MAX
7783
PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
84+
PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump);
7885

7986
PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, int optimize);
8087

@@ -84,10 +91,10 @@ PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, int optimize);
8491

8592
#endif /* !Py_LIMITED_API */
8693

87-
/* These definitions must match corresponding definitions in graminit.h.
88-
There's code in compile.c that checks that they are the same. */
94+
/* These definitions must match corresponding definitions in graminit.h. */
8995
#define Py_single_input 256
9096
#define Py_file_input 257
9197
#define Py_eval_input 258
98+
#define Py_func_type_input 345
9299

93100
#endif /* !Py_COMPILE_H */

0 commit comments

Comments
 (0)