Skip to content

Commit 1210a26

Browse files
committed
[GR-8776] Use _sre as regex fallback engine.
PullRequest: graalpython/114
2 parents e123ddb + 9cce842 commit 1210a26

File tree

93 files changed

+14478
-1360
lines changed

Some content is hidden

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

93 files changed

+14478
-1360
lines changed

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

Lines changed: 100 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords(
260260
#define _PyObject_CallNoArg(func) \
261261
_PyObject_FastCallDict((func), NULL, 0, NULL)
262262

263+
#define _PyObject_CallArg1(func, arg) \
264+
_PyObject_FastCall((func), &(arg), 1)
265+
263266
PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(
264267
PyObject *callable,
265268
PyObject *obj,
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Copyright (c) 2018, Oracle and/or its affiliates.
2+
* Copyright (C) 1996-2017 Python Software Foundation
3+
*
4+
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
5+
*/
6+
7+
#ifndef Py_ITEROBJECT_H
8+
#define Py_ITEROBJECT_H
9+
/* Iterators (the basic kind, over a sequence) */
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
15+
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
16+
PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type;
17+
18+
#define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type)
19+
20+
PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
21+
22+
23+
#define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type)
24+
25+
PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
26+
27+
#ifdef __cplusplus
28+
}
29+
#endif
30+
#endif /* !Py_ITEROBJECT_H */
31+

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ PyAPI_FUNC(long long) PyLong_AsLongLongAndOverflow(PyObject *, int *);
9999

100100
PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
101101
#ifndef Py_LIMITED_API
102-
PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
102+
PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int) Py_DEPRECATED(3.3);
103103
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
104104
PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
105105
#endif
@@ -214,6 +214,11 @@ PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
214214
PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *);
215215
#endif /* !Py_LIMITED_API */
216216

217+
#ifndef Py_LIMITED_API
218+
PyAPI_DATA(PyObject *) _PyLong_Zero;
219+
PyAPI_DATA(PyObject *) _PyLong_One;
220+
#endif
221+
217222
#ifdef __cplusplus
218223
}
219224
#endif

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,8 @@ typedef struct _PyArg_Parser {
103103
#endif
104104
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
105105
struct _PyArg_Parser *, ...);
106-
PyAPI_FUNC(int) _PyArg_ParseStack(
107-
PyObject *const *args,
108-
Py_ssize_t nargs,
109-
const char *format,
110-
...);
106+
PyAPI_FUNC(int) _PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
107+
struct _PyArg_Parser *, ...);
111108
PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
112109
PyObject *const *args,
113110
Py_ssize_t nargs,

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

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -297,33 +297,36 @@ extern PyGC_Head *_PyGC_generation0;
297297

298298
/* Tell the GC to track this object. NB: While the object is tracked the
299299
* collector it must be safe to call the ob_traverse method. */
300-
#define _PyObject_GC_TRACK(o) do { \
301-
PyGC_Head *g = _Py_AS_GC(o); \
302-
if (_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED) \
303-
Py_FatalError("GC object already tracked"); \
304-
_PyGCHead_SET_REFS(g, _PyGC_REFS_REACHABLE); \
305-
g->gc.gc_next = _PyGC_generation0; \
306-
g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \
307-
g->gc.gc_prev->gc.gc_next = g; \
308-
_PyGC_generation0->gc.gc_prev = g; \
309-
} while (0);
300+
//#define _PyObject_GC_TRACK(o) do { \
301+
// PyGC_Head *g = _Py_AS_GC(o); \
302+
// if (_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED) \
303+
// Py_FatalError("GC object already tracked"); \
304+
// _PyGCHead_SET_REFS(g, _PyGC_REFS_REACHABLE); \
305+
// g->gc.gc_next = _PyGC_generation0; \
306+
// g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \
307+
// g->gc.gc_prev->gc.gc_next = g; \
308+
// _PyGC_generation0->gc.gc_prev = g; \
309+
// } while (0);
310+
#define _PyObject_GC_TRACK(o)
310311

311312
/* Tell the GC to stop tracking this object.
312313
* gc_next doesn't need to be set to NULL, but doing so is a good
313314
* way to provoke memory errors if calling code is confused.
314315
*/
315-
#define _PyObject_GC_UNTRACK(o) do { \
316-
PyGC_Head *g = _Py_AS_GC(o); \
317-
assert(_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED); \
318-
_PyGCHead_SET_REFS(g, _PyGC_REFS_UNTRACKED); \
319-
g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \
320-
g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \
321-
g->gc.gc_next = NULL; \
322-
} while (0);
316+
#define _PyObject_GC_UNTRACK(o)
317+
//#define _PyObject_GC_UNTRACK(o) do { \
318+
// PyGC_Head *g = _Py_AS_GC(o); \
319+
// assert(_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED); \
320+
// _PyGCHead_SET_REFS(g, _PyGC_REFS_UNTRACKED); \
321+
// g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \
322+
// g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \
323+
// g->gc.gc_next = NULL; \
324+
// } while (0);
323325

324326
/* True if the object is currently tracked by the GC. */
325-
#define _PyObject_GC_IS_TRACKED(o) \
326-
(_PyGC_REFS(o) != _PyGC_REFS_UNTRACKED)
327+
#define _PyObject_GC_IS_TRACKED(o) 0
328+
//#define _PyObject_GC_IS_TRACKED(o) \
329+
// (_PyGC_REFS(o) != _PyGC_REFS_UNTRACKED)
327330

328331
/* True if the object may be tracked by the GC in the future, or already is.
329332
This can be useful to implement some optimizations. */

0 commit comments

Comments
 (0)