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
91df8ebc
Commit
91df8ebc
authored
Feb 29, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ref fixes
parent
7ebd2eb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
4 deletions
+21
-4
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+1
-1
src/core/contiguous_map.h
src/core/contiguous_map.h
+6
-0
src/runtime/import.cpp
src/runtime/import.cpp
+2
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+3
-1
src/runtime/types.cpp
src/runtime/types.cpp
+9
-1
No files found.
src/codegen/unwinding.cpp
View file @
91df8ebc
...
...
@@ -1020,7 +1020,7 @@ extern "C" void abort() {
// In case displaying the traceback recursively calls abort:
static
bool
recursive
=
false
;
if
(
!
recursive
&&
(
uint64_t
)
PyTraceBack_Type
.
ob_refcnt
>
0
)
{
if
(
!
recursive
&&
!
IN_SHUTDOWN
)
{
recursive
=
true
;
Stats
::
dump
();
fprintf
(
stderr
,
"Someone called abort!
\n
"
);
...
...
src/core/contiguous_map.h
View file @
91df8ebc
...
...
@@ -36,6 +36,12 @@ public:
typedef
typename
map_type
::
const_iterator
const_iterator
;
typedef
typename
std
::
vector
<
TVal
>::
size_type
size_type
;
void
clear
()
{
map
.
clear
();
vec
.
clear
();
free_list
.
clear
();
}
iterator
find
(
TKey
key
)
{
return
map
.
find
(
key
);
}
iterator
begin
()
noexcept
{
return
map
.
begin
();
}
...
...
src/runtime/import.cpp
View file @
91df8ebc
...
...
@@ -110,7 +110,8 @@ extern "C" PyObject* PyImport_ExecCodeModuleEx(const char* name, PyObject* co, c
}
extern
"C"
Box
*
import
(
int
level
,
Box
*
from_imports
,
llvm
::
StringRef
module_name
)
{
Box
*
rtn
=
PyImport_ImportModuleLevel
(
module_name
.
str
().
c_str
(),
getGlobalsDict
(),
NULL
,
from_imports
,
level
);
Box
*
rtn
=
PyImport_ImportModuleLevel
(
module_name
.
str
().
c_str
(),
autoDecref
(
getGlobalsDict
()),
NULL
,
from_imports
,
level
);
if
(
!
rtn
)
throwCAPIException
();
return
rtn
;
...
...
src/runtime/objmodel.cpp
View file @
91df8ebc
...
...
@@ -5780,7 +5780,8 @@ Box* getitemInternal(Box* target, Box* slice, GetitemRewriteArgs* rewrite_args)
// (after guarding it's not null), or maybe not. But the rewriter doesn't currently
// support calling a RewriterVar (can only call fixed function addresses).
r_m
->
addAttrGuard
(
offsetof
(
PyMappingMethods
,
mp_subscript
),
(
intptr_t
)
m
->
mp_subscript
);
RewriterVar
*
r_rtn
=
rewrite_args
->
rewriter
->
call
(
true
,
(
void
*
)
m
->
mp_subscript
,
r_obj
,
r_slice
);
RewriterVar
*
r_rtn
=
rewrite_args
->
rewriter
->
call
(
true
,
(
void
*
)
m
->
mp_subscript
,
r_obj
,
r_slice
)
->
setType
(
RefType
::
OWNED
);
if
(
S
==
CXX
)
rewrite_args
->
rewriter
->
checkAndThrowCAPIException
(
r_rtn
);
rewrite_args
->
out_success
=
true
;
...
...
@@ -6506,6 +6507,7 @@ Box* _typeNew(BoxedClass* metatype, BoxedString* name, BoxedTuple* bases, BoxedD
static
BoxedString
*
module_str
=
getStaticString
(
"__module__"
);
if
(
!
made
->
hasattr
(
module_str
))
{
Box
*
gl
=
getGlobalsDict
();
AUTO_DECREF
(
gl
);
static
BoxedString
*
name_str
=
getStaticString
(
"__name__"
);
Box
*
attr
=
PyDict_GetItem
(
gl
,
name_str
);
if
(
attr
)
...
...
src/runtime/types.cpp
View file @
91df8ebc
...
...
@@ -3485,6 +3485,14 @@ void BoxedModule::dealloc(Box* b) noexcept {
BoxedModule
::
clear
(
self
);
self
->
str_constants
.
~
ContiguousMap
();
self
->
unicode_constants
.
~
ContiguousMap
();
self
->
int_constants
.
~
ContiguousMap
();
self
->
float_constants
.
~
ContiguousMap
();
self
->
imaginary_constants
.
~
ContiguousMap
();
self
->
long_constants
.
~
ContiguousMap
();
assert
(
!
self
->
keep_alive
.
size
());
b
->
cls
->
tp_free
(
self
);
}
...
...
@@ -3499,7 +3507,7 @@ void clearContiguousMap(CM& cm) {
for
(
auto
&&
p
:
cm
)
{
Py_DECREF
(
cm
.
getMapped
(
p
.
second
));
}
cm
.
~
ContiguousMap
();
cm
.
clear
();
}
int
BoxedModule
::
clear
(
Box
*
b
)
noexcept
{
...
...
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