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
da9c5134
Kaydet (Commit)
da9c5134
authored
Haz 27, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27255: Added more predictions in ceval.c.
üst
61d1e999
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
ceval.c
Python/ceval.c
+12
-2
No files found.
Python/ceval.c
Dosyayı görüntüle @
da9c5134
...
@@ -1000,8 +1000,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -1000,8 +1000,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
/* OpCode prediction macros
/* OpCode prediction macros
Some opcodes tend to come in pairs thus making it possible to
Some opcodes tend to come in pairs thus making it possible to
predict the second code when the first is run. For example,
predict the second code when the first is run. For example,
COMPARE_OP is often followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And,
COMPARE_OP is often followed by POP_JUMP_IF_FALSE or POP_JUMP_IF_TRUE.
those opcodes are often followed by a POP_TOP.
Verifying the prediction costs a single high-speed test of a register
Verifying the prediction costs a single high-speed test of a register
variable against a constant. If the pairing was good, then the
variable against a constant. If the pairing was good, then the
...
@@ -1379,6 +1378,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -1379,6 +1378,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
FAST_DISPATCH
();
FAST_DISPATCH
();
}
}
PREDICTED
(
LOAD_CONST
);
TARGET
(
LOAD_CONST
)
{
TARGET
(
LOAD_CONST
)
{
PyObject
*
value
=
GETITEM
(
consts
,
oparg
);
PyObject
*
value
=
GETITEM
(
consts
,
oparg
);
Py_INCREF
(
value
);
Py_INCREF
(
value
);
...
@@ -2008,6 +2008,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -2008,6 +2008,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
}
SET_TOP
(
awaitable
);
SET_TOP
(
awaitable
);
PREDICT
(
LOAD_CONST
);
DISPATCH
();
DISPATCH
();
}
}
...
@@ -2050,9 +2051,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -2050,9 +2051,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
Py_DECREF
(
next_iter
);
Py_DECREF
(
next_iter
);
PUSH
(
awaitable
);
PUSH
(
awaitable
);
PREDICT
(
LOAD_CONST
);
DISPATCH
();
DISPATCH
();
}
}
PREDICTED
(
GET_AWAITABLE
);
TARGET
(
GET_AWAITABLE
)
{
TARGET
(
GET_AWAITABLE
)
{
PyObject
*
iterable
=
TOP
();
PyObject
*
iterable
=
TOP
();
PyObject
*
iter
=
_PyCoro_GetAwaitableIter
(
iterable
);
PyObject
*
iter
=
_PyCoro_GetAwaitableIter
(
iterable
);
...
@@ -2080,6 +2083,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -2080,6 +2083,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
goto
error
;
goto
error
;
}
}
PREDICT
(
LOAD_CONST
);
DISPATCH
();
DISPATCH
();
}
}
...
@@ -2135,6 +2139,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -2135,6 +2139,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
DISPATCH
();
DISPATCH
();
}
}
PREDICTED
(
POP_BLOCK
);
TARGET
(
POP_BLOCK
)
{
TARGET
(
POP_BLOCK
)
{
PyTryBlock
*
b
=
PyFrame_BlockPop
(
f
);
PyTryBlock
*
b
=
PyFrame_BlockPop
(
f
);
UNWIND_BLOCK
(
b
);
UNWIND_BLOCK
(
b
);
...
@@ -3015,6 +3020,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -3015,6 +3020,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if
(
iter
==
NULL
)
if
(
iter
==
NULL
)
goto
error
;
goto
error
;
PREDICT
(
FOR_ITER
);
PREDICT
(
FOR_ITER
);
PREDICT
(
CALL_FUNCTION
);
DISPATCH
();
DISPATCH
();
}
}
...
@@ -3043,6 +3049,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -3043,6 +3049,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if
(
iter
==
NULL
)
if
(
iter
==
NULL
)
goto
error
;
goto
error
;
}
}
PREDICT
(
LOAD_CONST
);
DISPATCH
();
DISPATCH
();
}
}
...
@@ -3068,6 +3075,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -3068,6 +3075,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
STACKADJ
(
-
1
);
STACKADJ
(
-
1
);
Py_DECREF
(
iter
);
Py_DECREF
(
iter
);
JUMPBY
(
oparg
);
JUMPBY
(
oparg
);
PREDICT
(
POP_BLOCK
);
DISPATCH
();
DISPATCH
();
}
}
...
@@ -3117,6 +3125,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -3117,6 +3125,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if
(
res
==
NULL
)
if
(
res
==
NULL
)
goto
error
;
goto
error
;
PUSH
(
res
);
PUSH
(
res
);
PREDICT
(
GET_AWAITABLE
);
DISPATCH
();
DISPATCH
();
}
}
...
@@ -3265,6 +3274,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -3265,6 +3274,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
DISPATCH
();
DISPATCH
();
}
}
PREDICTED
(
CALL_FUNCTION
);
TARGET
(
CALL_FUNCTION
)
{
TARGET
(
CALL_FUNCTION
)
{
PyObject
**
sp
,
*
res
;
PyObject
**
sp
,
*
res
;
PCALL
(
PCALL_ALL
);
PCALL
(
PCALL_ALL
);
...
...
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