Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f1b9abe3
Commit
f1b9abe3
authored
Feb 26, 2019
by
Sergey Fedoseev
Committed by
Victor Stinner
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36030: Remove _PyStack_AsTuple() and _PyStack_AsTupleSlice() (GH-12032)
parent
b5853e26
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
36 deletions
+6
-36
Include/cpython/abstract.h
Include/cpython/abstract.h
+0
-10
Objects/call.c
Objects/call.c
+4
-25
Python/bltinmodule.c
Python/bltinmodule.c
+2
-1
No files found.
Include/cpython/abstract.h
View file @
f1b9abe3
...
...
@@ -12,16 +12,6 @@ extern "C" {
# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
#endif
PyAPI_FUNC
(
PyObject
*
)
_PyStack_AsTuple
(
PyObject
*
const
*
stack
,
Py_ssize_t
nargs
);
PyAPI_FUNC
(
PyObject
*
)
_PyStack_AsTupleSlice
(
PyObject
*
const
*
stack
,
Py_ssize_t
nargs
,
Py_ssize_t
start
,
Py_ssize_t
end
);
/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
format to a Python dictionary ("kwargs" dict).
...
...
Objects/call.c
View file @
f1b9abe3
...
...
@@ -114,7 +114,7 @@ _PyObject_FastCallDict(PyObject *callable, PyObject *const *args, Py_ssize_t nar
return
NULL
;
}
argstuple
=
_Py
Stack_AsTuple
(
args
,
nargs
);
argstuple
=
_Py
Tuple_FromArray
(
args
,
nargs
);
if
(
argstuple
==
NULL
)
{
return
NULL
;
}
...
...
@@ -176,7 +176,7 @@ _PyObject_FastCallKeywords(PyObject *callable, PyObject *const *stack, Py_ssize_
return
NULL
;
}
argstuple
=
_Py
Stack_AsTuple
(
stack
,
nargs
);
argstuple
=
_Py
Tuple_FromArray
(
stack
,
nargs
);
if
(
argstuple
==
NULL
)
{
return
NULL
;
}
...
...
@@ -508,7 +508,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self,
case
METH_VARARGS
|
METH_KEYWORDS
:
{
/* Slow-path: create a temporary tuple for positional arguments */
PyObject
*
argstuple
=
_Py
Stack_AsTuple
(
args
,
nargs
);
PyObject
*
argstuple
=
_Py
Tuple_FromArray
(
args
,
nargs
);
if
(
argstuple
==
NULL
)
{
goto
exit
;
}
...
...
@@ -670,7 +670,7 @@ _PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self,
and a temporary dict for keyword arguments */
PyObject
*
argtuple
;
argtuple
=
_Py
Stack_AsTuple
(
args
,
nargs
);
argtuple
=
_Py
Tuple_FromArray
(
args
,
nargs
);
if
(
argtuple
==
NULL
)
{
goto
exit
;
}
...
...
@@ -1271,27 +1271,6 @@ PyObject_CallFunctionObjArgs(PyObject *callable, ...)
/* --- PyStack functions ------------------------------------------ */
/* Issue #29234: Inlining _PyStack_AsTuple() into callers increases their
stack consumption, Disable inlining to optimize the stack consumption. */
_Py_NO_INLINE
PyObject
*
_PyStack_AsTuple
(
PyObject
*
const
*
stack
,
Py_ssize_t
nargs
)
{
return
_PyTuple_FromArray
(
stack
,
nargs
);
}
PyObject
*
_PyStack_AsTupleSlice
(
PyObject
*
const
*
stack
,
Py_ssize_t
nargs
,
Py_ssize_t
start
,
Py_ssize_t
end
)
{
assert
(
0
<=
start
);
assert
(
end
<=
nargs
);
assert
(
start
<=
end
);
return
_PyTuple_FromArray
(
stack
+
start
,
end
-
start
);
}
PyObject
*
_PyStack_AsDict
(
PyObject
*
const
*
values
,
PyObject
*
kwnames
)
{
...
...
Python/bltinmodule.c
View file @
f1b9abe3
...
...
@@ -5,6 +5,7 @@
#include "ast.h"
#undef Yield
/* undefine macro conflicting with <winbase.h> */
#include "pycore_pystate.h"
#include "pycore_tupleobject.h"
_Py_IDENTIFIER
(
__builtins__
);
_Py_IDENTIFIER
(
__dict__
);
...
...
@@ -121,7 +122,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs,
"__build_class__: name is not a string"
);
return
NULL
;
}
orig_bases
=
_Py
Stack_AsTupleSlice
(
args
,
nargs
,
2
,
nargs
);
orig_bases
=
_Py
Tuple_FromArray
(
args
+
2
,
nargs
-
2
);
if
(
orig_bases
==
NULL
)
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment