8000 revert unicode · python/cpython@8274425 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8274425

Browse files
revert unicode
1 parent 3356eda commit 8274425

File tree

7 files changed

+27
-44
lines changed

7 files changed

+27
-44
lines changed

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ extern "C" {
1212
#include "pycore_fileutils.h" // _Py_error_handler
1313
#include "pycore_identifier.h" // _Py_Identifier
1414
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
15-
#include "pycore_stackref.h" // _PyStackRef
1615

1716
/* --- Characters Type APIs ----------------------------------------------- */
1817

@@ -209,12 +208,6 @@ PyAPI_FUNC(PyObject*) _PyUnicode_JoinArray(
209208
Py_ssize_t seqlen
210209
);
211210

212-
PyAPI_FUNC(PyObject*) _PyUnicode_JoinStackRef(
213-
PyObject *separator,
214-
_PyStackRef const *items,
215-
Py_ssize_t seqlen
216-
);
217-
218211
/* Test whether a unicode is equal to ASCII identifier. Return 1 if true,
219212
0 otherwise. The right argument must be ASCII identifier.
220213
Any error occurs inside will be cleared before return. */

Include/internal/pycore_uop_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/unicodeobject.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9820,38 +9820,6 @@ _PyUnicode_JoinArray(PyObject *separator, PyObject *const *items, Py_ssize_t seq
98209820
return NULL;
98219821
}
98229822

9823-
PyObject*
9824-
_PyUnicode_JoinStackRef_Slow(PyObject *separator, _PyStackRef const *tagged, Py_ssize_t seqlen)
9825-
{
9826-
PyObject **args = PyMem_Malloc(seqlen * sizeof(PyObject *));
9827-
if (args == NULL) {
9828-
PyErr_NoMemory();
9829-
return NULL;
9830-
}
9831-
_PyObjectStack_FromStackRefStack(args, tagged, seqlen);
9832-
PyObject *res = _PyUnicode_JoinArray(separator, args, seqlen);
9833-
PyMem_Free(args);
9834-
return res;
9835-
}
9836-
9837-
#define MAX_UNTAG_SCRATCH 10
9838-
9839-
PyObject *
9840-
_PyUnicode_JoinStackRef(PyObject *separator, _PyStackRef const *items_tagged, Py_ssize_t seqlen)
9841-
{
9842-
#ifdef Py_GIL_DISABLED
9843-
PyObject *args[MAX_UNTAG_SCRATCH];
9844-
if (seqlen > MAX_UNTAG_SCRATCH) {
9845-
return _PyUnicode_JoinStackRef_Slow(separator, items_tagged, seqlen);
9846-
}
9847-
_PyObjectStack_FromStackRefStack(args, items_tagged, seqlen);
9848-
return _PyUnicode_JoinArray(separator, args, seqlen);
9849-
#else
9850-
(void)_PyUnicode_JoinStackRef_Slow;
9851-
return _PyUnicode_JoinArray(separator, (PyObject **)items_tagged, seqlen);
9852-
#endif
9853-
}
9854-
98559823
void
98569824
_PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length,
98579825
Py_UCS4 fill_char)

Python/bytecodes.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,13 @@ dummy_func(
17691769
}
17701770

17711771
inst(BUILD_STRING, (pieces[oparg] -- str)) {
1772-
PyObject *str_o = _PyUnicode_JoinStackRef(&_Py_STR(empty), pieces, oparg);
1772+
STACKREFS_TO_PYOBJECTS(pieces, oparg, pieces_o);
1773+
if (pieces_o == NULL) {
1774+
DECREF_INPUTS();
1775+
ERROR_IF(true, error);
1776+
}
1777+
PyObject *str_o = _PyUnicode_JoinArray(&_Py_STR(empty), pieces_o, oparg);
1778+
STACKREFS_TO_PYOBJECTS_CLEANUP(pieces_o);
17731779
DECREF_INPUTS();
17741780
ERROR_IF(str_o == NULL, error);
17751781
str = PyStackRef_FromPyObjectSteal(str_o);

Python/executor_cases.c.h

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0