Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14,963 changes: 14,963 additions & 0 deletions abi/abi-graalpy253.xml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion ci/graal/ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ local common_json = import "../common.json";
local _lv = std.strReplace(_labsjdk.version, "ee-", "jdk-");
# Skip the check if we are not using a labsjdk. This can happen on JDK integration branches.
local no_labsjdk = _labsjdk.name != "labsjdk";
assert no_labsjdk || std.startsWith(_lv, _ov) : "update oraclejdk-latest to match labsjdk-ee-latest: %s+%s vs %s" % [_oraclejdk.version, _oraclejdk.build_id, _labsjdk.version];
# Skip the check if we are using labsjdk with build number equal zero
local labsjdk_with_build_zero = std.findSubstr('+0-jvmci-', _lv) != [];
assert no_labsjdk || std.startsWith(_lv, _ov) || labsjdk_with_build_zero: "update oraclejdk-latest to match labsjdk-ee-latest: %s+%s vs %s" % [_oraclejdk.version, _oraclejdk.build_id, _labsjdk.version];
true,
# Verify labsjdk-ce-latest and labsjdk-ee-latest JVMCI build numbers match
assert
Expand Down
14 changes: 7 additions & 7 deletions ci/graal/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "7.84.1",
"mx_version": "7.85.1",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
Expand Down Expand Up @@ -49,12 +49,12 @@
"graalvm-ee-25-ea": {"name": "graalvm-jdk", "version": "25.0.0", "ea": "36", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25.0.4+7", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.4+7-jvmci-25.2-b20", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.4+7-jvmci-25.2-b20-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.4+7-jvmci-25.2-b20-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.4+7-jvmci-25.2-b20", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.4+7-jvmci-25.2-b20-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.4+7-jvmci-25.2-b20-sulong", "platformspecific": true }
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.4.1+0-jvmci-25.3-b21", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.4.1+0-jvmci-25.3-b21-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.4.1+0-jvmci-25.3-b21-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.4.1+0-jvmci-25.3-b21", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.4.1+0-jvmci-25.3-b21-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.4.1+0-jvmci-25.3-b21-sulong", "platformspecific": true }
},

"default_jdks" : ["labsjdk-ee-latest", "labsjdk-ce-latest"],
Expand Down
1 change: 1 addition & 0 deletions graalpython/com.oracle.graal.python.cext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ set(SRC_FILES ${CAPI_SRC}/codecs.c ${CAPI_SRC}/compile.c ${CAPI_SRC}/thread.c
${CAPI_SRC}/genobject.c ${CAPI_SRC}/methodobject.c ${CAPI_SRC}/boolobject.c ${CAPI_SRC}/pylifecycle.c
${CAPI_SRC}/errors.c ${CAPI_SRC}/signals.c ${CAPI_SRC}/datetime.c ${CAPI_SRC}/call.c
${CAPI_SRC}/getargs.c ${CAPI_SRC}/tracemalloc.c ${CAPI_SRC}/initconfig.c ${CAPI_SRC}/graalpy_stacktrace.c
${CAPI_SRC}/graalpyarray.c
${CAPI_SRC}/lock.c ${CAPI_SRC}/parking_lot.c
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
/* Copyright (c) 2018, 2026, Oracle and/or its affiliates.
* Copyright (C) 1996-2020 Python Software Foundation
*
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
Expand Down Expand Up @@ -26,19 +26,19 @@ PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);

/* GraalPy public API functions replacing direct PyCellObject field access. */
PyAPI_FUNC(PyObject *) GraalPyCell_GET(PyObject *op);
PyAPI_FUNC(void) GraalPyCell_SET(PyObject *op, PyObject *value);

static inline PyObject* PyCell_GET(PyObject *op) {
PyCellObject *cell;
assert(PyCell_Check(op));
cell = _Py_CAST(PyCellObject*, op);
return cell->ob_ref;
return GraalPyCell_GET(op);
}
#define PyCell_GET(op) PyCell_GET(_PyObject_CAST(op))

static inline void PyCell_SET(PyObject *op, PyObject *value) {
PyCellObject *cell;
assert(PyCell_Check(op));
cell = _Py_CAST(PyCellObject*, op);
cell->ob_ref = value;
GraalPyCell_SET(op, value);
}
#define PyCell_SET(op, value) PyCell_SET(_PyObject_CAST(op), (value))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,18 @@ PyAPI_DATA(PyTypeObject) PyCode_Type;

#define PyCode_Check(op) Py_IS_TYPE((op), &PyCode_Type)

/* GraalPy public API functions replacing direct PyCodeObject field access. */
PyAPI_FUNC(Py_ssize_t) GraalPyCode_GetNumFree(PyCodeObject *op);
PyAPI_FUNC(int) GraalPyCode_GetFirstFree(PyCodeObject *op);

static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) {
assert(PyCode_Check(op));
return op->co_nfreevars;
return GraalPyCode_GetNumFree(op);
}

static inline int PyUnstable_Code_GetFirstFree(PyCodeObject *op) {
assert(PyCode_Check(op));
return op->co_nlocalsplus - op->co_nfreevars;
return GraalPyCode_GetFirstFree(op);
}

Py_DEPRECATED(3.13) static inline int PyCode_GetFirstFree(PyCodeObject *op) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,15 @@ PyAPI_FUNC(PyObject *) PyDict_SetDefault(
// 1 if `key` was present and `default_value` was not inserted
PyAPI_FUNC(int) PyDict_SetDefaultRef(PyObject *mp, PyObject *key, PyObject *default_value, PyObject **result);

/* GraalPy public API function replacing direct PyDictObject field access. */
PyAPI_FUNC(Py_ssize_t) GraalPyDict_GET_SIZE(PyObject *op);

/* Get the number of items of a dictionary. */
static inline Py_ssize_t PyDict_GET_SIZE(PyObject *op) {
PyDictObject *mp;
assert(PyDict_Check(op));
mp = _Py_CAST(PyDictObject*, op);
#ifdef Py_GIL_DISABLED
return _Py_atomic_load_ssize_relaxed(&mp->ma_used);
#else
return mp->ma_used;
#endif
return GraalPyDict_GET_SIZE(op);
}
#define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),PyObject_Size((PyObject*) mp))
#define PyDict_GET_SIZE(op) PyDict_GET_SIZE(_PyObject_CAST(op))

PyAPI_FUNC(int) PyDict_ContainsString(PyObject *mp, const char *key);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,40 +89,50 @@ PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
#define _PyFunction_CAST(func) \
(assert(PyFunction_Check(func)), _Py_CAST(PyFunctionObject*, func))

/* GraalPy public API functions replacing direct PyFunctionObject field access.
Return borrowed references. */
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_CODE(PyObject *func);
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_GLOBALS(PyObject *func);
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_MODULE(PyObject *func);
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_DEFAULTS(PyObject *func);
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_KW_DEFAULTS(PyObject *func);
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_CLOSURE(PyObject *func);
PyAPI_FUNC(PyObject *) GraalPyFunction_GET_ANNOTATIONS(PyObject *func);

/* Static inline functions for direct access to these values.
Type checks are *not* done, so use with care. */
static inline PyObject* PyFunction_GET_CODE(PyObject *func) {
return _PyFunction_CAST(func)->func_code;
return GraalPyFunction_GET_CODE(func);
}
#define PyFunction_GET_CODE(func) PyFunction_GET_CODE(_PyObject_CAST(func))

static inline PyObject* PyFunction_GET_GLOBALS(PyObject *func) {
return _PyFunction_CAST(func)->func_globals;
return GraalPyFunction_GET_GLOBALS(func);
}
#define PyFunction_GET_GLOBALS(func) PyFunction_GET_GLOBALS(_PyObject_CAST(func))

static inline PyObject* PyFunction_GET_MODULE(PyObject *func) {
return _PyFunction_CAST(func)->func_module;
return GraalPyFunction_GET_MODULE(func);
}
#define PyFunction_GET_MODULE(func) PyFunction_GET_MODULE(_PyObject_CAST(func))

static inline PyObject* PyFunction_GET_DEFAULTS(PyObject *func) {
return _PyFunction_CAST(func)->func_defaults;
return GraalPyFunction_GET_DEFAULTS(func);
}
#define PyFunction_GET_DEFAULTS(func) PyFunction_GET_DEFAULTS(_PyObject_CAST(func))

static inline PyObject* PyFunction_GET_KW_DEFAULTS(PyObject *func) {
return _PyFunction_CAST(func)->func_kwdefaults;
return GraalPyFunction_GET_KW_DEFAULTS(func);
}
#define PyFunction_GET_KW_DEFAULTS(func) PyFunction_GET_KW_DEFAULTS(_PyObject_CAST(func))

static inline PyObject* PyFunction_GET_CLOSURE(PyObject *func) {
return _PyFunction_CAST(func)->func_closure;
return GraalPyFunction_GET_CLOSURE(func);
}
#define PyFunction_GET_CLOSURE(func) PyFunction_GET_CLOSURE(_PyObject_CAST(func))

static inline PyObject* PyFunction_GET_ANNOTATIONS(PyObject *func) {
return _PyFunction_CAST(func)->func_annotations;
return GraalPyFunction_GET_ANNOTATIONS(func);
}
#define PyFunction_GET_ANNOTATIONS(func) PyFunction_GET_ANNOTATIONS(_PyObject_CAST(func))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ typedef struct {

#define _PyMemoryView_CAST(op) _Py_CAST(PyMemoryViewObject*, op)

/* GraalPy public API functions replacing direct PyMemoryViewObject field access. */
PyAPI_FUNC(Py_buffer *) GraalPyMemoryView_GET_BUFFER(PyObject *op);
PyAPI_FUNC(PyObject *) GraalPyMemoryView_GET_BASE(PyObject *op);

/* Get a pointer to the memoryview's private copy of the exporter's buffer. */
static inline Py_buffer* PyMemoryView_GET_BUFFER(PyObject *op) {
return (&_PyMemoryView_CAST(op)->view);
return GraalPyMemoryView_GET_BUFFER(op);
}
#define PyMemoryView_GET_BUFFER(op) PyMemoryView_GET_BUFFER(_PyObject_CAST(op))

/* Get a pointer to the exporting object (this may be NULL!). */
static inline PyObject* PyMemoryView_GET_BASE(PyObject *op) {
return _PyMemoryView_CAST(op)->view.obj;
return GraalPyMemoryView_GET_BASE(op);
}
#define PyMemoryView_GET_BASE(op) PyMemoryView_GET_BASE(_PyObject_CAST(op))
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ PyAPI_FUNC(void) GraalPyTuple_SET_ITEM(PyObject*, Py_ssize_t, PyObject*);
/* Function *only* to be used to fill in brand new tuples */
static inline void
PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
PyTupleObject *tuple = _PyTuple_CAST(op);
assert(0 <= index);
assert(index < Py_SIZE(tuple));
assert(index < Py_SIZE(_PyTuple_CAST(op)));
GraalPyTuple_SET_ITEM(op, index, value);
}
#define PyTuple_SET_ITEM(op, index, value) \
Expand Down
11 changes: 11 additions & 0 deletions graalpython/com.oracle.graal.python.cext/include/listobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ PyAPI_FUNC(int) GraalPyArray_Resize(PyObject* array, Py_ssize_t new_size);
*/
PyAPI_FUNC(char*) GraalPyArray_Data(PyObject* array);

typedef struct GraalPyArray_Descriptor {
char typecode;
int itemsize;
} GraalPyArray_Descriptor;

/*
* GraalPy public API used by Cython's array module. Available since GraalPy 25.3.4.
*/
PyAPI_FUNC(GraalPyArray_Descriptor*) GraalPyArray_GetDescriptor(PyObject* array);
PyAPI_FUNC(PyObject*) GraalPyArray_New(PyObject* type, Py_ssize_t size, GraalPyArray_Descriptor* descriptor);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_LISTOBJECT_H
# include "cpython/listobject.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ PyAPI_DATA(const unsigned long) Py_Version;
PyAPI_FUNC(int) Py_IsFinalizing(void);
#endif

// GraalPy change: compatibility alias for pybind11
PyAPI_FUNC(int) _Py_IsFinalizing(void);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYLIFECYCLE_H
# include "cpython/pylifecycle.h"
Expand Down
Loading
Loading