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
c6d210ca
Kaydet (Commit)
c6d210ca
authored
Mar 16, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Get rid of last vestiges of BINARY_DIVIDE.
üst
e4993c7a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
29 deletions
+3
-29
libdis.tex
Doc/lib/libdis.tex
+0
-5
opcode.h
Include/opcode.h
+1
-1
pycodegen.py
Lib/compiler/pycodegen.py
+1
-3
opcode.py
Lib/opcode.py
+1
-1
ceval.c
Python/ceval.c
+0
-13
compile.c
Python/compile.c
+0
-6
No files found.
Doc/lib/libdis.tex
Dosyayı görüntüle @
c6d210ca
...
...
@@ -189,11 +189,6 @@ Implements \code{TOS = TOS1 ** TOS}.
Implements
\code
{
TOS = TOS1 * TOS
}
.
\end{opcodedesc}
\begin{opcodedesc}
{
BINARY
_
DIVIDE
}{}
Implements
\code
{
TOS = TOS1 / TOS
}
when
\code
{
from
__
future
__
import division
}
is not in effect.
\end{opcodedesc}
\begin{opcodedesc}
{
BINARY
_
FLOOR
_
DIVIDE
}{}
Implements
\code
{
TOS = TOS1 // TOS
}
.
\end{opcodedesc}
...
...
Include/opcode.h
Dosyayı görüntüle @
c6d210ca
...
...
@@ -26,7 +26,7 @@ extern "C" {
#define BINARY_POWER 19
#define BINARY_MULTIPLY 20
#define BINARY_DIVIDE 21
#define BINARY_MODULO 22
#define BINARY_ADD 23
#define BINARY_SUBTRACT 24
...
...
Lib/compiler/pycodegen.py
Dosyayı görüntüle @
c6d210ca
...
...
@@ -206,14 +206,12 @@ class CodeGenerator:
self
.
setups
=
misc
.
Stack
()
self
.
last_lineno
=
None
self
.
_setupGraphDelegation
()
self
.
_div_op
=
"BINARY_DIVIDE"
# XXX set flags based on future features
futures
=
self
.
get_module
()
.
futures
for
feature
in
futures
:
if
feature
==
"division"
:
self
.
graph
.
setFlag
(
CO_FUTURE_DIVISION
)
self
.
_div_op
=
"BINARY_TRUE_DIVIDE"
elif
feature
==
"absolute_import"
:
self
.
graph
.
setFlag
(
CO_FUTURE_ABSIMPORT
)
elif
feature
==
"with_statement"
:
...
...
@@ -1177,7 +1175,7 @@ class CodeGenerator:
return
self
.
binaryOp
(
node
,
'BINARY_MULTIPLY'
)
def
visitDiv
(
self
,
node
):
return
self
.
binaryOp
(
node
,
self
.
_div_op
)
return
self
.
binaryOp
(
node
,
'BINARY_TRUE_DIVIDE'
)
def
visitFloorDiv
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_FLOOR_DIVIDE'
)
...
...
Lib/opcode.py
Dosyayı görüntüle @
c6d210ca
...
...
@@ -61,7 +61,7 @@ def_op('UNARY_INVERT', 15)
def_op
(
'LIST_APPEND'
,
18
)
def_op
(
'BINARY_POWER'
,
19
)
def_op
(
'BINARY_MULTIPLY'
,
20
)
def_op
(
'BINARY_DIVIDE'
,
21
)
def_op
(
'BINARY_MODULO'
,
22
)
def_op
(
'BINARY_ADD'
,
23
)
def_op
(
'BINARY_SUBTRACT'
,
24
)
...
...
Python/ceval.c
Dosyayı görüntüle @
c6d210ca
...
...
@@ -1073,19 +1073,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throw)
if
(
x
!=
NULL
)
continue
;
break
;
case
BINARY_DIVIDE
:
if
(
!
_Py_QnewFlag
)
{
w
=
POP
();
v
=
TOP
();
x
=
PyNumber_Divide
(
v
,
w
);
Py_DECREF
(
v
);
Py_DECREF
(
w
);
SET_TOP
(
x
);
if
(
x
!=
NULL
)
continue
;
break
;
}
/* -Qnew is in effect: fall through to
BINARY_TRUE_DIVIDE */
case
BINARY_TRUE_DIVIDE
:
w
=
POP
();
v
=
TOP
();
...
...
Python/compile.c
Dosyayı görüntüle @
c6d210ca
...
...
@@ -479,11 +479,6 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
case
BINARY_MULTIPLY
:
newconst
=
PyNumber_Multiply
(
v
,
w
);
break
;
case
BINARY_DIVIDE
:
/* Cannot fold this operation statically since
the result can depend on the run-time presence
of the -Qnew flag */
return
0
;
case
BINARY_TRUE_DIVIDE
:
newconst
=
PyNumber_TrueDivide
(
v
,
w
);
break
;
...
...
@@ -1302,7 +1297,6 @@ opcode_stack_effect(int opcode, int oparg)
case
BINARY_POWER
:
case
BINARY_MULTIPLY
:
case
BINARY_DIVIDE
:
case
BINARY_MODULO
:
case
BINARY_ADD
:
case
BINARY_SUBTRACT
:
...
...
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