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
c429f19d
Commit
c429f19d
authored
May 21, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1185 from undingen/sqlalchemy_ref
enable sqlalchemy_smalltest
parents
88070844
1257cf68
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
33 deletions
+32
-33
src/codegen/irgen/refcounts.cpp
src/codegen/irgen/refcounts.cpp
+3
-0
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+10
-6
src/codegen/unwinding.h
src/codegen/unwinding.h
+4
-2
src/runtime/exceptions.cpp
src/runtime/exceptions.cpp
+5
-15
test/integration/sqlalchemy_smalltest.py
test/integration/sqlalchemy_smalltest.py
+10
-10
No files found.
src/codegen/irgen/refcounts.cpp
View file @
c429f19d
...
...
@@ -85,6 +85,9 @@ void RefcountTracker::refConsumed(llvm::Value* v, llvm::Instruction* inst) {
}
void
RefcountTracker
::
refUsed
(
llvm
::
Value
*
v
,
llvm
::
Instruction
*
inst
)
{
if
(
llvm
::
isa
<
UndefValue
>
(
v
))
return
;
assert
(
this
->
vars
[
v
].
reftype
!=
RefType
::
UNKNOWN
);
this
->
refs_used
[
inst
].
push_back
(
v
);
...
...
src/codegen/unwinding.cpp
View file @
c429f19d
...
...
@@ -545,14 +545,17 @@ public:
stat
.
log
();
}
std
::
tuple
<
FrameInfo
*
,
ExcInfo
,
PythonStackExtractor
>
pause
()
{
std
::
tuple
<
FrameInfo
*
,
ExcInfo
,
PythonStackExtractor
,
bool
>
pause
()
{
static
StatCounter
stat
(
"us_unwind_session"
);
stat
.
log
(
t
.
end
());
return
std
::
make_tuple
(
std
::
move
(
prev_frame_info
),
std
::
move
(
exc_info
),
std
::
move
(
pystack_extractor
));
bool
is_reraise
=
getIsReraiseFlag
();
getIsReraiseFlag
()
=
false
;
return
std
::
make_tuple
(
std
::
move
(
prev_frame_info
),
std
::
move
(
exc_info
),
std
::
move
(
pystack_extractor
),
is_reraise
);
}
void
resume
(
std
::
tuple
<
FrameInfo
*
,
ExcInfo
,
PythonStackExtractor
>&&
state
)
{
std
::
tie
(
prev_frame_info
,
exc_info
,
pystack_extractor
)
=
state
;
void
resume
(
std
::
tuple
<
FrameInfo
*
,
ExcInfo
,
PythonStackExtractor
,
bool
>&&
state
)
{
std
::
tie
(
prev_frame_info
,
exc_info
,
pystack_extractor
,
getIsReraiseFlag
()
)
=
state
;
t
.
restart
();
}
...
...
@@ -620,11 +623,12 @@ public:
// make sure that our libunwind based python frame handling and the manual one are the same.
assert
(
prev_frame_info
==
getTopFrameInfo
());
if
(
exceptionAtLineCheck
())
{
if
(
!
getIsReraiseFlag
())
{
// TODO: shouldn't fetch this multiple times?
frame_iter
.
getCurrentStatement
()
->
cxx_exception_count
++
;
exceptionAtLine
(
&
exc_info
.
traceback
);
}
}
else
getIsReraiseFlag
()
=
false
;
}
}
};
...
...
src/codegen/unwinding.h
View file @
c429f19d
...
...
@@ -59,8 +59,10 @@ void unwindingThroughFrame(PythonUnwindSession* unwind_session, unw_cursor_t* cu
// TODO move these to exceptions.h
void
logException
(
ExcInfo
*
exc_info
);
void
startReraise
();
bool
exceptionAtLineCheck
();
bool
&
getIsReraiseFlag
();
inline
void
startReraise
()
{
getIsReraiseFlag
()
=
true
;
}
void
exceptionAtLine
(
Box
**
traceback
);
void
caughtCxxException
(
ExcInfo
*
exc_info
);
extern
"C"
void
caughtCapiException
();
...
...
src/runtime/exceptions.cpp
View file @
c429f19d
...
...
@@ -299,30 +299,20 @@ void caughtCxxException(ExcInfo* exc_info) {
exceptionAtLine
(
&
exc_info
->
traceback
);
}
struct
ExcState
{
bool
is_reraise
;
constexpr
ExcState
()
:
is_reraise
(
false
)
{}
}
static
__thread
exc_state
;
bool
exceptionAtLineCheck
()
{
if
(
exc_state
.
is_reraise
)
{
exc_state
.
is_reraise
=
false
;
return
false
;
}
return
true
;
bool
&
getIsReraiseFlag
()
{
return
exc_state
.
is_reraise
;
}
void
exceptionAtLine
(
Box
**
traceback
)
{
if
(
exceptionAtLineCheck
())
{
if
(
!
getIsReraiseFlag
())
PyTraceBack_Here_Tb
((
struct
_frame
*
)
getFrame
((
FrameInfo
*
)
cur_thread_state
.
frame_info
),
(
PyTracebackObject
**
)
traceback
);
}
}
void
startReraise
()
{
assert
(
!
exc_state
.
is_reraise
);
exc_state
.
is_reraise
=
true
;
else
getIsReraiseFlag
()
=
false
;
}
}
test/integration/sqlalchemy_smalltest.py
View file @
c429f19d
# expected: reffail
import
gc
import
os
import
sys
...
...
@@ -192,21 +191,22 @@ MODULES_TO_TEST = [
'test.sql.test_rowcount'
,
'test.sql.test_selectable'
,
'test.sql.test_text'
,
'test.sql.test_unicode'
,
'test.aaa_profiling.test_resultset'
,
'test.dialect.test_sqlite'
,
'test.orm.test_dynamic'
,
'test.orm.test_merge'
,
'test.orm.test_relationships'
,
'test.orm.test_versioning'
,
'test.sql.test_compiler'
,
]
FAILING
=
[
# 'test.aaa_profiling.test_memusage', # Wants gc.get_objects
# 'test.aaa_profiling.test_resultset', # Wants sys.getrefcount
# 'test.dialect.test_sqlite', # ascii codec can't encode
# 'test.ext.test_extendedattr', # does `locals()[42] = 99` in a classdef to prove it can. maybe we could say is_pypy to avoid it.
# 'test.orm.test_dynamic', # not sure; things end up being put in tuples
# 'test.orm.test_merge', # needs PyObject_AsWriteBuffer
# 'test.orm.test_relationships', # not sure; things end up being put in tuples
# 'test.aaa_profiling.test_memusage', # assert(obj->cls != closure_cls);
# 'test.orm.test_session', # unclear
# 'test.orm.test_versioning', # crashes in the uuid module with an AttributeError from ctypes
# 'test.sql.test_compiler', # unclear
# 'test.sql.test_quote', # unclear
# 'test.sql.test_unicode', # "ascii codec can't encod character"
]
# MODULES_TO_TEST = ['test.orm.test_bulk']
...
...
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