Skip to content

Commit b629461

Browse files
committed
Replace PyTruffle C function prefix with GraalPyPrivate_
1 parent cb4c1e7 commit b629461

File tree

91 files changed

+814
-817
lines changed

Some content is hidden

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

91 files changed

+814
-817
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -756,12 +756,12 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
756756
(PyList_Check(o) ? PyList_GET_ITEM((o), (i)) : PyTuple_GET_ITEM((o), (i)))
757757

758758
// GraalPy-specific
759-
PyAPI_FUNC(PyObject **) PyTruffleSequence_Fast_ITEMS(PyObject *o);
759+
PyAPI_FUNC(PyObject **) GraalPyPrivate_Sequence_Fast_ITEMS(PyObject *o);
760760

761761
/* Return a pointer to the underlying item array for
762762
an object returned by PySequence_Fast */
763763
// GraalPy change
764-
#define PySequence_Fast_ITEMS(sf) PyTruffleSequence_Fast_ITEMS(sf)
764+
#define PySequence_Fast_ITEMS(sf) GraalPyPrivate_Sequence_Fast_ITEMS(sf)
765765

766766
/* Return the number of occurrences on value on 'o', that is, return
767767
the number of keys for which o[key] == value.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -166,12 +166,12 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
166166
/* === Sequence protocol ================================================ */
167167

168168
// GraalPy-specific
169-
PyAPI_FUNC(PyObject*) PyTruffleSequence_ITEM(PyObject* obj, Py_ssize_t index);
169+
PyAPI_FUNC(PyObject*) GraalPyPrivate_Sequence_ITEM(PyObject* obj, Py_ssize_t index);
170170

171171
/* Assume tp_as_sequence and sq_item exist and that 'i' does not
172172
need to be corrected for a negative index. */
173173
// GraalPy change
174-
#define PySequence_ITEM(o, i) PyTruffleSequence_ITEM((o), (i))
174+
#define PySequence_ITEM(o, i) GraalPyPrivate_Sequence_ITEM((o), (i))
175175

176176
#define PY_ITERSEARCH_COUNT 1
177177
#define PY_ITERSEARCH_INDEX 2

graalpython/com.oracle.graal.python.cext/include/cpython/listobject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2022, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2022 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -44,11 +44,11 @@ static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) {
4444
#define PyList_GET_ITEM(op, index) (PyList_GetItem((PyObject*)(op), (index)))
4545

4646
// GraalPy-specific
47-
PyAPI_FUNC(PyObject **) PyTruffleList_GetItems(PyObject *op);
47+
PyAPI_FUNC(PyObject **) GraalPyPrivate_List_GetItems(PyObject *op);
4848

4949
static inline void
5050
PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
51-
PyTruffleList_GetItems(op)[index] = value;
51+
GraalPyPrivate_List_GetItems(op)[index] = value;
5252
}
5353
#define PyList_SET_ITEM(op, index, value) \
5454
PyList_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value))

graalpython/com.oracle.graal.python.cext/include/cpython/tupleobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ PyAPI_FUNC(PyObject *) _PyTuple_GET_ITEM(PyObject *, Py_ssize_t);
3535
#define PyTuple_GET_ITEM(op, index) _PyTuple_GET_ITEM(_PyObject_CAST(op), (index))
3636

3737
// GraalPy-specific
38-
PyAPI_FUNC(PyObject **) PyTruffleTuple_GetItems(PyObject *op);
38+
PyAPI_FUNC(PyObject **) GraalPyPrivate_Tuple_GetItems(PyObject *op);
3939

4040
// GraalPy change: Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
4141
PyAPI_FUNC(void) PyTuple_SET_ITEM(PyObject*, Py_ssize_t, PyObject*);
4242

4343
/* Inline function to be used in the PyTuple_SET_ITEM macro. */
4444
static inline void graalpy_tuple_set_item(PyObject *op, Py_ssize_t index, PyObject *value) {
45-
PyTruffleTuple_GetItems(op)[index] = value;
45+
GraalPyPrivate_Tuple_GetItems(op)[index] = value;
4646
}
4747
#define PyTuple_SET_ITEM(op, index, value) \
4848
graalpy_tuple_set_item(_PyObject_CAST(op), (index), _PyObject_CAST(value))

graalpython/com.oracle.graal.python.cext/include/cpython/unicodeobject.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
201201
#define SSTATE_INTERNED_IMMORTAL_STATIC 3
202202

203203
/* Use only if you know it's a string */
204-
PyAPI_FUNC(unsigned int) PyTruffleUnicode_CHECK_INTERNED(PyObject *op);
204+
PyAPI_FUNC(unsigned int) GraalPyPrivate_Unicode_CHECK_INTERNED(PyObject *op);
205205
static inline unsigned int PyUnicode_CHECK_INTERNED(PyObject *op) {
206-
return PyTruffleUnicode_CHECK_INTERNED(op);
206+
return GraalPyPrivate_Unicode_CHECK_INTERNED(op);
207207
}
208208
#define PyUnicode_CHECK_INTERNED(op) PyUnicode_CHECK_INTERNED(_PyObject_CAST(op))
209209

@@ -216,17 +216,17 @@ static inline unsigned int PyUnicode_IS_READY(PyObject* Py_UNUSED(op)) {
216216
/* Return true if the string contains only ASCII characters, or 0 if not. The
217217
string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be
218218
ready. */
219-
PyAPI_FUNC(unsigned int) PyTruffleUnicode_IS_ASCII(PyObject *op);
219+
PyAPI_FUNC(unsigned int) GraalPyPrivate_Unicode_IS_ASCII(PyObject *op);
220220
static inline unsigned int PyUnicode_IS_ASCII(PyObject *op) {
221-
return PyTruffleUnicode_IS_ASCII(op);
221+
return GraalPyPrivate_Unicode_IS_ASCII(op);
222222
}
223223
#define PyUnicode_IS_ASCII(op) PyUnicode_IS_ASCII(_PyObject_CAST(op))
224224

225225
/* Return true if the string is compact or 0 if not.
226226
No type checks or Ready calls are performed. */
227-
PyAPI_FUNC(unsigned int) PyTruffleUnicode_IS_COMPACT(PyObject *op);
227+
PyAPI_FUNC(unsigned int) GraalPyPrivate_Unicode_IS_COMPACT(PyObject *op);
228228
static inline unsigned int PyUnicode_IS_COMPACT(PyObject *op) {
229-
return PyTruffleUnicode_IS_COMPACT(op);
229+
return GraalPyPrivate_Unicode_IS_COMPACT(op);
230230
}
231231
#define PyUnicode_IS_COMPACT(op) PyUnicode_IS_COMPACT(_PyObject_CAST(op))
232232

@@ -244,24 +244,24 @@ enum PyUnicode_Kind {
244244
PyUnicode_4BYTE_KIND = 4
245245
};
246246

247-
PyAPI_FUNC(int) PyTruffleUnicode_KIND(PyObject*);
247+
PyAPI_FUNC(int) GraalPyPrivate_Unicode_KIND(PyObject*);
248248
// PyUnicode_KIND(): Return one of the PyUnicode_*_KIND values defined above.
249249
//
250250
// gh-89653: Converting this macro to a static inline function would introduce
251251
// new compiler warnings on "kind < PyUnicode_KIND(str)" (compare signed and
252252
// unsigned numbers) where kind type is an int or on
253253
// "unsigned int kind = PyUnicode_KIND(str)" (cast signed to unsigned).
254-
#define PyUnicode_KIND(op) ((enum PyUnicode_Kind)PyTruffleUnicode_KIND(_PyObject_CAST(op)))
254+
#define PyUnicode_KIND(op) ((enum PyUnicode_Kind)GraalPyPrivate_Unicode_KIND(_PyObject_CAST(op)))
255255

256256
/* Return a void pointer to the raw unicode buffer. */
257257
static inline void* _PyUnicode_COMPACT_DATA(PyObject *Py_UNUSED(op)) {
258258
// strings are never compact in GraalPy
259259
return NULL;
260260
}
261261

262-
PyAPI_FUNC(void*) PyTruffleUnicode_NONCOMPACT_DATA(PyObject *op);
262+
PyAPI_FUNC(void*) GraalPyPrivate_Unicode_NONCOMPACT_DATA(PyObject *op);
263263
static inline void* _PyUnicode_NONCOMPACT_DATA(PyObject *op) {
264-
return PyTruffleUnicode_NONCOMPACT_DATA(op);
264+
return GraalPyPrivate_Unicode_NONCOMPACT_DATA(op);
265265
}
266266

267267
static inline void* PyUnicode_DATA(PyObject *op) {
@@ -282,9 +282,9 @@ static inline void* PyUnicode_DATA(PyObject *op) {
282282
#define PyUnicode_4BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS4*, PyUnicode_DATA(op))
283283

284284
/* Returns the length of the unicode string. */
285-
PyAPI_FUNC(Py_ssize_t) PyTruffleUnicode_GET_LENGTH(PyObject *op);
285+
PyAPI_FUNC(Py_ssize_t) GraalPyPrivate_Unicode_GET_LENGTH(PyObject *op);
286286
static inline Py_ssize_t PyUnicode_GET_LENGTH(PyObject *op) {
287-
return PyTruffleUnicode_GET_LENGTH(op);
287+
return GraalPyPrivate_Unicode_GET_LENGTH(op);
288288
}
289289
#define PyUnicode_GET_LENGTH(op) PyUnicode_GET_LENGTH(_PyObject_CAST(op))
290290

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -119,37 +119,37 @@ typedef struct
119119
} PyDateTime_DateTime; /* hastzinfo true */
120120

121121

122-
PyAPI_FUNC(PyObject*) PyTruffle_PyDateTime_GET_TZINFO(PyObject*);
123-
PyAPI_FUNC(long) PyTruffle_PyDateTime_GET_LONG_FIELD(PyObject* o, const char* field_name);
122+
PyAPI_FUNC(PyObject*) GraalPyPrivate_PyDateTime_GET_TZINFO(PyObject*);
123+
PyAPI_FUNC(long) GraalPyPrivate_PyDateTime_GET_LONG_FIELD(PyObject* o, const char* field_name);
124124

125125
/* Apply for date and datetime instances. */
126126

127127
// o is a pointer to a time or a datetime object.
128-
#define _PyDateTime_HAS_TZINFO(o) (PyTruffle_PyDateTime_GET_TZINFO((PyObject*)o) != Py_None)
128+
#define _PyDateTime_HAS_TZINFO(o) (GraalPyPrivate_PyDateTime_GET_TZINFO((PyObject*)o) != Py_None)
129129

130-
#define PyDateTime_GET_YEAR(o) ((int)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "year"))
131-
#define PyDateTime_GET_MONTH(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "month"))
132-
#define PyDateTime_GET_DAY(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "day"))
130+
#define PyDateTime_GET_YEAR(o) ((int)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "year"))
131+
#define PyDateTime_GET_MONTH(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "month"))
132+
#define PyDateTime_GET_DAY(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "day"))
133133

134-
#define PyDateTime_DATE_GET_HOUR(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "hour"))
135-
#define PyDateTime_DATE_GET_MINUTE(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "minute"))
136-
#define PyDateTime_DATE_GET_SECOND(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "second"))
137-
#define PyDateTime_DATE_GET_MICROSECOND(o) ((int)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "microsecond"))
138-
#define PyDateTime_DATE_GET_FOLD(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "fold"))
139-
#define PyDateTime_DATE_GET_TZINFO(o) (PyTruffle_PyDateTime_GET_TZINFO((PyObject*)o))
134+
#define PyDateTime_DATE_GET_HOUR(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "hour"))
135+
#define PyDateTime_DATE_GET_MINUTE(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "minute"))
136+
#define PyDateTime_DATE_GET_SECOND(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "second"))
137+
#define PyDateTime_DATE_GET_MICROSECOND(o) ((int)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "microsecond"))
138+
#define PyDateTime_DATE_GET_FOLD(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "fold"))
139+
#define PyDateTime_DATE_GET_TZINFO(o) (GraalPyPrivate_PyDateTime_GET_TZINFO((PyObject*)o))
140140

141141
/* Apply for time instances. */
142-
#define PyDateTime_TIME_GET_HOUR(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "hour"))
143-
#define PyDateTime_TIME_GET_MINUTE(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "minute"))
144-
#define PyDateTime_TIME_GET_SECOND(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "second"))
145-
#define PyDateTime_TIME_GET_MICROSECOND(o) ((int)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "microsecond"))
146-
#define PyDateTime_TIME_GET_FOLD(o) ((unsigned char)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "fold"))
147-
#define PyDateTime_TIME_GET_TZINFO(o) (PyTruffle_PyDateTime_GET_TZINFO((PyObject*)o))
142+
#define PyDateTime_TIME_GET_HOUR(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "hour"))
143+
#define PyDateTime_TIME_GET_MINUTE(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "minute"))
144+
#define PyDateTime_TIME_GET_SECOND(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "second"))
145+
#define PyDateTime_TIME_GET_MICROSECOND(o) ((int)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "microsecond"))
146+
#define PyDateTime_TIME_GET_FOLD(o) ((unsigned char)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "fold"))
147+
#define PyDateTime_TIME_GET_TZINFO(o) (GraalPyPrivate_PyDateTime_GET_TZINFO((PyObject*)o))
148148

149149
/* Apply for time delta instances */
150-
#define PyDateTime_DELTA_GET_DAYS(o) ((int)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "days"))
151-
#define PyDateTime_DELTA_GET_SECONDS(o) ((int)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "seconds"))
152-
#define PyDateTime_DELTA_GET_MICROSECONDS(o) ((int)PyTruffle_PyDateTime_GET_LONG_FIELD((PyObject*)o, "microseconds"))
150+
#define PyDateTime_DELTA_GET_DAYS(o) ((int)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "days"))
151+
#define PyDateTime_DELTA_GET_SECONDS(o) ((int)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "seconds"))
152+
#define PyDateTime_DELTA_GET_MICROSECONDS(o) ((int)GraalPyPrivate_PyDateTime_GET_LONG_FIELD((PyObject*)o, "microseconds"))
153153

154154

155155

graalpython/com.oracle.graal.python.cext/include/internal/pycore_long.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ PyAPI_FUNC(char*) _PyLong_FormatBytesWriter(
127127
#define SIGN_NEGATIVE 2
128128
#define NON_SIZE_BITS 3
129129

130-
PyAPI_FUNC(uintptr_t) PyTruffleLong_lv_tag(const PyLongObject *op);
130+
PyAPI_FUNC(uintptr_t) GraalPyPrivate_Long_lv_tag(const PyLongObject *op);
131131
/* The functions _PyLong_IsCompact and _PyLong_CompactValue are defined
132132
* in Include/cpython/longobject.h, since they need to be inline.
133133
*
@@ -156,7 +156,7 @@ _PyLong_IsNonNegativeCompact(const PyLongObject* op) {
156156
#if 0 // GraalPy change
157157
return op->long_value.lv_tag <= (1 << NON_SIZE_BITS);
158158
#else // GraalPy change
159-
return PyTruffleLong_lv_tag(op) <= (1 << NON_SIZE_BITS);
159+
return GraalPyPrivate_Long_lv_tag(op) <= (1 << NON_SIZE_BITS);
160160
#endif // GraalPy change
161161
}
162162

@@ -168,7 +168,7 @@ _PyLong_BothAreCompact(const PyLongObject* a, const PyLongObject* b) {
168168
#if 0 // GraalPy change
169169
return (a->long_value.lv_tag | b->long_value.lv_tag) < (2 << NON_SIZE_BITS);
170170
#else // GraalPy change
171-
return (PyTruffleLong_lv_tag(a) | PyTruffleLong_lv_tag(b)) < (2 << NON_SIZE_BITS);
171+
return (GraalPyPrivate_Long_lv_tag(a) | GraalPyPrivate_Long_lv_tag(b)) < (2 << NON_SIZE_BITS);
172172
#endif // GraalPy change
173173
}
174174

@@ -178,7 +178,7 @@ _PyLong_IsZero(const PyLongObject *op)
178178
#if 0 // GraalPy change
179179
return (op->long_value.lv_tag & SIGN_MASK) == SIGN_ZERO;
180180
#else // GraalPy change
181-
return (PyTruffleLong_lv_tag(op) & SIGN_MASK) == SIGN_ZERO;
181+
return (GraalPyPrivate_Long_lv_tag(op) & SIGN_MASK) == SIGN_ZERO;
182182
#endif // GraalPy change
183183
}
184184

@@ -188,7 +188,7 @@ _PyLong_IsNegative(const PyLongObject *op)
188188
#if 0 // GraalPy change
189189
return (op->long_value.lv_tag & SIGN_MASK) == SIGN_NEGATIVE;
190190
#else // GraalPy change
191-
return (PyTruffleLong_lv_tag(op) & SIGN_MASK) == SIGN_NEGATIVE;
191+
return (GraalPyPrivate_Long_lv_tag(op) & SIGN_MASK) == SIGN_NEGATIVE;
192192
#endif // GraalPy change
193193
}
194194

@@ -198,7 +198,7 @@ _PyLong_IsPositive(const PyLongObject *op)
198198
#if 0 // GraalPy change
199199
return (op->long_value.lv_tag & SIGN_MASK) == 0;
200200
#else // GraalPy change
201-
return (PyTruffleLong_lv_tag(op) & SIGN_MASK) == 0;
201+
return (GraalPyPrivate_Long_lv_tag(op) & SIGN_MASK) == 0;
202202
#endif // GraalPy change
203203
}
204204

@@ -209,10 +209,10 @@ _PyLong_DigitCount(const PyLongObject *op)
209209
#if 0 // GraalPy change
210210
return op->long_value.lv_tag >> NON_SIZE_BITS;
211211
#else // GraalPy change
212-
return PyTruffleLong_lv_tag(op) >> NON_SIZE_BITS;
212+
return GraalPyPrivate_Long_lv_tag(op) >> NON_SIZE_BITS;
213213
#endif // GraalPy change
214214
}
215-
215+
216216
/* Equivalent to _PyLong_DigitCount(op) * _PyLong_NonCompactSign(op) */
217217
static inline Py_ssize_t
218218
_PyLong_SignedDigitCount(const PyLongObject *op)
@@ -222,11 +222,11 @@ _PyLong_SignedDigitCount(const PyLongObject *op)
222222
Py_ssize_t sign = 1 - (op->long_value.lv_tag & SIGN_MASK);
223223
return sign * (Py_ssize_t)(op->long_value.lv_tag >> NON_SIZE_BITS);
224224
#else // GraalPy change
225-
Py_ssize_t sign = 1 - (PyTruffleLong_lv_tag(op) & SIGN_MASK);
226-
return sign * (Py_ssize_t)(PyTruffleLong_lv_tag(op) >> NON_SIZE_BITS);
225+
Py_ssize_t sign = 1 - (GraalPyPrivate_Long_lv_tag(op) & SIGN_MASK);
226+
return sign * (Py_ssize_t)(GraalPyPrivate_Long_lv_tag(op) >> NON_SIZE_BITS);
227227
#endif // GraalPy change
228228
}
229-
229+
230230

231231
static inline int
232232
_PyLong_CompactSign(const PyLongObject *op)
@@ -236,10 +236,10 @@ _PyLong_CompactSign(const PyLongObject *op)
236236
#if 0 // GraalPy change
237237
return 1 - (op->long_value.lv_tag & SIGN_MASK);
238238
#else // GraalPy change
239-
return 1 - (PyTruffleLong_lv_tag(op) & SIGN_MASK);
239+
return 1 - (GraalPyPrivate_Long_lv_tag(op) & SIGN_MASK);
240240
#endif // GraalPy change
241241
}
242-
242+
243243

244244
static inline int
245245
_PyLong_NonCompactSign(const PyLongObject *op)
@@ -249,10 +249,10 @@ _PyLong_NonCompactSign(const PyLongObject *op)
249249
#if 0 // GraalPy change
250250
return 1 - (op->long_value.lv_tag & SIGN_MASK);
251251
#else // GraalPy change
252-
return 1 - (PyTruffleLong_lv_tag(op) & SIGN_MASK);
252+
return 1 - (GraalPyPrivate_Long_lv_tag(op) & SIGN_MASK);
253253
#endif // GraalPy change
254254
}
255-
255+
256256

257257
/* Do a and b have the same sign? */
258258
static inline int
@@ -261,10 +261,10 @@ _PyLong_SameSign(const PyLongObject *a, const PyLongObject *b)
261261
#if 0 // GraalPy change
262262
return (a->long_value.lv_tag & SIGN_MASK) == (b->long_value.lv_tag & SIGN_MASK);
263263
#else // GraalPy change
264-
return (PyTruffleLong_lv_tag(a) & SIGN_MASK) == (PyTruffleLong_lv_tag(b) & SIGN_MASK);
264+
return (GraalPyPrivate_Long_lv_tag(a) & SIGN_MASK) == (GraalPyPrivate_Long_lv_tag(b) & SIGN_MASK);
265265
#endif // GraalPy change
266266
}
267-
267+
268268

269269
#define TAG_FROM_SIGN_AND_SIZE(sign, size) ((1 - (sign)) | ((size) << NON_SIZE_BITS))
270270

0 commit comments

Comments
 (0)