Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
59543347
Kaydet (Commit)
59543347
authored
Haz 18, 2019
tarafından
Jeroen Demeyer
Kaydeden (comit)
Inada Naoki
Haz 18, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-37151: remove _PyFunction_FastCallDict (GH-13864)
üst
d8f336fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
106 deletions
+1
-106
funcobject.h
Include/funcobject.h
+0
-6
call.c
Objects/call.c
+0
-88
funcobject.c
Objects/funcobject.c
+1
-12
No files found.
Include/funcobject.h
Dosyayı görüntüle @
59543347
...
@@ -60,12 +60,6 @@ PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
...
@@ -60,12 +60,6 @@ PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
PyAPI_FUNC
(
int
)
PyFunction_SetAnnotations
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyFunction_SetAnnotations
(
PyObject
*
,
PyObject
*
);
#ifndef Py_LIMITED_API
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyFunction_FastCallDict
(
PyObject
*
func
,
PyObject
*
const
*
args
,
Py_ssize_t
nargs
,
PyObject
*
kwargs
);
PyAPI_FUNC
(
PyObject
*
)
_PyFunction_Vectorcall
(
PyAPI_FUNC
(
PyObject
*
)
_PyFunction_Vectorcall
(
PyObject
*
func
,
PyObject
*
func
,
PyObject
*
const
*
stack
,
PyObject
*
const
*
stack
,
...
...
Objects/call.c
Dosyayı görüntüle @
59543347
...
@@ -303,94 +303,6 @@ function_code_fastcall(PyCodeObject *co, PyObject *const *args, Py_ssize_t nargs
...
@@ -303,94 +303,6 @@ function_code_fastcall(PyCodeObject *co, PyObject *const *args, Py_ssize_t nargs
}
}
PyObject
*
_PyFunction_FastCallDict
(
PyObject
*
func
,
PyObject
*
const
*
args
,
Py_ssize_t
nargs
,
PyObject
*
kwargs
)
{
PyCodeObject
*
co
=
(
PyCodeObject
*
)
PyFunction_GET_CODE
(
func
);
PyObject
*
globals
=
PyFunction_GET_GLOBALS
(
func
);
PyObject
*
argdefs
=
PyFunction_GET_DEFAULTS
(
func
);
PyObject
*
kwdefs
,
*
closure
,
*
name
,
*
qualname
;
PyObject
*
kwtuple
,
**
k
;
PyObject
**
d
;
Py_ssize_t
nd
,
nk
;
PyObject
*
result
;
assert
(
func
!=
NULL
);
assert
(
nargs
>=
0
);
assert
(
nargs
==
0
||
args
!=
NULL
);
assert
(
kwargs
==
NULL
||
PyDict_Check
(
kwargs
));
if
(
co
->
co_kwonlyargcount
==
0
&&
(
kwargs
==
NULL
||
PyDict_GET_SIZE
(
kwargs
)
==
0
)
&&
(
co
->
co_flags
&
~
PyCF_MASK
)
==
(
CO_OPTIMIZED
|
CO_NEWLOCALS
|
CO_NOFREE
))
{
/* Fast paths */
if
(
argdefs
==
NULL
&&
co
->
co_argcount
==
nargs
)
{
return
function_code_fastcall
(
co
,
args
,
nargs
,
globals
);
}
else
if
(
nargs
==
0
&&
argdefs
!=
NULL
&&
co
->
co_argcount
==
PyTuple_GET_SIZE
(
argdefs
))
{
/* function called with no arguments, but all parameters have
a default value: use default values as arguments .*/
args
=
_PyTuple_ITEMS
(
argdefs
);
return
function_code_fastcall
(
co
,
args
,
PyTuple_GET_SIZE
(
argdefs
),
globals
);
}
}
nk
=
(
kwargs
!=
NULL
)
?
PyDict_GET_SIZE
(
kwargs
)
:
0
;
if
(
nk
!=
0
)
{
Py_ssize_t
pos
,
i
;
/* bpo-29318, bpo-27840: Caller and callee functions must not share
the dictionary: kwargs must be copied. */
kwtuple
=
PyTuple_New
(
2
*
nk
);
if
(
kwtuple
==
NULL
)
{
return
NULL
;
}
k
=
_PyTuple_ITEMS
(
kwtuple
);
pos
=
i
=
0
;
while
(
PyDict_Next
(
kwargs
,
&
pos
,
&
k
[
i
],
&
k
[
i
+
1
]))
{
/* We must hold strong references because keyword arguments can be
indirectly modified while the function is called:
see issue #2016 and test_extcall */
Py_INCREF
(
k
[
i
]);
Py_INCREF
(
k
[
i
+
1
]);
i
+=
2
;
}
assert
(
i
/
2
==
nk
);
}
else
{
kwtuple
=
NULL
;
k
=
NULL
;
}
kwdefs
=
PyFunction_GET_KW_DEFAULTS
(
func
);
closure
=
PyFunction_GET_CLOSURE
(
func
);
name
=
((
PyFunctionObject
*
)
func
)
->
func_name
;
qualname
=
((
PyFunctionObject
*
)
func
)
->
func_qualname
;
if
(
argdefs
!=
NULL
)
{
d
=
_PyTuple_ITEMS
(
argdefs
);
nd
=
PyTuple_GET_SIZE
(
argdefs
);
}
else
{
d
=
NULL
;
nd
=
0
;
}
result
=
_PyEval_EvalCodeWithName
((
PyObject
*
)
co
,
globals
,
(
PyObject
*
)
NULL
,
args
,
nargs
,
k
,
k
!=
NULL
?
k
+
1
:
NULL
,
nk
,
2
,
d
,
nd
,
kwdefs
,
closure
,
name
,
qualname
);
Py_XDECREF
(
kwtuple
);
return
result
;
}
PyObject
*
PyObject
*
_PyFunction_Vectorcall
(
PyObject
*
func
,
PyObject
*
const
*
stack
,
_PyFunction_Vectorcall
(
PyObject
*
func
,
PyObject
*
const
*
stack
,
size_t
nargsf
,
PyObject
*
kwnames
)
size_t
nargsf
,
PyObject
*
kwnames
)
...
...
Objects/funcobject.c
Dosyayı görüntüle @
59543347
...
@@ -622,17 +622,6 @@ func_traverse(PyFunctionObject *f, visitproc visit, void *arg)
...
@@ -622,17 +622,6 @@ func_traverse(PyFunctionObject *f, visitproc visit, void *arg)
return
0
;
return
0
;
}
}
static
PyObject
*
function_call
(
PyObject
*
func
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
PyObject
**
stack
;
Py_ssize_t
nargs
;
stack
=
_PyTuple_ITEMS
(
args
);
nargs
=
PyTuple_GET_SIZE
(
args
);
return
_PyFunction_FastCallDict
(
func
,
stack
,
nargs
,
kwargs
);
}
/* Bind a function to an object */
/* Bind a function to an object */
static
PyObject
*
static
PyObject
*
func_descr_get
(
PyObject
*
func
,
PyObject
*
obj
,
PyObject
*
type
)
func_descr_get
(
PyObject
*
func
,
PyObject
*
obj
,
PyObject
*
type
)
...
@@ -659,7 +648,7 @@ PyTypeObject PyFunction_Type = {
...
@@ -659,7 +648,7 @@ PyTypeObject PyFunction_Type = {
0
,
/* tp_as_sequence */
0
,
/* tp_as_sequence */
0
,
/* tp_as_mapping */
0
,
/* tp_as_mapping */
0
,
/* tp_hash */
0
,
/* tp_hash */
function_call
,
/* tp_call */
PyVectorcall_Call
,
/* tp_call */
0
,
/* tp_str */
0
,
/* tp_str */
0
,
/* tp_getattro */
0
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_setattro */
...
...
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