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
06dd454c
Commit
06dd454c
authored
Aug 15, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix all other uses of addGuard
Hopefully this doesn't end up keeping things alive for too much extra time.
parent
a8b225a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
src/capi/typeobject.cpp
src/capi/typeobject.cpp
+3
-1
src/runtime/classobj.cpp
src/runtime/classobj.cpp
+1
-0
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+6
-0
src/runtime/types.cpp
src/runtime/types.cpp
+2
-0
No files found.
src/capi/typeobject.cpp
View file @
06dd454c
...
...
@@ -972,8 +972,10 @@ Box* slotTpGetattrHookInternal(Box* self, BoxedString* name, GetattrRewriteArgs*
if
(
rewrite_args
)
{
// Fetching getattribute should have done the appropriate guarding on whether or not
// getattribute exists.
if
(
getattribute
)
if
(
getattribute
)
{
r_getattribute
->
addGuard
((
intptr_t
)
getattribute
);
rewrite_args
->
rewriter
->
addGCReference
(
getattribute
);
}
GetattrRewriteArgs
grewrite_args
(
rewrite_args
->
rewriter
,
rewrite_args
->
obj
,
rewrite_args
->
destination
);
try
{
...
...
src/runtime/classobj.cpp
View file @
06dd454c
...
...
@@ -564,6 +564,7 @@ void instanceSetattroInternal(Box* _inst, Box* _attr, STOLEN(Box*) value, Setatt
if
(
rewrite_args
)
{
RewriterVar
*
inst_r
=
rewrite_args
->
obj
->
getAttr
(
offsetof
(
BoxedInstance
,
inst_cls
));
inst_r
->
addGuard
((
uint64_t
)
inst
->
inst_cls
);
rewrite_args
->
rewriter
->
addGCReference
(
inst
->
inst_cls
);
GetattrRewriteArgs
grewrite_args
(
rewrite_args
->
rewriter
,
inst_r
,
rewrite_args
->
rewriter
->
getReturnDestination
());
Box
*
setattr
=
classLookup
<
REWRITABLE
>
(
inst
->
inst_cls
,
setattr_str
,
&
grewrite_args
);
...
...
src/runtime/objmodel.cpp
View file @
06dd454c
...
...
@@ -3755,6 +3755,7 @@ Box* callattrInternal(Box* obj, BoxedString* attr, LookupScope scope, CallattrRe
if
(
rewrite_args
)
{
r_val
->
addGuard
((
int64_t
)
val
);
rewrite_args
->
rewriter
->
addGCReference
(
val
);
rewrite_args
->
obj
=
r_val
;
rewrite_args
->
func_guarded
=
true
;
}
...
...
@@ -5255,6 +5256,7 @@ Box* runtimeCallInternal(Box* obj, CallRewriteArgs* rewrite_args, ArgPassSpec ar
if
(
rewrite_args
&&
!
rewrite_args
->
func_guarded
)
{
r_im_func
->
addGuard
((
intptr_t
)
im
->
func
);
rewrite_args
->
rewriter
->
addGCReference
(
im
->
func
);
rewrite_args
->
func_guarded
=
true
;
}
...
...
@@ -5567,8 +5569,11 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, BinopRewriteArgs* rewrite_ar
RewriterVar
*
r_lhs_cls
=
r_lhs
->
getAttr
(
offsetof
(
Box
,
cls
))
->
setType
(
RefType
::
BORROWED
);
r_lhs_cls
->
addGuard
((
intptr_t
)
lhs
->
cls
);
rewrite_args
->
rewriter
->
addGCReference
(
lhs
->
cls
);
RewriterVar
*
r_rhs_cls
=
r_rhs
->
getAttr
(
offsetof
(
Box
,
cls
))
->
setType
(
RefType
::
BORROWED
);
r_rhs_cls
->
addGuard
((
intptr_t
)
rhs
->
cls
);
rewrite_args
->
rewriter
->
addGCReference
(
rhs
->
cls
);
r_lhs_cls
->
addAttrGuard
(
offsetof
(
BoxedClass
,
tp_mro
),
(
intptr_t
)
lhs
->
cls
->
tp_mro
);
r_rhs_cls
->
addAttrGuard
(
offsetof
(
BoxedClass
,
tp_mro
),
(
intptr_t
)
rhs
->
cls
->
tp_mro
);
...
...
@@ -6786,6 +6791,7 @@ extern "C" Box* createBoxedIterWrapperIfNeeded(Box* o) {
}
else
if
(
r
)
{
RewriterVar
*
rtn
=
rewrite_args
.
getReturn
(
ReturnConvention
::
HAS_RETURN
);
rtn
->
addGuard
((
uint64_t
)
r
);
rewrite_args
.
rewriter
->
addGCReference
(
r
);
rewriter
->
commitReturning
(
r_o
);
return
incref
(
o
);
}
else
/* if (!r) */
{
...
...
src/runtime/types.cpp
View file @
06dd454c
...
...
@@ -823,6 +823,7 @@ static Box* typeCallInner(CallRewriteArgs* rewrite_args, ArgPassSpec argspec, Bo
if
(
rewrite_args
)
{
rewrite_args
->
arg1
->
addGuard
((
intptr_t
)
cls
);
rewrite_args
->
rewriter
->
addGCReference
(
cls
);
}
// Special-case unicode for now, maybe there's something about this that can eventually be generalized:
...
...
@@ -1083,6 +1084,7 @@ static Box* typeCallInner(CallRewriteArgs* rewrite_args, ArgPassSpec argspec, Bo
if
(
init_attr
)
{
r_init
=
grewrite_args
.
getReturn
(
ReturnConvention
::
HAS_RETURN
);
r_init
->
addGuard
((
intptr_t
)
init_attr
);
rewrite_args
->
rewriter
->
addGCReference
(
init_attr
);
}
else
{
grewrite_args
.
assertReturnConvention
(
ReturnConvention
::
NO_RETURN
);
}
...
...
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