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
9db1f0cc
Commit
9db1f0cc
authored
Dec 10, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy frameobject.h and _warnings.c from CPython to Pyston
parent
bd361100
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
999 additions
and
0 deletions
+999
-0
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+1
-0
from_cpython/Include/frameobject.h
from_cpython/Include/frameobject.h
+88
-0
from_cpython/Python/_warnings.c
from_cpython/Python/_warnings.c
+910
-0
No files found.
from_cpython/CMakeLists.txt
View file @
9db1f0cc
...
...
@@ -114,6 +114,7 @@ file(GLOB_RECURSE STDPYTHON_SRCS Python
Python-ast.c
random.c
structmember.c
_warnings.c
)
# compile specified files in from_cpython/Python
...
...
from_cpython/Include/frameobject.h
0 → 100644
View file @
9db1f0cc
/* Frame object interface */
#ifndef Py_FRAMEOBJECT_H
#define Py_FRAMEOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
int
b_type
;
/* what kind of block this is */
int
b_handler
;
/* where to jump to find handler */
int
b_level
;
/* value stack level to pop to */
}
PyTryBlock
;
typedef
struct
_frame
{
PyObject_VAR_HEAD
struct
_frame
*
f_back
;
/* previous frame, or NULL */
PyCodeObject
*
f_code
;
/* code segment */
PyObject
*
f_builtins
;
/* builtin symbol table (PyDictObject) */
PyObject
*
f_globals
;
/* global symbol table (PyDictObject) */
PyObject
*
f_locals
;
/* local symbol table (any mapping) */
PyObject
**
f_valuestack
;
/* points after the last local */
/* Next free slot in f_valuestack. Frame creation sets to f_valuestack.
Frame evaluation usually NULLs it, but a frame that yields sets it
to the current stack top. */
PyObject
**
f_stacktop
;
PyObject
*
f_trace
;
/* Trace function */
/* If an exception is raised in this frame, the next three are used to
* record the exception info (if any) originally in the thread state. See
* comments before set_exc_info() -- it's not obvious.
* Invariant: if _type is NULL, then so are _value and _traceback.
* Desired invariant: all three are NULL, or all three are non-NULL. That
* one isn't currently true, but "should be".
*/
PyObject
*
f_exc_type
,
*
f_exc_value
,
*
f_exc_traceback
;
PyThreadState
*
f_tstate
;
int
f_lasti
;
/* Last instruction if called */
/* Call PyFrame_GetLineNumber() instead of reading this field
directly. As of 2.3 f_lineno is only valid when tracing is
active (i.e. when f_trace is set). At other times we use
PyCode_Addr2Line to calculate the line from the current
bytecode index. */
int
f_lineno
;
/* Current line number */
int
f_iblock
;
/* index in f_blockstack */
PyTryBlock
f_blockstack
[
CO_MAXBLOCKS
];
/* for try and loop blocks */
PyObject
*
f_localsplus
[
1
];
/* locals+stack, dynamically sized */
}
PyFrameObject
;
/* Standard object interface */
PyAPI_DATA
(
PyTypeObject
)
PyFrame_Type
;
#define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
#define PyFrame_IsRestricted(f) \
((f)->f_builtins != (f)->f_tstate->interp->builtins)
PyAPI_FUNC
(
PyFrameObject
*
)
PyFrame_New
(
PyThreadState
*
,
PyCodeObject
*
,
PyObject
*
,
PyObject
*
);
/* The rest of the interface is specific for frame objects */
/* Block management functions */
PyAPI_FUNC
(
void
)
PyFrame_BlockSetup
(
PyFrameObject
*
,
int
,
int
,
int
);
PyAPI_FUNC
(
PyTryBlock
*
)
PyFrame_BlockPop
(
PyFrameObject
*
);
/* Extend the value stack */
PyAPI_FUNC
(
PyObject
**
)
PyFrame_ExtendStack
(
PyFrameObject
*
,
int
,
int
);
/* Conversions between "fast locals" and locals in dictionary */
PyAPI_FUNC
(
void
)
PyFrame_LocalsToFast
(
PyFrameObject
*
,
int
);
PyAPI_FUNC
(
void
)
PyFrame_FastToLocals
(
PyFrameObject
*
);
PyAPI_FUNC
(
int
)
PyFrame_ClearFreeList
(
void
);
#endif
/* Return the line of code the frame is currently executing. */
PyAPI_FUNC
(
int
)
PyFrame_GetLineNumber
(
PyObject
*
)
PYSTON_NOEXCEPT
;
#ifdef __cplusplus
}
#endif
/* !Py_FRAMEOBJECT_H */
from_cpython/Python/_warnings.c
0 → 100644
View file @
9db1f0cc
This diff is collapsed.
Click to expand it.
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