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
c6d210ca
Commit
c6d210ca
authored
Mar 16, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of last vestiges of BINARY_DIVIDE.
parent
e4993c7a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
29 deletions
+3
-29
Doc/lib/libdis.tex
Doc/lib/libdis.tex
+0
-5
Include/opcode.h
Include/opcode.h
+1
-1
Lib/compiler/pycodegen.py
Lib/compiler/pycodegen.py
+1
-3
Lib/opcode.py
Lib/opcode.py
+1
-1
Python/ceval.c
Python/ceval.c
+0
-13
Python/compile.c
Python/compile.c
+0
-6
No files found.
Doc/lib/libdis.tex
View file @
c6d210ca
...
@@ -189,11 +189,6 @@ Implements \code{TOS = TOS1 ** TOS}.
...
@@ -189,11 +189,6 @@ Implements \code{TOS = TOS1 ** TOS}.
Implements
\code
{
TOS = TOS1 * TOS
}
.
Implements
\code
{
TOS = TOS1 * TOS
}
.
\end{opcodedesc}
\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
}{}
\begin{opcodedesc}
{
BINARY
_
FLOOR
_
DIVIDE
}{}
Implements
\code
{
TOS = TOS1 // TOS
}
.
Implements
\code
{
TOS = TOS1 // TOS
}
.
\end{opcodedesc}
\end{opcodedesc}
...
...
Include/opcode.h
View file @
c6d210ca
...
@@ -26,7 +26,7 @@ extern "C" {
...
@@ -26,7 +26,7 @@ extern "C" {
#define BINARY_POWER 19
#define BINARY_POWER 19
#define BINARY_MULTIPLY 20
#define BINARY_MULTIPLY 20
#define BINARY_DIVIDE 21
#define BINARY_MODULO 22
#define BINARY_MODULO 22
#define BINARY_ADD 23
#define BINARY_ADD 23
#define BINARY_SUBTRACT 24
#define BINARY_SUBTRACT 24
...
...
Lib/compiler/pycodegen.py
View file @
c6d210ca
...
@@ -206,14 +206,12 @@ class CodeGenerator:
...
@@ -206,14 +206,12 @@ class CodeGenerator:
self
.
setups
=
misc
.
Stack
()
self
.
setups
=
misc
.
Stack
()
self
.
last_lineno
=
None
self
.
last_lineno
=
None
self
.
_setupGraphDelegation
()
self
.
_setupGraphDelegation
()
self
.
_div_op
=
"BINARY_DIVIDE"
# XXX set flags based on future features
# XXX set flags based on future features
futures
=
self
.
get_module
().
futures
futures
=
self
.
get_module
().
futures
for
feature
in
futures
:
for
feature
in
futures
:
if
feature
==
"division"
:
if
feature
==
"division"
:
self
.
graph
.
setFlag
(
CO_FUTURE_DIVISION
)
self
.
graph
.
setFlag
(
CO_FUTURE_DIVISION
)
self
.
_div_op
=
"BINARY_TRUE_DIVIDE"
elif
feature
==
"absolute_import"
:
elif
feature
==
"absolute_import"
:
self
.
graph
.
setFlag
(
CO_FUTURE_ABSIMPORT
)
self
.
graph
.
setFlag
(
CO_FUTURE_ABSIMPORT
)
elif
feature
==
"with_statement"
:
elif
feature
==
"with_statement"
:
...
@@ -1177,7 +1175,7 @@ class CodeGenerator:
...
@@ -1177,7 +1175,7 @@ class CodeGenerator:
return
self
.
binaryOp
(
node
,
'BINARY_MULTIPLY'
)
return
self
.
binaryOp
(
node
,
'BINARY_MULTIPLY'
)
def
visitDiv
(
self
,
node
):
def
visitDiv
(
self
,
node
):
return
self
.
binaryOp
(
node
,
self
.
_div_op
)
return
self
.
binaryOp
(
node
,
'BINARY_TRUE_DIVIDE'
)
def
visitFloorDiv
(
self
,
node
):
def
visitFloorDiv
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_FLOOR_DIVIDE'
)
return
self
.
binaryOp
(
node
,
'BINARY_FLOOR_DIVIDE'
)
...
...
Lib/opcode.py
View file @
c6d210ca
...
@@ -61,7 +61,7 @@ def_op('UNARY_INVERT', 15)
...
@@ -61,7 +61,7 @@ def_op('UNARY_INVERT', 15)
def_op
(
'LIST_APPEND'
,
18
)
def_op
(
'LIST_APPEND'
,
18
)
def_op
(
'BINARY_POWER'
,
19
)
def_op
(
'BINARY_POWER'
,
19
)
def_op
(
'BINARY_MULTIPLY'
,
20
)
def_op
(
'BINARY_MULTIPLY'
,
20
)
def_op
(
'BINARY_DIVIDE'
,
21
)
def_op
(
'BINARY_MODULO'
,
22
)
def_op
(
'BINARY_MODULO'
,
22
)
def_op
(
'BINARY_ADD'
,
23
)
def_op
(
'BINARY_ADD'
,
23
)
def_op
(
'BINARY_SUBTRACT'
,
24
)
def_op
(
'BINARY_SUBTRACT'
,
24
)
...
...
Python/ceval.c
View file @
c6d210ca
...
@@ -1073,19 +1073,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throw)
...
@@ -1073,19 +1073,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throw)
if
(
x
!=
NULL
)
continue
;
if
(
x
!=
NULL
)
continue
;
break
;
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
:
case
BINARY_TRUE_DIVIDE
:
w
=
POP
();
w
=
POP
();
v
=
TOP
();
v
=
TOP
();
...
...
Python/compile.c
View file @
c6d210ca
...
@@ -479,11 +479,6 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
...
@@ -479,11 +479,6 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
case
BINARY_MULTIPLY
:
case
BINARY_MULTIPLY
:
newconst
=
PyNumber_Multiply
(
v
,
w
);
newconst
=
PyNumber_Multiply
(
v
,
w
);
break
;
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
:
case
BINARY_TRUE_DIVIDE
:
newconst
=
PyNumber_TrueDivide
(
v
,
w
);
newconst
=
PyNumber_TrueDivide
(
v
,
w
);
break
;
break
;
...
@@ -1302,7 +1297,6 @@ opcode_stack_effect(int opcode, int oparg)
...
@@ -1302,7 +1297,6 @@ opcode_stack_effect(int opcode, int oparg)
case
BINARY_POWER
:
case
BINARY_POWER
:
case
BINARY_MULTIPLY
:
case
BINARY_MULTIPLY
:
case
BINARY_DIVIDE
:
case
BINARY_MODULO
:
case
BINARY_MODULO
:
case
BINARY_ADD
:
case
BINARY_ADD
:
case
BINARY_SUBTRACT
:
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