Perform build and magnum tuning

Building o//third_party/python now takes 5 seconds on my PC

This change works towards modifying Python to use runtime dispatching
when appropriate. For example, when loading the magnums in the socket
module, it's a good idea to check if the magnum is zero, because that
means the local system platform doesn't support it.
This commit is contained in:
Justine Tunney 2021-08-10 10:26:13 -07:00
parent ee7e296339
commit d26d7ae0e4
1028 changed files with 6576 additions and 172777 deletions

View file

@ -1,12 +1,14 @@
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#include "third_party/python/Include/code.h"
COSMOPOLITAN_C_START_
#define Py_single_input 256
#define Py_file_input 257
#define Py_eval_input 258
#ifndef Py_LIMITED_API
#include "code.h"
#ifdef __cplusplus
extern "C" {
#endif
/* clang-format off */
/* Public interface */
struct _node; /* Declare the existence of this type */
@ -58,16 +60,6 @@ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
#define PY_INVALID_STACK_EFFECT INT_MAX
PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
#ifdef __cplusplus
}
#endif
#endif /* !Py_LIMITED_API */
/* These definitions must match corresponding definitions in graminit.h.
There's code in compile.c that checks that they are the same. */
#define Py_single_input 256
#define Py_file_input 257
#define Py_eval_input 258
COSMOPOLITAN_C_END_
#endif /* !Py_COMPILE_H */