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
Xavier Thompson
cython
Commits
7a518b87
Commit
7a518b87
authored
8 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
share the code object between the cpdef function implementation and its wrapper
parent
2ca582e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+7
-1
No files found.
Cython/Compiler/Nodes.py
View file @
7a518b87
...
@@ -1616,6 +1616,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1616,6 +1616,7 @@ class FuncDefNode(StatNode, BlockNode):
needs_closure
=
False
needs_closure
=
False
needs_outer_scope
=
False
needs_outer_scope
=
False
pymethdef_required
=
False
pymethdef_required
=
False
is_wrapper
=
False
is_generator
=
False
is_generator
=
False
is_generator_body
=
False
is_generator_body
=
False
is_async_def
=
False
is_async_def
=
False
...
@@ -1892,7 +1893,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1892,7 +1893,7 @@ class FuncDefNode(StatNode, BlockNode):
if
profile
or
linetrace
:
if
profile
or
linetrace
:
# this looks a bit late, but if we don't get here due to a
# this looks a bit late, but if we don't get here due to a
# fatal error before hand, it's not really worth tracing
# fatal error before hand, it's not really worth tracing
if
isinstance
(
self
,
DefNode
)
and
self
.
is_wrapper
:
if
self
.
is_wrapper
:
trace_name
=
self
.
entry
.
name
+
" (wrapper)"
trace_name
=
self
.
entry
.
name
+
" (wrapper)"
else
:
else
:
trace_name
=
self
.
entry
.
name
trace_name
=
self
.
entry
.
name
...
@@ -2256,6 +2257,11 @@ class CFuncDefNode(FuncDefNode):
...
@@ -2256,6 +2257,11 @@ class CFuncDefNode(FuncDefNode):
def
unqualified_name
(
self
):
def
unqualified_name
(
self
):
return
self
.
entry
.
name
return
self
.
entry
.
name
@
property
def
code_object
(
self
):
# share the CodeObject with the cpdef wrapper (if available)
return
self
.
py_func
.
code_object
if
self
.
py_func
else
None
def
analyse_declarations
(
self
,
env
):
def
analyse_declarations
(
self
,
env
):
self
.
is_c_class_method
=
env
.
is_c_class_scope
self
.
is_c_class_method
=
env
.
is_c_class_scope
if
self
.
directive_locals
is
None
:
if
self
.
directive_locals
is
None
:
...
...
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