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
714969bc
Commit
714969bc
authored
Feb 05, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refcounting fixes
parent
624173aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
4 deletions
+22
-4
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+1
-1
src/jit.cpp
src/jit.cpp
+2
-0
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+1
-1
src/runtime/capi.cpp
src/runtime/capi.cpp
+5
-0
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+1
-1
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
test/tests/refcounting_regression_test.py
test/tests/refcounting_regression_test.py
+11
-0
No files found.
src/codegen/ast_interpreter.cpp
View file @
714969bc
...
...
@@ -308,7 +308,7 @@ void ASTInterpreter::startJITing(CFGBlock* block, int exit_offset) {
code_block
=
code_blocks
[
code_blocks
.
size
()
-
1
].
get
();
if
(
!
code_block
||
code_block
->
shouldCreateNewBlock
())
{
code_blocks
.
push_back
(
std
::
unique_ptr
<
JitCodeBlock
>
(
new
JitCodeBlock
(
autoDecref
(
source_info
->
getName
()
)
->
s
())));
code_blocks
.
push_back
(
std
::
unique_ptr
<
JitCodeBlock
>
(
new
JitCodeBlock
(
source_info
->
getName
(
)
->
s
())));
code_block
=
code_blocks
[
code_blocks
.
size
()
-
1
].
get
();
exit_offset
=
0
;
}
...
...
src/jit.cpp
View file @
714969bc
...
...
@@ -456,6 +456,7 @@ static int main(int argc, char** argv) noexcept {
}
catch
(
ExcInfo
e
)
{
setCAPIException
(
e
);
PyErr_Print
();
PyErr_Clear
();
rtncode
=
1
;
}
}
else
if
(
module
!=
NULL
)
{
...
...
@@ -499,6 +500,7 @@ static int main(int argc, char** argv) noexcept {
}
catch
(
ExcInfo
e
)
{
setCAPIException
(
e
);
PyErr_Print
();
PyErr_Clear
();
rtncode
=
1
;
}
}
...
...
src/runtime/builtin_modules/sys.cpp
View file @
714969bc
...
...
@@ -150,7 +150,7 @@ extern "C" int PySys_SetObject(const char* name, PyObject* v) noexcept {
return
0
;
}
extern
"C"
PyObject
*
PySys_GetObject
(
const
char
*
name
)
noexcept
{
extern
"C"
BORROWED
(
PyObject
*
)
PySys_GetObject
(
const
char
*
name
)
noexcept
{
return
sys_module
->
getattr
(
autoDecref
(
internStringMortal
(
name
)));
}
...
...
src/runtime/capi.cpp
View file @
714969bc
...
...
@@ -1858,6 +1858,11 @@ Box* BoxedCApiFunction::tppCall(Box* _self, CallRewriteArgs* rewrite_args, ArgPa
if
(
!
rewrite_success
)
rewrite_args
=
NULL
;
assert
(
!
oargs
);
AUTO_XDECREF
(
arg1
);
AUTO_XDECREF
(
arg2
);
AUTO_XDECREF
(
arg3
);
RewriterVar
*
r_passthrough
=
NULL
;
if
(
rewrite_args
)
r_passthrough
=
rewrite_args
->
rewriter
->
loadConst
((
intptr_t
)
self
->
passthrough
,
Location
::
forArg
(
0
));
...
...
src/runtime/objmodel.cpp
View file @
714969bc
...
...
@@ -4078,7 +4078,7 @@ Box* callFunc(BoxedFunctionBase* func, CallRewriteArgs* rewrite_args, ArgPassSpe
AUTO_XDECREF
(
arg1
);
AUTO_XDECREF
(
arg2
);
AUTO_XDECREF
(
arg3
);
AUTO_XDECREF_ARRAY
(
args
,
num_output_args
-
3
);
AUTO_XDECREF_ARRAY
(
o
args
,
num_output_args
-
3
);
if
(
rewrite_args
&&
!
rewrite_success
)
{
assert
(
0
&&
"check refcounting"
);
...
...
src/runtime/types.cpp
View file @
714969bc
...
...
@@ -364,7 +364,7 @@ BoxedFunction::BoxedFunction(FunctionMetadata* md, std::initializer_list<Box*> d
// we don't have yet.
if
(
md
->
source
)
{
assert
(
!
this
->
name
);
this
->
name
=
static_cast
<
BoxedString
*>
(
md
->
source
->
getName
(
));
this
->
name
=
incref
(
static_cast
<
BoxedString
*>
(
md
->
source
->
getName
()
));
}
}
...
...
test/tests/refcounting_regression_test.py
0 → 100644
View file @
714969bc
# Random regression test from implementing refcounting:
def
f
():
f
.
x
=
f
f
()
f
()
f
()
f
()
f
()
f
()
f
()
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