Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
0e98930e
Commit
0e98930e
authored
Aug 31, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When calling a BoxedWrapperDescriptor don't create a BoxedWrapperObject
parent
0a8385c9
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
110 deletions
+141
-110
src/runtime/descr.cpp
src/runtime/descr.cpp
+114
-96
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+24
-14
src/runtime/types.h
src/runtime/types.h
+3
-0
No files found.
src/runtime/descr.cpp
View file @
0e98930e
This diff is collapsed.
Click to expand it.
src/runtime/objmodel.cpp
View file @
0e98930e
...
@@ -1123,23 +1123,33 @@ Box* nondataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, Box
...
@@ -1123,23 +1123,33 @@ Box* nondataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, Box
return
sm
->
sm_callable
;
return
sm
->
sm_callable
;
}
else
if
(
descr
->
cls
==
wrapperdescr_cls
)
{
}
else
if
(
descr
->
cls
==
wrapperdescr_cls
)
{
BoxedWrapperDescriptor
*
self
=
static_cast
<
BoxedWrapperDescriptor
*>
(
descr
);
if
(
for_call
)
{
Box
*
inst
=
obj
;
if
(
rewrite_args
)
{
Box
*
owner
=
obj
->
cls
;
rewrite_args
->
out_success
=
true
;
rewrite_args
->
out_rtn
=
r_descr
;
Box
*
r
=
BoxedWrapperDescriptor
::
descr_get
(
self
,
inst
,
owner
);
rewrite_args
->
out_return_convention
=
GetattrRewriteArgs
::
VALID_RETURN
;
*
r_bind_obj_out
=
rewrite_args
->
obj
;
}
*
bind_obj_out
=
obj
;
return
descr
;
}
else
{
BoxedWrapperDescriptor
*
self
=
static_cast
<
BoxedWrapperDescriptor
*>
(
descr
);
Box
*
inst
=
obj
;
Box
*
owner
=
obj
->
cls
;
Box
*
r
=
BoxedWrapperDescriptor
::
descr_get
(
self
,
inst
,
owner
);
if
(
rewrite_args
)
{
if
(
rewrite_args
)
{
// TODO: inline this?
// TODO: inline this?
RewriterVar
*
r_rtn
=
rewrite_args
->
rewriter
->
call
(
RewriterVar
*
r_rtn
=
rewrite_args
->
rewriter
->
call
(
/* has_side_effects= */
false
,
(
void
*
)
&
BoxedWrapperDescriptor
::
descr_get
,
r_descr
,
rewrite_args
->
obj
,
/* has_side_effects= */
false
,
(
void
*
)
&
BoxedWrapperDescriptor
::
descr_get
,
r_descr
,
r_descr
->
getAttr
(
offsetof
(
Box
,
cls
),
Location
::
forArg
(
2
)));
rewrite_args
->
obj
,
r_descr
->
getAttr
(
offsetof
(
Box
,
cls
),
Location
::
forArg
(
2
)));
rewrite_args
->
out_success
=
true
;
rewrite_args
->
out_success
=
true
;
rewrite_args
->
out_rtn
=
r_rtn
;
rewrite_args
->
out_rtn
=
r_rtn
;
rewrite_args
->
out_return_convention
=
GetattrRewriteArgs
::
VALID_RETURN
;
rewrite_args
->
out_return_convention
=
GetattrRewriteArgs
::
VALID_RETURN
;
}
return
r
;
}
}
return
r
;
}
}
return
NULL
;
return
NULL
;
...
...
src/runtime/types.h
View file @
0e98930e
...
@@ -1008,6 +1008,9 @@ public:
...
@@ -1008,6 +1008,9 @@ public:
static
Box
*
descr_get
(
Box
*
self
,
Box
*
inst
,
Box
*
owner
)
noexcept
;
static
Box
*
descr_get
(
Box
*
self
,
Box
*
inst
,
Box
*
owner
)
noexcept
;
static
Box
*
__call__
(
BoxedWrapperDescriptor
*
descr
,
PyObject
*
self
,
BoxedTuple
*
args
,
Box
**
_args
);
static
Box
*
__call__
(
BoxedWrapperDescriptor
*
descr
,
PyObject
*
self
,
BoxedTuple
*
args
,
Box
**
_args
);
template
<
ExceptionStyle
S
>
static
Box
*
tppCall
(
Box
*
_self
,
CallRewriteArgs
*
rewrite_args
,
ArgPassSpec
argspec
,
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
,
Box
**
args
,
const
std
::
vector
<
BoxedString
*>*
keyword_names
)
noexcept
(
S
==
CAPI
);
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
_o
);
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
_o
);
};
};
...
...
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