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
bc72f09e
Commit
bc72f09e
authored
Mar 28, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get signal_test working
parent
a4becfef
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
17 deletions
+18
-17
src/core/threading.cpp
src/core/threading.cpp
+1
-0
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+1
-1
src/runtime/capi.cpp
src/runtime/capi.cpp
+0
-1
src/runtime/exceptions.cpp
src/runtime/exceptions.cpp
+1
-1
src/runtime/frame.cpp
src/runtime/frame.cpp
+13
-11
src/runtime/types.h
src/runtime/types.h
+2
-2
test/tests/signal_test.py
test/tests/signal_test.py
+0
-1
No files found.
src/core/threading.cpp
View file @
bc72f09e
...
...
@@ -600,6 +600,7 @@ extern "C" void PyThread_delete_key_value(int key) noexcept {
extern
"C"
PyObject
*
_PyThread_CurrentFrames
(
void
)
noexcept
{
assert
(
0
&&
"check refcounting"
);
try
{
LOCK_REGION
(
&
threading_lock
);
BoxedDict
*
result
=
new
BoxedDict
;
...
...
src/runtime/builtin_modules/sys.cpp
View file @
bc72f09e
...
...
@@ -115,7 +115,7 @@ Box* sysGetFrame(Box* val) {
if
(
!
frame
)
{
raiseExcHelper
(
ValueError
,
"call stack is not deep enough"
);
}
return
frame
;
return
incref
(
frame
)
;
}
Box
*
sysCurrentFrames
()
{
...
...
src/runtime/capi.cpp
View file @
bc72f09e
...
...
@@ -1661,7 +1661,6 @@ extern "C" void PyEval_RestoreThread(PyThreadState* tstate) noexcept {
}
extern
"C"
BORROWED
(
struct
_frame
*
)
PyEval_GetFrame
(
void
)
noexcept
{
assert
(
0
&&
"check refcounting"
);
Box
*
frame
=
NULL
;
try
{
frame
=
getFrame
(
0
);
...
...
src/runtime/exceptions.cpp
View file @
bc72f09e
...
...
@@ -312,7 +312,7 @@ bool exceptionAtLineCheck() {
void
exceptionAtLine
(
Box
**
traceback
)
{
if
(
exceptionAtLineCheck
())
{
PyTraceBack_Here_Tb
((
struct
_frame
*
)
autoDecref
(
getFrame
((
FrameInfo
*
)
cur_thread_state
.
frame_info
)
),
PyTraceBack_Here_Tb
((
struct
_frame
*
)
getFrame
((
FrameInfo
*
)
cur_thread_state
.
frame_info
),
(
PyTracebackObject
**
)
traceback
);
}
}
...
...
src/runtime/frame.cpp
View file @
bc72f09e
...
...
@@ -119,7 +119,7 @@ public:
if
(
!
f
->
frame_info
->
back
)
f
->
_back
=
incref
(
None
);
else
f
->
_back
=
BoxedFrame
::
boxFrame
(
f
->
frame_info
->
back
);
f
->
_back
=
incref
(
BoxedFrame
::
boxFrame
(
f
->
frame_info
->
back
)
);
}
return
incref
(
f
->
_back
);
...
...
@@ -153,11 +153,11 @@ public:
DEFAULT_CLASS
(
frame_cls
);
static
B
ox
*
boxFrame
(
FrameInfo
*
fi
)
{
static
B
ORROWED
(
Box
*
)
boxFrame
(
FrameInfo
*
fi
)
{
if
(
fi
->
frame_obj
==
NULL
)
fi
->
frame_obj
=
new
BoxedFrame
(
fi
);
assert
(
fi
->
frame_obj
->
cls
==
frame_cls
);
return
incref
(
fi
->
frame_obj
)
;
return
fi
->
frame_obj
;
}
static
void
dealloc
(
Box
*
b
)
noexcept
{
...
...
@@ -185,12 +185,13 @@ public:
return
0
;
}
static
Box
*
boxFrame
(
Box
*
back
,
BoxedCode
*
code
,
Box
*
globals
,
Box
*
locals
)
{
static
Box
*
createFrame
(
Box
*
back
,
BoxedCode
*
code
,
Box
*
globals
,
Box
*
locals
)
{
assert
(
0
&&
"ch eck refcounting"
);
BoxedFrame
*
frame
=
new
BoxedFrame
(
NULL
);
frame
->
_back
=
back
;
frame
->
_code
=
(
Box
*
)
code
;
frame
->
_globals
=
globals
;
frame
->
_locals
=
locals
;
frame
->
_back
=
incref
(
back
)
;
frame
->
_code
=
(
Box
*
)
incref
(
code
)
;
frame
->
_globals
=
incref
(
globals
)
;
frame
->
_locals
=
incref
(
locals
)
;
frame
->
_linenumber
=
-
1
;
return
frame
;
}
...
...
@@ -200,11 +201,11 @@ extern "C" int PyFrame_ClearFreeList(void) noexcept {
return
0
;
// number of entries cleared
}
B
ox
*
getFrame
(
FrameInfo
*
frame_info
)
{
B
ORROWED
(
Box
*
)
getFrame
(
FrameInfo
*
frame_info
)
{
return
BoxedFrame
::
boxFrame
(
frame_info
);
}
B
ox
*
getFrame
(
int
depth
)
{
B
ORROWED
(
Box
*
)
getFrame
(
int
depth
)
{
FrameInfo
*
frame_info
=
getPythonFrameInfo
(
depth
);
if
(
!
frame_info
)
return
NULL
;
...
...
@@ -299,7 +300,7 @@ extern "C" PyFrameObject* PyFrame_New(PyThreadState* tstate, PyCodeObject* code,
RELEASE_ASSERT
(
PyCode_Check
((
Box
*
)
code
),
""
);
RELEASE_ASSERT
(
!
globals
||
PyDict_Check
(
globals
)
||
globals
->
cls
==
attrwrapper_cls
,
"%s"
,
globals
->
cls
->
tp_name
);
RELEASE_ASSERT
(
!
locals
||
PyDict_Check
(
locals
),
"%s"
,
locals
->
cls
->
tp_name
);
return
(
PyFrameObject
*
)
BoxedFrame
::
box
Frame
(
getFrame
(
0
),
(
BoxedCode
*
)
code
,
globals
,
locals
);
return
(
PyFrameObject
*
)
BoxedFrame
::
create
Frame
(
getFrame
(
0
),
(
BoxedCode
*
)
code
,
globals
,
locals
);
}
extern
"C"
PyObject
*
PyFrame_GetGlobals
(
PyFrameObject
*
f
)
noexcept
{
...
...
@@ -310,6 +311,7 @@ extern "C" PyObject* PyFrame_GetCode(PyFrameObject* f) noexcept {
}
extern
"C"
PyFrameObject
*
PyFrame_ForStackLevel
(
int
stack_level
)
noexcept
{
assert
(
0
&&
"check refcounting -- are callers expecting a borrowed ref?"
);
return
(
PyFrameObject
*
)
getFrame
(
stack_level
);
}
...
...
src/runtime/types.h
View file @
bc72f09e
...
...
@@ -1363,8 +1363,8 @@ extern Box* dict_descr;
FunctionMetadata
*
metadataFromCode
(
Box
*
code
);
B
ox
*
getFrame
(
FrameInfo
*
frame_info
);
B
ox
*
getFrame
(
int
depth
);
B
ORROWED
(
Box
*
)
getFrame
(
FrameInfo
*
frame_info
);
B
ORROWED
(
Box
*
)
getFrame
(
int
depth
);
void
frameInvalidateBack
(
BoxedFrame
*
frame
);
extern
"C"
void
deinitFrame
(
FrameInfo
*
frame_info
);
int
frameinfo_traverse
(
FrameInfo
*
frame_info
,
visitproc
visit
,
void
*
arg
)
noexcept
;
...
...
test/tests/signal_test.py
View file @
bc72f09e
# expected: reffail
import
signal
for
k
in
sorted
(
dir
(
signal
)):
...
...
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