Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
1d01207e
Commit
1d01207e
authored
Jan 26, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix optimised calls with a separate 'self' argument, e.g. for specialised calls to known builtins.
parent
086f80ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+14
-14
No files found.
Cython/Compiler/ExprNodes.py
View file @
1d01207e
...
@@ -5678,20 +5678,21 @@ class SimpleCallNode(CallNode):
...
@@ -5678,20 +5678,21 @@ class SimpleCallNode(CallNode):
return
True
return
True
def
generate_evaluation_code
(
self
,
code
):
def
generate_evaluation_code
(
self
,
code
):
# Avoid tuple creation for Python calls with 0 or 1 args.
function
=
self
.
function
func_type
=
self
.
function_type
()
if
function
.
is_name
or
function
.
is_attribute
:
if
self
.
function
.
is_name
or
self
.
function
.
is_attribute
:
code
.
globalstate
.
use_entry_utility_code
(
function
.
entry
)
code
.
globalstate
.
use_entry_utility_code
(
self
.
function
.
entry
)
if
not
func_type
.
is_pyobject
or
len
(
self
.
arg_tuple
.
args
)
>
1
:
if
not
function
.
type
.
is_pyobject
or
len
(
self
.
arg_tuple
.
args
)
>
1
or
(
self
.
arg_tuple
.
args
and
self
.
arg_tuple
.
is_literal
):
super
(
SimpleCallNode
,
self
).
generate_evaluation_code
(
code
)
super
(
SimpleCallNode
,
self
).
generate_evaluation_code
(
code
)
return
return
function
=
self
.
function
# Special case 0-args and try to avoid explicit tuple creation for Python calls with 1 arg.
function
.
generate_evaluation_code
(
code
)
arg
=
self
.
arg_tuple
.
args
[
0
]
if
self
.
arg_tuple
.
args
else
None
arg
=
self
.
arg_tuple
.
args
[
0
]
if
self
.
arg_tuple
.
args
else
None
if
arg
is
not
None
:
subexprs
=
(
self
.
self
,
self
.
coerced_self
,
function
,
arg
)
arg
.
generate_evaluation_code
(
code
)
for
subexpr
in
subexprs
:
if
subexpr
is
not
None
:
subexpr
.
generate_evaluation_code
(
code
)
code
.
mark_pos
(
self
.
pos
)
code
.
mark_pos
(
self
.
pos
)
assert
self
.
is_temp
assert
self
.
is_temp
...
@@ -5717,11 +5718,10 @@ class SimpleCallNode(CallNode):
...
@@ -5717,11 +5718,10 @@ class SimpleCallNode(CallNode):
code
.
put_gotref
(
self
.
py_result
())
code
.
put_gotref
(
self
.
py_result
())
function
.
generate_disposal_code
(
code
)
for
subexpr
in
subexprs
:
function
.
free_temps
(
code
)
if
subexpr
is
not
None
:
if
arg
is
not
None
:
subexpr
.
generate_disposal_code
(
code
)
arg
.
generate_disposal_code
(
code
)
subexpr
.
free_temps
(
code
)
arg
.
free_temps
(
code
)
def
generate_result_code
(
self
,
code
):
def
generate_result_code
(
self
,
code
):
func_type
=
self
.
function_type
()
func_type
=
self
.
function_type
()
...
...
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