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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
1d01207e
Commit
1d01207e
authored
7 years ago
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
Hide 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):
return
True
def
generate_evaluation_code
(
self
,
code
):
# Avoid tuple creation for Python calls with 0 or 1 args.
func_type
=
self
.
function_type
()
if
self
.
function
.
is_name
or
self
.
function
.
is_attribute
:
code
.
globalstate
.
use_entry_utility_code
(
self
.
function
.
entry
)
function
=
self
.
function
if
function
.
is_name
or
function
.
is_attribute
:
code
.
globalstate
.
use_entry_utility_code
(
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
)
return
function
=
self
.
function
function
.
generate_evaluation_code
(
code
)
# Special case 0-args and try to avoid explicit tuple creation for Python calls with 1 arg.
arg
=
self
.
arg_tuple
.
args
[
0
]
if
self
.
arg_tuple
.
args
else
None
if
arg
is
not
None
:
arg
.
generate_evaluation_code
(
code
)
subexprs
=
(
self
.
self
,
self
.
coerced_self
,
function
,
arg
)
for
subexpr
in
subexprs
:
if
subexpr
is
not
None
:
subexpr
.
generate_evaluation_code
(
code
)
code
.
mark_pos
(
self
.
pos
)
assert
self
.
is_temp
...
...
@@ -5717,11 +5718,10 @@ class SimpleCallNode(CallNode):
code
.
put_gotref
(
self
.
py_result
())
function
.
generate_disposal_code
(
code
)
function
.
free_temps
(
code
)
if
arg
is
not
None
:
arg
.
generate_disposal_code
(
code
)
arg
.
free_temps
(
code
)
for
subexpr
in
subexprs
:
if
subexpr
is
not
None
:
subexpr
.
generate_disposal_code
(
code
)
subexpr
.
free_temps
(
code
)
def
generate_result_code
(
self
,
code
):
func_type
=
self
.
function_type
()
...
...
This diff is collapsed.
Click to expand it.
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